[llvm-commits] [llvm-gcc-4.2] r50602 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Evan Cheng
evan.cheng at apple.com
Fri May 2 17:53:16 PDT 2008
Author: evancheng
Date: Fri May 2 19:53:16 2008
New Revision: 50602
URL: http://llvm.org/viewvc/llvm-project?rev=50602&view=rev
Log:
We have separate intrinsics for IX86_BUILTIN_PSRADI, etc.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=50602&r1=50601&r2=50602&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Fri May 2 19:53:16 2008
@@ -78,155 +78,6 @@
case IX86_BUILTIN_PMULLW128:
Result = Builder.CreateMul(Ops[0], Ops[1], "tmp");
return true;
- case IX86_BUILTIN_PSLLWI: {
- Function *psllw =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_w);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(psllw, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSLLWI128: {
- Function *psllw =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_w);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "tmp");
- Result = Builder.CreateCall(psllw, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSLLDI: {
- Function *pslld =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_d);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(pslld, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSLLDI128: {
- Function *pslld
- = Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_d);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Result = Builder.CreateCall(pslld, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSLLQI: {
- Function *psllq =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psll_q);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(psllq, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSLLQI128: {
- Function *psllq =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psll_q);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "tmp");
- Result = Builder.CreateCall(psllq, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRLWI: {
- Function *psrlw =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psrl_w);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(psrlw, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRLWI128: {
- Function *psrlw =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psrl_w);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "tmp");
- Result = Builder.CreateCall(psrlw, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRLDI: {
- Function *psrld =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psrl_d);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(psrld, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRLDI128: {
- Function *psrld =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psrl_d);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Result = Builder.CreateCall(psrld, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRLQI: {
- Function *psrlq =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psrl_q);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(psrlq, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRLQI128: {
- Function *psrlq =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psrl_q);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "tmp");
- Result = Builder.CreateCall(psrlq, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRAWI: {
- Function *psraw =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psra_w);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(psraw, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRAWI128: {
- Function *psraw =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psra_w);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType(), "tmp");
- Result = Builder.CreateCall(psraw, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRADI: {
- Function *psrad =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_mmx_psra_d);
- Ops[1] = Builder.CreateZExt(Ops[1], Type::Int64Ty, "zext");
- Ops[1] = BuildVector(Ops[1], NULL);
- Result = Builder.CreateCall(psrad, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
- case IX86_BUILTIN_PSRADI128: {
- Function *psrad =
- Intrinsic::getDeclaration(TheModule, Intrinsic::x86_sse2_psra_d);
- Value *Undef = UndefValue::get(Type::Int32Ty);
- Ops[1] = BuildVector(Ops[1], Undef, Undef, Undef, NULL);
- Result = Builder.CreateCall(psrad, Ops.begin(), Ops.begin()+2, "tmp");
- Result = Builder.CreateBitCast(Result, ResultType, "tmp");
- return true;
- }
case IX86_BUILTIN_DIVPS:
case IX86_BUILTIN_DIVPD:
Result = Builder.CreateFDiv(Ops[0], Ops[1], "tmp");
More information about the llvm-commits
mailing list