Skip to content

[CIR][CIRGen][Builtin][Neon] Lower vmaxvq_f64 #1535

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

Merged
merged 1 commit into from
Mar 31, 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 @@ -2793,7 +2793,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
case NEON::BI__builtin_neon_vmaxvq_f32:
llvm_unreachable(" neon_vmaxvq_f32 NYI ");
case NEON::BI__builtin_neon_vmaxvq_f64:
llvm_unreachable(" neon_vmaxvq_f64 NYI ");
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.fmaxv", resultTy,
loc);
case NEON::BI__builtin_neon_vmaxvq_s32:
llvm_unreachable(" neon_vmaxvq_s32 NYI ");
case NEON::BI__builtin_neon_vmaxvq_u32:
Expand Down
17 changes: 11 additions & 6 deletions clang/test/CIR/CodeGen/AArch64/neon.c
Original file line number Diff line number Diff line change
Expand Up @@ -18769,12 +18769,17 @@ float32_t test_vmaxv_f32(float32x2_t a) {
// LLVM: ret float [[VMAXV_F32_I]]
}

// NYI-LABEL: @test_vmaxvq_f64(
// NYI: [[VMAXVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double> %a)
// NYI: ret double [[VMAXVQ_F64_I]]
// float64_t test_vmaxvq_f64(float64x2_t a) {
// return vmaxvq_f64(a);
// }
float64_t test_vmaxvq_f64(float64x2_t a) {
return vmaxvq_f64(a);

// CIR-LABEL: vmaxvq_f64
// CIR: cir.llvm.intrinsic "aarch64.neon.fmaxv" {{%.*}} : (!cir.vector<!cir.double x 2>) -> !cir.double

// LLVM-LABEL: test_vmaxvq_f64
// LLVM-SAME: (<2 x double> [[a:%.*]])
// LLVM: [[VMAXVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double> [[a]])
// LLVM: ret double [[VMAXVQ_F64_I]]
}

// NYI-LABEL: @test_vminv_f32(
// NYI: [[VMINV_F32_I:%.*]] = call float @llvm.aarch64.neon.fminv.f32.v2f32(<2 x float> %a)
Expand Down
Loading