Skip to content

Commit 9cbfbdc

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower neon vaddlvq_s32 (llvm#1450)
Lower neon vaddlvq_s32
1 parent ea87e00 commit 9cbfbdc

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
26772677
case NEON::BI__builtin_neon_vaddlv_u32:
26782678
llvm_unreachable(" neon_vaddlv_u32 NYI ");
26792679
case NEON::BI__builtin_neon_vaddlvq_s32:
2680-
llvm_unreachable(" neon_vaddlvq_s32 NYI ");
2680+
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.saddlv", resultTy,
2681+
loc);
26812682
case NEON::BI__builtin_neon_vaddlvq_u32:
26822683
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.uaddlv", resultTy,
26832684
loc);

clang/test/CIR/CodeGen/AArch64/neon-misc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,6 +2196,18 @@ uint64x2_t test_vpadalq_u32(uint64x2_t a, uint32x4_t b) {
21962196
// LLVM: ret <2 x i64> [[TMP2]]
21972197
}
21982198

2199+
2200+
int64_t test_vaddlvq_s32(int32x4_t a) {
2201+
return vaddlvq_s32(a);
2202+
2203+
// CIR-LABEL: vaddlvq_s32
2204+
// CIR: = cir.llvm.intrinsic "aarch64.neon.saddlv" {{%.*}} : (!cir.vector<!s32i x 4>) -> !s64i
2205+
2206+
// LLVM: {{.*}}@test_vaddlvq_s32(<4 x i32>{{.*}}[[A:%.*]])
2207+
// LLVM-NEXT: [[VADDLVQ_S32_I:%.*]] = call i64 @llvm.aarch64.neon.saddlv.i64.v4i32(<4 x i32> [[A]])
2208+
// LLVM-NEXT: ret i64 [[VADDLVQ_S32_I]]
2209+
}
2210+
21992211
uint64_t test_vaddlvq_u32(uint32x4_t a) {
22002212
return vaddlvq_u32(a);
22012213

0 commit comments

Comments
 (0)