[llvm-commits] [llvm-gcc-4.2] r112415 - /llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Bob Wilson
bob.wilson at apple.com
Sat Aug 28 22:55:07 PDT 2010
Author: bwilson
Date: Sun Aug 29 00:55:07 2010
New Revision: 112415
URL: http://llvm.org/viewvc/llvm-project?rev=112415&view=rev
Log:
Translate NEON vaddl, vaddw, vsubl, and vsubw builtins to llvm add/sub
with zext/sext operations, instead of to llvm intrinsics.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=112415&r1=112414&r2=112415&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Sun Aug 29 00:55:07 2010
@@ -788,27 +788,27 @@
break;
case NEON_BUILTIN_vaddl:
- if (datatype == neon_datatype_signed)
- intID = Intrinsic::arm_neon_vaddls;
- else if (datatype == neon_datatype_unsigned)
- intID = Intrinsic::arm_neon_vaddlu;
- else
+ if (datatype == neon_datatype_signed) {
+ Ops[0] = Builder.CreateSExt(Ops[0], ResultType);
+ Ops[1] = Builder.CreateSExt(Ops[1], ResultType);
+ } else if (datatype == neon_datatype_unsigned) {
+ Ops[0] = Builder.CreateZExt(Ops[0], ResultType);
+ Ops[1] = Builder.CreateZExt(Ops[1], ResultType);
+ } else
return BadImmediateError(exp, Result);
- intFn = Intrinsic::getDeclaration(TheModule, intID, &ResultType, 1);
- Result = Builder.CreateCall2(intFn, Ops[0], Ops[1]);
+ Result = Builder.CreateAdd(Ops[0], Ops[1]);
break;
case NEON_BUILTIN_vaddw:
if (datatype == neon_datatype_signed)
- intID = Intrinsic::arm_neon_vaddws;
+ Ops[1] = Builder.CreateSExt(Ops[1], ResultType);
else if (datatype == neon_datatype_unsigned)
- intID = Intrinsic::arm_neon_vaddwu;
+ Ops[1] = Builder.CreateZExt(Ops[1], ResultType);
else
return BadImmediateError(exp, Result);
- intFn = Intrinsic::getDeclaration(TheModule, intID, &ResultType, 1);
- Result = Builder.CreateCall2(intFn, Ops[0], Ops[1]);
+ Result = Builder.CreateAdd(Ops[0], Ops[1]);
break;
case NEON_BUILTIN_vhadd:
@@ -1251,27 +1251,27 @@
break;
case NEON_BUILTIN_vsubl:
- if (datatype == neon_datatype_signed)
- intID = Intrinsic::arm_neon_vsubls;
- else if (datatype == neon_datatype_unsigned)
- intID = Intrinsic::arm_neon_vsublu;
- else
+ if (datatype == neon_datatype_signed) {
+ Ops[0] = Builder.CreateSExt(Ops[0], ResultType);
+ Ops[1] = Builder.CreateSExt(Ops[1], ResultType);
+ } else if (datatype == neon_datatype_unsigned) {
+ Ops[0] = Builder.CreateZExt(Ops[0], ResultType);
+ Ops[1] = Builder.CreateZExt(Ops[1], ResultType);
+ } else
return BadImmediateError(exp, Result);
- intFn = Intrinsic::getDeclaration(TheModule, intID, &ResultType, 1);
- Result = Builder.CreateCall2(intFn, Ops[0], Ops[1]);
+ Result = Builder.CreateSub(Ops[0], Ops[1]);
break;
case NEON_BUILTIN_vsubw:
if (datatype == neon_datatype_signed)
- intID = Intrinsic::arm_neon_vsubws;
+ Ops[1] = Builder.CreateSExt(Ops[1], ResultType);
else if (datatype == neon_datatype_unsigned)
- intID = Intrinsic::arm_neon_vsubwu;
+ Ops[1] = Builder.CreateZExt(Ops[1], ResultType);
else
return BadImmediateError(exp, Result);
- intFn = Intrinsic::getDeclaration(TheModule, intID, &ResultType, 1);
- Result = Builder.CreateCall2(intFn, Ops[0], Ops[1]);
+ Result = Builder.CreateSub(Ops[0], Ops[1]);
break;
case NEON_BUILTIN_vqsub:
More information about the llvm-commits
mailing list