[llvm-commits] [llvm-gcc-4.2] r76715 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Eric Christopher
echristo at apple.com
Tue Jul 21 18:13:49 PDT 2009
Author: echristo
Date: Tue Jul 21 20:13:48 2009
New Revision: 76715
URL: http://llvm.org/viewvc/llvm-project?rev=76715&view=rev
Log:
Handle builtins for IX86_BUILTIN_VEC_SET_V16QI IX86_BUILTIN_VEC_SET_V4SI and
IX86_BUILTIN_VEC_SET_V2DI via lowering instead of intrinsics.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=76715&r1=76714&r2=76715&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Tue Jul 21 20:13:48 2009
@@ -431,12 +431,23 @@
case IX86_BUILTIN_VEC_EXT_V16QI:
Result = Builder.CreateExtractElement(Ops[0], Ops[1], "tmp");
return true;
+ case IX86_BUILTIN_VEC_SET_V16QI:
+ // Sometimes G++ promotes arguments to int.
+ Ops[1] = Builder.CreateIntCast(Ops[1], Type::Int8Ty, false, "tmp");
+ Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
+ return true;
case IX86_BUILTIN_VEC_SET_V4HI:
case IX86_BUILTIN_VEC_SET_V8HI:
// GCC sometimes doesn't produce the right element type.
Ops[1] = Builder.CreateIntCast(Ops[1], Type::Int16Ty, false, "tmp");
Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
return true;
+ case IX86_BUILTIN_VEC_SET_V4SI:
+ Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
+ return true;
+ case IX86_BUILTIN_VEC_SET_V2DI:
+ Result = Builder.CreateInsertElement(Ops[0], Ops[1], Ops[2], "tmp");
+ return true;
case IX86_BUILTIN_CMPEQPS:
case IX86_BUILTIN_CMPLTPS:
case IX86_BUILTIN_CMPLEPS:
More information about the llvm-commits
mailing list