diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-05-15 07:38:03 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-05-15 07:38:03 +0000 |
commit | 7ea2e3f6aae9b7511686d3d26dee690fee81c3aa (patch) | |
tree | d941d3952257ee9dc500f5f611ced453ed974807 /lib/CodeGen/CGBuiltin.cpp | |
parent | 6c178c563d51de6e5a12bd3a631728fd82fcad78 (diff) |
Handle a couple missing builtins that will go away eventually when the various
intrin.h files are finished
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBuiltin.cpp')
-rw-r--r-- | lib/CodeGen/CGBuiltin.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index 1574ae1085..9e06f18109 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/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], |