Skip to content

Commit e4b8a48

Browse files
authored
[CIR][CIRGen][Builtin][Neon] Lower vmaxnmv_f32 (#1544)
Lower vmaxnmv_f32
1 parent be2f6a0 commit e4b8a48

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,6 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
27772777
case NEON::BI__builtin_neon_vcvtxd_f32_f64:
27782778
llvm_unreachable(" neon_vcvtxd_f32_f64 NYI ");
27792779
case NEON::BI__builtin_neon_vmaxnmv_f32:
2780-
llvm_unreachable(" neon_vmaxnmv_f32 NYI ");
27812780
case NEON::BI__builtin_neon_vmaxnmvq_f32:
27822781
case NEON::BI__builtin_neon_vmaxnmvq_f64:
27832782
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.fmaxnmv", resultTy,

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

+11-6
Original file line numberDiff line numberDiff line change
@@ -18820,12 +18820,17 @@ float64_t test_vmaxnmvq_f64(float64x2_t a) {
1882018820
// LLVM: ret double [[VMAXNMVQ_F64_I]]
1882118821
}
1882218822

18823-
// NYI-LABEL: @test_vmaxnmv_f32(
18824-
// NYI: [[VMAXNMV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float> %a)
18825-
// NYI: ret float [[VMAXNMV_F32_I]]
18826-
// float32_t test_vmaxnmv_f32(float32x2_t a) {
18827-
// return vmaxnmv_f32(a);
18828-
// }
18823+
float32_t test_vmaxnmv_f32(float32x2_t a) {
18824+
return vmaxnmv_f32(a);
18825+
18826+
// CIR-LABEL: vmaxnmv_f32
18827+
// CIR: cir.llvm.intrinsic "aarch64.neon.fmaxnmv" {{%.*}} : (!cir.vector<!cir.float x 2>) -> !cir.float
18828+
18829+
// LLVM-LABEL: @test_vmaxnmv_f32
18830+
// LLVM-SAME: (<2 x float> [[a:%.*]])
18831+
// LLVM: [[VMAXNMV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float> [[a]])
18832+
// LLVM: ret float [[VMAXNMV_F32_I]]
18833+
}
1882918834

1883018835
// NYI-LABEL: @test_vminnmvq_f64(
1883118836
// NYI: [[VMINNMVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fminnmv.f64.v2f64(<2 x double> %a)

0 commit comments

Comments
 (0)