[llvm-commits] [llvm-gcc-4.2] r42004 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Chris Lattner
sabre at nondot.org
Sun Sep 16 11:18:13 PDT 2007
Author: lattner
Date: Sun Sep 16 13:18:12 2007
New Revision: 42004
URL: http://llvm.org/viewvc/llvm-project?rev=42004&view=rev
Log:
Fix PR1673: G++ does promotions on the builtin arguments, so they are
not the types we expect to to match the vector elements.
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=42004&r1=42003&r2=42004&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 Sun Sep 16 13:18:12 2007
@@ -433,9 +433,15 @@
Result = BuildVector(Ops[0], Ops[1], NULL);
return true;
case IX86_BUILTIN_VEC_INIT_V4HI:
+ // Sometimes G++ promotes arguments to int.
+ for (unsigned i = 0; i != 4; ++i)
+ Ops[i] = Builder.CreateIntCast(Ops[i], Type::Int16Ty, false, "tmp");
Result = BuildVector(Ops[0], Ops[1], Ops[2], Ops[3], NULL);
return true;
case IX86_BUILTIN_VEC_INIT_V8QI:
+ // Sometimes G++ promotes arguments to int.
+ for (unsigned i = 0; i != 8; ++i)
+ Ops[i] = Builder.CreateIntCast(Ops[i], Type::Int16Ty, false, "tmp");
Result = BuildVector(Ops[0], Ops[1], Ops[2], Ops[3],
Ops[4], Ops[5], Ops[6], Ops[7], NULL);
return true;
More information about the llvm-commits
mailing list