[llvm-commits] _mm_srli_si128 and __builtin_ia32_psrldqi128

Bill Wendling isanbard at gmail.com
Wed Oct 1 22:58:16 PDT 2008


On Oct 1, 2008, at 4:33 PM, Stuart Hastings wrote:

> Right after I committed my fix for this Apple bug into Apple's GCC...
>
> 	<rdar://problem/5919583> macro troubles in sse land
>
> ...Apple's GCC got merged into llvm-gcc, and this broke LLVM.
>
> (Here is one reversion arising from the debacle: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080929/067729.html)
>
> The original bug was a complaint that _mm_srli_si128 mis-compiled  
> when passed a constant vector ("{0x123, 0x456}" syntax).  The fix is  
> to simplify the _mm_srli_si128 macro, and  move the "* 8" from the  
> macro into the compiler back-end.  I can't change the existing  
> __builtins because so many people are using them :-(.  Since I'm  
> adding a new __builtin_XX, LLVM needs to know about this.
>
> I think this fix should go into llvm and llvm-gcc before I patch  
> Apple's GCC; this will "inoculate" LLVM when a subsequent GCC merge  
> arrives.
>
> As this is my first posting to llvm-commits, I'm not certain of the  
> protocol.  I wrote a GCC-style ChangeLog in case somebody finds it  
> useful:
>
> 2008-10-01  Stuart Hastings  <stuart at apple.com>
>
> 	Radar 5919583
> 	* llvm/include/llvm/IntrinsicsX86.td (int_x86_sse2_psll_dq_bs,  
> int_x86_sse2_psrl_dq_bs): New.
> 	* llvm/lib/Target/X86/X86InstrSSE.td (int_x86_sse2_psll_dq_bs,  
> int_x86_sse2_psrl_dq_bs): New.
> 	* llvm-gcc/gcc/config/i386/i386.h  
> (IX86_BUILTIN_PSLLDQI128_BYTESHIFT,  
> IX86_BUILTIN_PSRLDQI128_BYTESHIFT): New.
> 	* llvm-gcc/gcc/config/i386/emmintrin.h (_mm_srli_si128,  
> _mm_slli_si128): Use xx_byteshift builtins.
> 	* llvm-gcc/gcc/config/i386.c (__builtin_ia32_pslldq128_byteshift,  
> __builtin_ia32_psrldq128_byteshift): New.
> 	  (ix86_expand_builtin): Support for IX86_BUILTIN_PSLLDQI128 and  
> IX86_BUILTIN_PSRLDQI128.
>
> <llvm-gcc.test.diffs.txt>
>
> <llvm.test.diffs.txt>
>
>
> I have no commit privileges in LLVM.  Would some gracious person  
> please review these patches, and if they're O.K., please apply them?
>
I applied them.

> Thank you in advance,
>
You're welcome. And thank you! :-)

-bw




More information about the llvm-commits mailing list