]> granicus.if.org Git - clang/commitdiff
Generate code for __builtin_ia32_pshufw
authorAnders Carlsson <andersca@mac.com>
Mon, 22 Dec 2008 04:54:32 +0000 (04:54 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 22 Dec 2008 04:54:32 +0000 (04:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61324 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuiltin.cpp

index a4b5973ec11edf1d89917e37c0d7f6f775ee984b..6877b317aa5fce48f4644473bf43933af89edd47 100644 (file)
@@ -595,6 +595,13 @@ 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_pshufw: {
+    unsigned i = cast<ConstantInt>(Ops[1])->getZExtValue();
+    return EmitShuffleVector(Ops[0], Ops[0],
+                             i & 0x3, (i & 0xc) >> 2,
+                             (i & 0x30) >> 4, (i & 0xc0) >> 6,
+                             "pshufw");
+  }
   case X86::BI__builtin_ia32_pshuflw: {
     unsigned i = cast<ConstantInt>(Ops[1])->getZExtValue();
     return EmitShuffleVector(Ops[0], Ops[0],