From 553b4b912b6b5c0c9d9f4bdc41a5f1922d58013b Mon Sep 17 00:00:00 2001 From: Mon P Wang Date: Tue, 30 Sep 2008 05:31:27 +0000 Subject: [PATCH] Added support for sse intrinsics loadlpd, loadhpd, muldq128, and mulld128 llvm-svn: 56830 --- clang/include/clang/AST/X86Builtins.def | 2 ++ clang/lib/CodeGen/CGBuiltin.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/clang/include/clang/AST/X86Builtins.def b/clang/include/clang/AST/X86Builtins.def index ffe6e1eca26a..f5d434780858 100644 --- a/clang/include/clang/AST/X86Builtins.def +++ b/clang/include/clang/AST/X86Builtins.def @@ -437,6 +437,8 @@ BUILTIN(__builtin_ia32_pmovzxbw128, "V8sV16c", "") 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", "") diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 177e68e70496..1ced9869c1aa 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -892,6 +892,13 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, 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;