[llvm-commits] [llvm] r150060 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86InstrSSE.td

Duncan Sands baldrick at free.fr
Wed Feb 8 08:21:28 PST 2012


Hi Dave,

>> LLVM doesn't match gcc on a lot of builtins. Chris also stated to me
>> in e-mail that matching gcc on vector builtins isn't a goal. Most of
>> the x86 shuffle instructions don't have llvm intrinsics and instead
>> use the generic _builtin_shufflevector in the *mmintrin.h header files
>> in clang.  My goal here was only to make a few more shuffles match the
>> behavior of  the other shuffles in this respect.
>
> Not everthing is Clang.  Lots of people use GCC builtins and expect that
> code to be honored.  We can't do that without intrinsics.

I think you are swimming against the tide here.  Remember when C programmers
used to complain because the compiler didn't just directly translate their C
into the obvious assembly code any more?  People have mostly gotten over that
now since most of the time all those compiler transformations resulted in better
code.  C isn't portable assembler any more...  Remember the days when C
programmers could rely on builtins being directly translated into the obvious
assembly code?  People have mostly gotten over that now since ...  oops - we
aren't there yet, wait a few years!  Here's another one that might be coming:
remember when C programmers could rely on their inline assembly being squirted
directly out into the assembler, without the compiler understanding and
"improving" it?  Well, who knows where we will end up, but I suspect the general
trend is that compilers will more and more fiddle with anything they can get
their hands on, even things that used to be sacrosanct and mostly just ignored.

> If anything, I would like to see *more* x86 intrinsics.  In fact we have
> a bunch here that I was planning to send up.

If they can't be expressed simply as generic IR, then an intrinsic is
appropriate so sure go ahead!

Ciao, Duncan.



More information about the llvm-commits mailing list