[llvm-commits] [llvm-gcc-4.2] r48628 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Evan Cheng
evan.cheng at apple.com
Thu Mar 20 17:41:48 PDT 2008
Author: evancheng
Date: Thu Mar 20 19:41:48 2008
New Revision: 48628
URL: http://llvm.org/viewvc/llvm-project?rev=48628&view=rev
Log:
Correctly represent mmx shift instructions with immediate operand. The immediate operand should be a <1 x i64> build_vector rather than a bitcast.
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=48628&r1=48627&r2=48628&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 Thu Mar 20 19:41:48 2008
@@ -78,6 +78,15 @@
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);
@@ -88,6 +97,15 @@
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);
@@ -97,6 +115,15 @@
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);
@@ -107,6 +134,15 @@
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);
@@ -117,6 +153,15 @@
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);
@@ -126,6 +171,15 @@
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);
@@ -136,6 +190,15 @@
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);
@@ -146,6 +209,15 @@
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);
More information about the llvm-commits
mailing list