[Mesa-dev] [PATCH 0/8] llvmpipe: Fixes for PowerPC/big-endian machines

Jose Fonseca jfonseca at vmware.com
Thu Nov 29 03:58:46 PST 2012



----- Original Message -----
> On 11/27/2012 04:28 PM, Jose Fonseca wrote:
> >
> > ----- Original Message -----
> >> Hi all,
> >>
> >> This set of patches fixes all the llvmpipe lp_test_* for PowerPC.
> >> The
> >> first five
> >> add Altivec intrinsics that fixes all arith testcases, while the
> >> remaining one
> >> deals mainly with big-endian memory loads and shift/mask
> >> algorithms.
> >>
> >> The first three are repost of previous patches that I included
> >> just
> >> for organization.
> >>
> >> [PATCH 1/8] PowerPC: Altivec pack/unpack intrisics
> >> [PATCH 2/8] PowerPC: Altivec vector max/min intrisics
> >> [PATCH 3/8] PowerPC: Altivec vector add/sub intrisics
> >> [PATCH 4/8] PowerPC: Altivec floating-point rounding
> >> [PATCH 5/8] PowerPC: clear Altivec NJ bit
> > D3D10 spec (
> > http://msdn.microsoft.com/en-us/library/windows/desktop/cc308050.aspx
> > ) states that "Denorms are flushed to sign-preserved zero on input
> > and output of any floating-point mathematical operation.".
> >
> > So we might actually need to go back on this.
> 
> I added this denormal handling to fix two issues I noted in PPC
> tests:
> 
> 1. lp_test_arit:
> fract(1.40129846e-45): ref = 1.40129846e-45, out = 0, precision =
> -0.000000 bits, FAIL
> fract(-1.40129846e-45): ref = 0.99999994, out = 0, precision =
> -0.000000 bits, FAIL
> fract(5.8799997e-39): ref = 5.8799997e-39, out = 0, precision =
> -0.000000 bits, FAIL
> 
> 2. lp_test_format:
> Testing PIPE_FORMAT_R16_FLOAT (float) ...
> FAILED
>   Packed: ff 03 00 00
>   Unpacked (0,0): 0 0 0 1 obtained
>                   6.09756e-05 0 0 1 expected
> 
> First one is in fact related on how the Altivec fused
> multiplication-add is being
> generated by LLVM (the addedum is not -0.0 to preseve signal, but
> just 0.0) and I'll
> correct it in the backend.
> 
> The second issue is how the denormals are handled and the problem is
> with
> 'lp_build_half_to_float' function: it scales the exponent with a
> multiplication
> (line 194 - LLVMBuildFMul(builder, shifted, f32_magic, "") and if the
> argument is
> denormal it will be flushed to 0 (which it is the case of the
> failure). I didn't
> dig into how it is handled in X86 backend,
> but it does not fail in this platform.
> 
> 
> >
> >> [PATCH 6/8] llvmpipe: Fix vector constant for shuffle
> >> [PATCH 7/8] llvmpipe: Add byte-swap construct calls
> >> [PATCH 8/8] llvmpipe: Fix format manipulation for big-endian
> > Otherwise the series looks good AFAICT. It's nice seing llvmpipe to
> > support other ISAs!
> >
> > So you gave commit access, or should I commit for you?
> 
> I don't have commit access, so I'd be grateful if you commit.

Commited. Thanks.


Is it possible to cross build to PowerPC and run a PowerPC executable in some emulator? If it is an easy thing to do, then I'd like to automate cross-building and running llvmpipe unit tests on PowerPC emulator. Otherwise I'm afraid this will quickly regress. Or do you plan to setup this yourself?

Jose


More information about the mesa-dev mailing list