Skip to content

Commit 1ee61dc

Browse files
AmrDeveloperlanza
authored andcommitted
[CIR][CIRGen][Builtin][Neon] Lower neon vmaxv_f32 (llvm#1460)
Lower neon vmaxv_f32
1 parent 6060c94 commit 1ee61dc

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2781,7 +2781,8 @@ static mlir::Value emitCommonNeonSISDBuiltinExpr(
27812781
case NEON::BI__builtin_neon_vmaxnmvq_f64:
27822782
llvm_unreachable(" neon_vmaxnmvq_f64 NYI ");
27832783
case NEON::BI__builtin_neon_vmaxv_f32:
2784-
llvm_unreachable(" neon_vmaxv_f32 NYI ");
2784+
return emitNeonCall(builder, {argTy}, ops, "aarch64.neon.fmaxv", resultTy,
2785+
loc);
27852786
case NEON::BI__builtin_neon_vmaxv_s32:
27862787
llvm_unreachable(" neon_vmaxv_s32 NYI ");
27872788
case NEON::BI__builtin_neon_vmaxv_u32:

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18726,12 +18726,17 @@ float64_t test_vaddvq_f64(float64x2_t a) {
1872618726
// LLVM: ret double [[VADDVQ_F64_I]]
1872718727
}
1872818728

18729-
// NYI-LABEL: @test_vmaxv_f32(
18730-
// NYI: [[VMAXV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float> %a)
18731-
// NYI: ret float [[VMAXV_F32_I]]
18732-
// float32_t test_vmaxv_f32(float32x2_t a) {
18733-
// return vmaxv_f32(a);
18734-
// }
18729+
float32_t test_vmaxv_f32(float32x2_t a) {
18730+
return vmaxv_f32(a);
18731+
18732+
// CIR-LABEL: vmaxv_f32
18733+
// CIR: cir.llvm.intrinsic "aarch64.neon.fmaxv" {{%.*}} : (!cir.vector<!cir.float x 2>) -> !cir.float
18734+
18735+
// LLVM-LABEL: test_vmaxv_f32
18736+
// LLVM-SAME: (<2 x float> [[a:%.*]])
18737+
// LLVM: [[VMAXV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float> [[a]])
18738+
// LLVM: ret float [[VMAXV_F32_I]]
18739+
}
1873518740

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

0 commit comments

Comments
 (0)