diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-12-10 05:51:07 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-12-10 05:51:07 +0000 |
commit | c1fa01b69d9377a69087a6006a65a8fcc526d565 (patch) | |
tree | 9cefbedd9c85c004a250343cac2af07b6f86f516 /lib/CodeGen | |
parent | afb3fa9e972f85f6412ef7aaea12c3e74ca487e6 (diff) |
LLVM's intrinsics for vpaddl and vpadal have 2 overloaded types.
Clang was only specifying the overloaded result type. PR8483.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGBuiltin.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index 30a56ded17..b04aea11a7 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -1444,16 +1444,30 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID, return EmitNeonCall(CGM.getIntrinsic(Intrinsic::arm_neon_vmullp, &Ty, 1), Ops, "vmull"); case ARM::BI__builtin_neon_vpadal_v: - case ARM::BI__builtin_neon_vpadalq_v: + case ARM::BI__builtin_neon_vpadalq_v: { Int = usgn ? Intrinsic::arm_neon_vpadalu : Intrinsic::arm_neon_vpadals; - return EmitNeonCall(CGM.getIntrinsic(Int, &Ty, 1), Ops, "vpadal"); + // The source operand type has twice as many elements of half the size. + unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits(); + const llvm::Type *EltTy = llvm::IntegerType::get(VMContext, EltBits / 2); + const llvm::Type *NarrowTy = + llvm::VectorType::get(EltTy, VTy->getNumElements() * 2); + const llvm::Type *Tys[2] = { Ty, NarrowTy }; + return EmitNeonCall(CGM.getIntrinsic(Int, Tys, 2), Ops, "vpadal"); + } case ARM::BI__builtin_neon_vpadd_v: return EmitNeonCall(CGM.getIntrinsic(Intrinsic::arm_neon_vpadd, &Ty, 1), Ops, "vpadd"); case ARM::BI__builtin_neon_vpaddl_v: - case ARM::BI__builtin_neon_vpaddlq_v: + case ARM::BI__builtin_neon_vpaddlq_v: { Int = usgn ? Intrinsic::arm_neon_vpaddlu : Intrinsic::arm_neon_vpaddls; - return EmitNeonCall(CGM.getIntrinsic(Int, &Ty, 1), Ops, "vpaddl"); + // The source operand type has twice as many elements of half the size. + unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits(); + const llvm::Type *EltTy = llvm::IntegerType::get(VMContext, EltBits / 2); + const llvm::Type *NarrowTy = + llvm::VectorType::get(EltTy, VTy->getNumElements() * 2); + const llvm::Type *Tys[2] = { Ty, NarrowTy }; + return EmitNeonCall(CGM.getIntrinsic(Int, Tys, 2), Ops, "vpaddl"); + } case ARM::BI__builtin_neon_vpmax_v: Int = usgn ? Intrinsic::arm_neon_vpmaxu : Intrinsic::arm_neon_vpmaxs; return EmitNeonCall(CGM.getIntrinsic(Int, &Ty, 1), Ops, "vpmax"); |