summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-05-15 07:38:03 +0000
committerNate Begeman <natebegeman@mac.com>2008-05-15 07:38:03 +0000
commit6c59132241729320cccb79f00e9b4652f44b17ff (patch)
treee0f734a96ca4d597f5b939a25e47776875a31e5a
parent60f9320fc5a24d95cdb637e8376d9714933d3e68 (diff)
downloadbcm5719-llvm-6c59132241729320cccb79f00e9b4652f44b17ff.tar.gz
bcm5719-llvm-6c59132241729320cccb79f00e9b4652f44b17ff.zip
Handle a couple missing builtins that will go away eventually when the various
intrin.h files are finished llvm-svn: 51137
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 1574ae10851..9e06f181091 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -280,7 +280,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
return RValue::get(Builder.CreateCall(AtomF, &Args[0], &Args[1]+2));
}
case Builtin::BI__sync_lock_test_and_set:
- return EmitBinaryAtomic(*this, Intrinsic::atomic_swap, E); }
+ return EmitBinaryAtomic(*this, Intrinsic::atomic_swap, E);
+ }
return RValue::get(0);
}
@@ -504,6 +505,20 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
llvm::Function *F = CGM.getIntrinsic(ID);
return Builder.CreateCall(F, &Ops[0], &Ops[0] + Ops.size(), name);
}
+ case X86::BI__builtin_ia32_pshuflw: {
+ unsigned i = cast<ConstantInt>(Ops[1])->getZExtValue();
+ return EmitShuffleVector(Ops[0], Ops[0],
+ i & 0x3, (i & 0xc) >> 2,
+ (i & 0x30) >> 4, (i & 0xc0) >> 6, 4, 5, 6, 7,
+ "pshuflw");
+ }
+ case X86::BI__builtin_ia32_pshufhw: {
+ unsigned i = cast<ConstantInt>(Ops[1])->getZExtValue();
+ return EmitShuffleVector(Ops[0], Ops[0], 0, 1, 2, 3,
+ 4 + (i & 0x3), 4 + ((i & 0xc) >> 2),
+ 4 + ((i & 0x30) >> 4), 4 + ((i & 0xc0) >> 6),
+ "pshufhw");
+ }
case X86::BI__builtin_ia32_pshufd: {
unsigned i = cast<ConstantInt>(Ops[1])->getZExtValue();
return EmitShuffleVector(Ops[0], Ops[0],
OpenPOWER on IntegriCloud