Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR][CIRGen][Builtin][Neon] Lower neon vaddlvq_s32 #1450

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
case NEON::BI__builtin_neon_vaddlv_u32:
llvm_unreachable(" neon_vaddlv_u32 NYI ");
case NEON::BI__builtin_neon_vaddlvq_s32:
llvm_unreachable(" neon_vaddlvq_s32 NYI ");
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.saddlv", resultTy,
loc);
case NEON::BI__builtin_neon_vaddlvq_u32:
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.uaddlv", resultTy,
loc);
Expand Down
12 changes: 12 additions & 0 deletions clang/test/CIR/CodeGen/AArch64/neon-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,18 @@ uint64x2_t test_vpadalq_u32(uint64x2_t a, uint32x4_t b) {
// LLVM: ret <2 x i64> [[TMP2]]
}


int64_t test_vaddlvq_s32(int32x4_t a) {
return vaddlvq_s32(a);

// CIR-LABEL: vaddlvq_s32
// CIR: = cir.llvm.intrinsic "aarch64.neon.saddlv" {{%.*}} : (!cir.vector<!s32i x 4>) -> !s64i

// LLVM: {{.*}}@test_vaddlvq_s32(<4 x i32>{{.*}}[[A:%.*]])
// LLVM-NEXT: [[VADDLVQ_S32_I:%.*]] = call i64 @llvm.aarch64.neon.saddlv.i64.v4i32(<4 x i32> [[A]])
// LLVM-NEXT: ret i64 [[VADDLVQ_S32_I]]
}

uint64_t test_vaddlvq_u32(uint32x4_t a) {
return vaddlvq_u32(a);

Expand Down
Loading