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_u32 #1208

Merged
merged 1 commit into from
Dec 6, 2024
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
7 changes: 5 additions & 2 deletions clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2635,8 +2635,11 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
llvm_unreachable(" neon_vaddlv_u32 NYI ");
case NEON::BI__builtin_neon_vaddlvq_s32:
llvm_unreachable(" neon_vaddlvq_s32 NYI ");
case NEON::BI__builtin_neon_vaddlvq_u32:
llvm_unreachable(" neon_vaddlvq_u32 NYI ");
case NEON::BI__builtin_neon_vaddlvq_u32: {
mlir::Type argTy = cgf.convertType(expr->getArg(0)->getType());
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.uaddlv", resultTy,
loc);
}
case NEON::BI__builtin_neon_vaddv_f32:
llvm_unreachable(" neon_vaddv_f32 NYI ");
case NEON::BI__builtin_neon_vaddv_s32:
Expand Down
11 changes: 11 additions & 0 deletions clang/test/CIR/CodeGen/AArch64/neon-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,3 +1716,14 @@ uint64x2_t test_vpadalq_u32(uint64x2_t a, uint32x4_t b) {
// LLVM: [[TMP2:%.*]] = add <2 x i64> [[VPADAL1_I]], [[a]]
// LLVM: ret <2 x i64> [[TMP2]]
}

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

// CIR-LABEL: vaddlvq_u32
// CIR: = cir.llvm.intrinsic "aarch64.neon.uaddlv" {{%.*}} : (!cir.vector<!u32i x 4>) -> !u64i

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