[cfe-commits] r56830 - in /cfe/trunk: include/clang/AST/X86Builtins.def lib/CodeGen/CGBuiltin.cpp

Mon P Wang wangmp at apple.com
Mon Sep 29 22:31:28 PDT 2008


Author: wangmp
Date: Tue Sep 30 00:31:27 2008
New Revision: 56830

URL: http://llvm.org/viewvc/llvm-project?rev=56830&view=rev
Log:
Added support for sse intrinsics loadlpd, loadhpd, muldq128, and mulld128

Modified:
    cfe/trunk/include/clang/AST/X86Builtins.def
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/include/clang/AST/X86Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/X86Builtins.def?rev=56830&r1=56829&r2=56830&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/X86Builtins.def (original)
+++ cfe/trunk/include/clang/AST/X86Builtins.def Tue Sep 30 00:31:27 2008
@@ -437,6 +437,8 @@
 BUILTIN(__builtin_ia32_pmovzxdq128, "V2LLiV4i", "")
 BUILTIN(__builtin_ia32_pmovzxwd128, "V4iV8s", "")
 BUILTIN(__builtin_ia32_pmovzxwq128, "V2LLiV8s", "")
+BUILTIN(__builtin_ia32_pmuldq128, "V2LLV4iV4i", "")
+BUILTIN(__builtin_ia32_pmulld128, "V4iV4iV4i", "")
 BUILTIN(__builtin_ia32_roundps, "V4fV4fi", "")
 BUILTIN(__builtin_ia32_roundss, "V4fV4fi", "")
 BUILTIN(__builtin_ia32_roundsd, "V2dV2di", "")

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=56830&r1=56829&r2=56830&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Tue Sep 30 00:31:27 2008
@@ -892,6 +892,13 @@
     Ops[0] = Builder.CreateInsertElement(Ops[0], Ops[1], Idx, "loadps");
     return Builder.CreateBitCast(Ops[0], OrigTy, "loadps");
   }
+  case X86::BI__builtin_ia32_loadlpd:
+  case X86::BI__builtin_ia32_loadhpd: {
+    Ops[1] = Builder.CreateLoad(Ops[1], "tmp");
+    unsigned Index = BuiltinID == X86::BI__builtin_ia32_loadlpd ? 0 : 1;
+    llvm::Value *Idx = llvm::ConstantInt::get(llvm::Type::Int32Ty, Index);
+    return Builder.CreateInsertElement(Ops[0], Ops[1], Idx, "loadpd");
+  }
   case X86::BI__builtin_ia32_storehps:
   case X86::BI__builtin_ia32_storelps: {
     const llvm::Type *EltTy = llvm::Type::Int64Ty;





More information about the cfe-commits mailing list