summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorHao Liu <Hao.Liu@arm.com>2014-04-28 07:36:12 +0000
committerHao Liu <Hao.Liu@arm.com>2014-04-28 07:36:12 +0000
commita19a2e2da61fb60009f822625fecfde80758062a (patch)
tree58896803238991be1b6d8d760562c59a597041bd /clang/lib/CodeGen
parent437c3f518857a83776a8d149e581672db0c532c5 (diff)
downloadbcm5719-llvm-a19a2e2da61fb60009f822625fecfde80758062a.tar.gz
bcm5719-llvm-a19a2e2da61fb60009f822625fecfde80758062a.zip
[ARM64]Fix a bug cannot select UQSHL/SQSHL with constant i64 shift amount.
llvm-svn: 207401
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 645c4698cb6..d8e363387b0 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -5527,10 +5527,8 @@ Value *CodeGenFunction::EmitARM64BuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vqshlud_n_s64: {
Ops.push_back(EmitScalarExpr(E->getArg(1)));
Ops[1] = Builder.CreateZExt(Ops[1], Int64Ty);
- llvm::Type *VTy = llvm::VectorType::get(Int64Ty, 1);
- Ops[0] = EmitNeonCall(CGM.getIntrinsic(Intrinsic::arm64_neon_sqshlu, VTy),
- Ops, "vqshlu_n");
- return Builder.CreateBitCast(Ops[0], Int64Ty);
+ return EmitNeonCall(CGM.getIntrinsic(Intrinsic::arm64_neon_sqshlu, Int64Ty),
+ Ops, "vqshlu_n");
}
case NEON::BI__builtin_neon_vqshld_n_u64:
case NEON::BI__builtin_neon_vqshld_n_s64: {
@@ -5539,9 +5537,7 @@ Value *CodeGenFunction::EmitARM64BuiltinExpr(unsigned BuiltinID,
: Intrinsic::arm64_neon_sqshl;
Ops.push_back(EmitScalarExpr(E->getArg(1)));
Ops[1] = Builder.CreateZExt(Ops[1], Int64Ty);
- llvm::Type *VTy = llvm::VectorType::get(Int64Ty, 1);
- Ops[0] = EmitNeonCall(CGM.getIntrinsic(Int, VTy), Ops, "vqshl_n");
- return Builder.CreateBitCast(Ops[0], Int64Ty);
+ return EmitNeonCall(CGM.getIntrinsic(Int, Int64Ty), Ops, "vqshl_n");
}
case NEON::BI__builtin_neon_vrshrd_n_u64:
case NEON::BI__builtin_neon_vrshrd_n_s64: {
@@ -5549,9 +5545,9 @@ Value *CodeGenFunction::EmitARM64BuiltinExpr(unsigned BuiltinID,
? Intrinsic::arm64_neon_urshl
: Intrinsic::arm64_neon_srshl;
Ops.push_back(EmitScalarExpr(E->getArg(1)));
- llvm::Type *VTy = llvm::VectorType::get(Int64Ty, 1);
- Ops[0] = EmitNeonCall(CGM.getIntrinsic(Int, VTy), Ops, "vrshr_n", 1, true);
- return Builder.CreateBitCast(Ops[0], Int64Ty);
+ int SV = cast<ConstantInt>(Ops[1])->getSExtValue();
+ Ops[1] = ConstantInt::get(Int64Ty, -SV);
+ return EmitNeonCall(CGM.getIntrinsic(Int, Int64Ty), Ops, "vrshr_n");
}
case NEON::BI__builtin_neon_vrsrad_n_u64:
case NEON::BI__builtin_neon_vrsrad_n_s64: {
OpenPOWER on IntegriCloud