[llvm-commits] [dragonegg] r92474 - /dragonegg/trunk/x86/llvm-target.cpp
Duncan Sands
baldrick at free.fr
Mon Jan 4 02:58:31 PST 2010
Author: baldrick
Date: Mon Jan 4 04:58:31 2010
New Revision: 92474
URL: http://llvm.org/viewvc/llvm-project?rev=92474&view=rev
Log:
Port commits 90200, 90206 and 90649 (echristo) from llvm-gcc.
Modified:
dragonegg/trunk/x86/llvm-target.cpp
Modified: dragonegg/trunk/x86/llvm-target.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/x86/llvm-target.cpp?rev=92474&r1=92473&r2=92474&view=diff
==============================================================================
--- dragonegg/trunk/x86/llvm-target.cpp (original)
+++ dragonegg/trunk/x86/llvm-target.cpp Mon Jan 4 04:58:31 2010
@@ -349,8 +349,8 @@
//{"__builtin_ia32_paddusw128", &&IX86_BUILTIN_PADDUSW128},
{"__builtin_ia32_paddw", &&IX86_BUILTIN_PADDW},
{"__builtin_ia32_paddw128", &&IX86_BUILTIN_PADDW128},
- //{"__builtin_ia32_palignr", &&IX86_BUILTIN_PALIGNR},
- //{"__builtin_ia32_palignr128", &&IX86_BUILTIN_PALIGNR128},
+ {"__builtin_ia32_palignr", &&IX86_BUILTIN_PALIGNR},
+ {"__builtin_ia32_palignr128", &&IX86_BUILTIN_PALIGNR128},
{"__builtin_ia32_pand", &&IX86_BUILTIN_PAND},
{"__builtin_ia32_pand128", &&IX86_BUILTIN_PAND128},
{"__builtin_ia32_pandn", &&IX86_BUILTIN_PANDN},
@@ -1248,6 +1248,23 @@
Result = Builder.CreateLoad(Ptr);
return true;
}
+ IX86_BUILTIN_PALIGNR:
+ IX86_BUILTIN_PALIGNR128: {
+ if (ConstantInt *Elt = dyn_cast<ConstantInt>(Ops[2])) {
+ Function *palignr =
+ Intrinsic::getDeclaration(TheModule, FnCode == IX86_BUILTIN_PALIGNR ?
+ Intrinsic::x86_ssse3_palign_r :
+ Intrinsic::x86_ssse3_palign_r_128);
+ Value *Op2 = Builder.CreateTrunc(Ops[2], Type::getInt8Ty(Context));
+ Value *CallOps[3] = { Ops[0], Ops[1], Op2 };
+ Result = Builder.CreateCall(palignr, CallOps, CallOps+3);
+ return true;
+ } else {
+ error_at(gimple_location(stmt), "mask must be an immediate");
+ Result = Ops[0];
+ return true;
+ }
+ }
}
/* These are defined in i386.c */
More information about the llvm-commits
mailing list