diff --git a/llvm/include/llvm/IR/IntrinsicsAArch64.td b/llvm/include/llvm/IR/IntrinsicsAArch64.td --- a/llvm/include/llvm/IR/IntrinsicsAArch64.td +++ b/llvm/include/llvm/IR/IntrinsicsAArch64.td @@ -786,6 +786,13 @@ llvm_i32_ty], [IntrNoMem]>; + class AdvSIMD_SVE_Compare_Intrinsic + : Intrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>], + [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, + llvm_anyvector_ty, + LLVMMatchType<0>], + [IntrNoMem]>; + class AdvSIMD_SVE_CNT_Intrinsic : Intrinsic<[LLVMVectorOfBitcastsToInt<0>], [LLVMVectorOfBitcastsToInt<0>, @@ -793,8 +800,21 @@ llvm_anyvector_ty], [IntrNoMem]>; + class AdvSIMD_SVE_Reduce_Intrinsic + : Intrinsic<[llvm_anyfloat_ty], + [LLVMScalarOrSameVectorWidth<1, llvm_i1_ty>, + llvm_anyvector_ty], + [IntrNoMem]>; + + class AdvSIMD_SVE_ReduceWithInit_Intrinsic + : Intrinsic<[llvm_anyfloat_ty], + [LLVMScalarOrSameVectorWidth<1, llvm_i1_ty>, + LLVMMatchType<0>, + llvm_anyvector_ty], + [IntrNoMem]>; + class AdvSIMD_SVE_Unpack_Intrinsic - : Intrinsic<[llvm_anyvector_ty], + : Intrinsic<[llvm_anyvector_ty], [LLVMSubdivide2VectorType<0>], [IntrNoMem]>; @@ -1018,9 +1038,29 @@ def int_aarch64_sve_ftssel_x : AdvSIMD_SVE_TSMUL_Intrinsic; // +// Floating-point reductions +// + +def int_aarch64_sve_fadda : AdvSIMD_SVE_ReduceWithInit_Intrinsic; +def int_aarch64_sve_faddv : AdvSIMD_SVE_Reduce_Intrinsic; +def int_aarch64_sve_fmaxv : AdvSIMD_SVE_Reduce_Intrinsic; +def int_aarch64_sve_fmaxnmv : AdvSIMD_SVE_Reduce_Intrinsic; +def int_aarch64_sve_fminv : AdvSIMD_SVE_Reduce_Intrinsic; +def int_aarch64_sve_fminnmv : AdvSIMD_SVE_Reduce_Intrinsic; + +// // Floating-point comparisons // +def int_aarch64_sve_facge : AdvSIMD_SVE_Compare_Intrinsic; +def int_aarch64_sve_facgt : AdvSIMD_SVE_Compare_Intrinsic; + +def int_aarch64_sve_fcmpeq : AdvSIMD_SVE_Compare_Intrinsic; +def int_aarch64_sve_fcmpge : AdvSIMD_SVE_Compare_Intrinsic; +def int_aarch64_sve_fcmpgt : AdvSIMD_SVE_Compare_Intrinsic; +def int_aarch64_sve_fcmpne : AdvSIMD_SVE_Compare_Intrinsic; +def int_aarch64_sve_fcmpuo : AdvSIMD_SVE_Compare_Intrinsic; + def int_aarch64_sve_fcvtzs_i32f16 : Builtin_SVCVT<"svcvt_s32_f16_m", llvm_nxv4i32_ty, llvm_nxv8f16_ty>; // diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td --- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -169,12 +169,12 @@ defm FMUL_ZZZI : sve_fp_fmul_by_indexed_elem<"fmul", int_aarch64_sve_fmul_lane>; // SVE floating point reductions. - defm FADDA_VPZ : sve_fp_2op_p_vd<0b000, "fadda">; - defm FADDV_VPZ : sve_fp_fast_red<0b000, "faddv">; - defm FMAXNMV_VPZ : sve_fp_fast_red<0b100, "fmaxnmv">; - defm FMINNMV_VPZ : sve_fp_fast_red<0b101, "fminnmv">; - defm FMAXV_VPZ : sve_fp_fast_red<0b110, "fmaxv">; - defm FMINV_VPZ : sve_fp_fast_red<0b111, "fminv">; + defm FADDA_VPZ : sve_fp_2op_p_vd<0b000, "fadda", int_aarch64_sve_fadda>; + defm FADDV_VPZ : sve_fp_fast_red<0b000, "faddv", int_aarch64_sve_faddv>; + defm FMAXNMV_VPZ : sve_fp_fast_red<0b100, "fmaxnmv", int_aarch64_sve_fmaxnmv>; + defm FMINNMV_VPZ : sve_fp_fast_red<0b101, "fminnmv", int_aarch64_sve_fminnmv>; + defm FMAXV_VPZ : sve_fp_fast_red<0b110, "fmaxv", int_aarch64_sve_fmaxv>; + defm FMINV_VPZ : sve_fp_fast_red<0b111, "fminv", int_aarch64_sve_fminv>; // Splat immediate (unpredicated) defm DUP_ZI : sve_int_dup_imm<"dup">; @@ -736,13 +736,13 @@ defm CMPLO_PPzZI : sve_int_ucmp_vi<0b10, "cmplo">; defm CMPLS_PPzZI : sve_int_ucmp_vi<0b11, "cmpls">; - defm FCMGE_PPzZZ : sve_fp_3op_p_pd<0b000, "fcmge">; - defm FCMGT_PPzZZ : sve_fp_3op_p_pd<0b001, "fcmgt">; - defm FCMEQ_PPzZZ : sve_fp_3op_p_pd<0b010, "fcmeq">; - defm FCMNE_PPzZZ : sve_fp_3op_p_pd<0b011, "fcmne">; - defm FCMUO_PPzZZ : sve_fp_3op_p_pd<0b100, "fcmuo">; - defm FACGE_PPzZZ : sve_fp_3op_p_pd<0b101, "facge">; - defm FACGT_PPzZZ : sve_fp_3op_p_pd<0b111, "facgt">; + defm FCMGE_PPzZZ : sve_fp_3op_p_pd<0b000, "fcmge", int_aarch64_sve_fcmpge>; + defm FCMGT_PPzZZ : sve_fp_3op_p_pd<0b001, "fcmgt", int_aarch64_sve_fcmpgt>; + defm FCMEQ_PPzZZ : sve_fp_3op_p_pd<0b010, "fcmeq", int_aarch64_sve_fcmpeq>; + defm FCMNE_PPzZZ : sve_fp_3op_p_pd<0b011, "fcmne", int_aarch64_sve_fcmpne>; + defm FCMUO_PPzZZ : sve_fp_3op_p_pd<0b100, "fcmuo", int_aarch64_sve_fcmpuo>; + defm FACGE_PPzZZ : sve_fp_3op_p_pd<0b101, "facge", int_aarch64_sve_facge>; + defm FACGT_PPzZZ : sve_fp_3op_p_pd<0b111, "facgt", int_aarch64_sve_facgt>; defm FCMGE_PPzZ0 : sve_fp_2op_p_pd<0b000, "fcmge">; defm FCMGT_PPzZ0 : sve_fp_2op_p_pd<0b001, "fcmgt">; diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td --- a/llvm/lib/Target/AArch64/SVEInstrFormats.td +++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -3644,10 +3644,14 @@ let Inst{4-0} = Vd; } -multiclass sve_fp_fast_red opc, string asm> { +multiclass sve_fp_fast_red opc, string asm, SDPatternOperator op> { def _H : sve_fp_fast_red<0b01, opc, asm, ZPR16, FPR16>; def _S : sve_fp_fast_red<0b10, opc, asm, ZPR32, FPR32>; def _D : sve_fp_fast_red<0b11, opc, asm, ZPR64, FPR64>; + + def : SVE_2_Op_Pat(NAME # _H)>; + def : SVE_2_Op_Pat(NAME # _S)>; + def : SVE_2_Op_Pat(NAME # _D)>; } @@ -3677,10 +3681,14 @@ let Constraints = "$Vdn = $_Vdn"; } -multiclass sve_fp_2op_p_vd opc, string asm> { +multiclass sve_fp_2op_p_vd opc, string asm, SDPatternOperator op> { def _H : sve_fp_2op_p_vd<0b01, opc, asm, ZPR16, FPR16>; def _S : sve_fp_2op_p_vd<0b10, opc, asm, ZPR32, FPR32>; def _D : sve_fp_2op_p_vd<0b11, opc, asm, ZPR64, FPR64>; + + def : SVE_3_Op_Pat(NAME # _H)>; + def : SVE_3_Op_Pat(NAME # _S)>; + def : SVE_3_Op_Pat(NAME # _D)>; } //===----------------------------------------------------------------------===// @@ -3710,10 +3718,14 @@ let Inst{3-0} = Pd; } -multiclass sve_fp_3op_p_pd opc, string asm> { +multiclass sve_fp_3op_p_pd opc, string asm, SDPatternOperator op> { def _H : sve_fp_3op_p_pd<0b01, opc, asm, PPR16, ZPR16>; def _S : sve_fp_3op_p_pd<0b10, opc, asm, PPR32, ZPR32>; def _D : sve_fp_3op_p_pd<0b11, opc, asm, PPR64, ZPR64>; + + def : SVE_3_Op_Pat(NAME # _H)>; + def : SVE_3_Op_Pat(NAME # _S)>; + def : SVE_3_Op_Pat(NAME # _D)>; } diff --git a/llvm/test/CodeGen/AArch64/sve-intrinsics-fp-compares.ll b/llvm/test/CodeGen/AArch64/sve-intrinsics-fp-compares.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve-intrinsics-fp-compares.ll @@ -0,0 +1,267 @@ +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s + +; +; FACGE +; + +define @facge_h( %pg, %a, %b) { +; CHECK-LABEL: facge_h: +; CHECK: facge p0.h, p0/z, z0.h, z1.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.facge.nxv8f16( %pg, + %a, + %b) + ret %out +} + +define @facge_s( %pg, %a, %b) { +; CHECK-LABEL: facge_s: +; CHECK: facge p0.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.facge.nxv4f32( %pg, + %a, + %b) + ret %out +} + +define @facge_d( %pg, %a, %b) { +; CHECK-LABEL: facge_d: +; CHECK: facge p0.d, p0/z, z0.d, z1.d +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.facge.nxv2f64( %pg, + %a, + %b) + ret %out +} + +; +; FACGT +; + +define @facgt_h( %pg, %a, %b) { +; CHECK-LABEL: facgt_h: +; CHECK: facgt p0.h, p0/z, z0.h, z1.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.facgt.nxv8f16( %pg, + %a, + %b) + ret %out +} + +define @facgt_s( %pg, %a, %b) { +; CHECK-LABEL: facgt_s: +; CHECK: facgt p0.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.facgt.nxv4f32( %pg, + %a, + %b) + ret %out +} + +define @facgt_d( %pg, %a, %b) { +; CHECK-LABEL: facgt_d: +; CHECK: facgt p0.d, p0/z, z0.d, z1.d +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.facgt.nxv2f64( %pg, + %a, + %b) + ret %out +} + +; +; FCMEQ +; + +define @fcmeq_h( %pg, %a, %b) { +; CHECK-LABEL: fcmeq_h: +; CHECK: fcmeq p0.h, p0/z, z0.h, z1.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpeq.nxv8f16( %pg, + %a, + %b) + ret %out +} + +define @fcmeq_s( %pg, %a, %b) { +; CHECK-LABEL: fcmeq_s: +; CHECK: fcmeq p0.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpeq.nxv4f32( %pg, + %a, + %b) + ret %out +} + +define @fcmeq_d( %pg, %a, %b) { +; CHECK-LABEL: fcmeq_d: +; CHECK: fcmeq p0.d, p0/z, z0.d, z1.d +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpeq.nxv2f64( %pg, + %a, + %b) + ret %out +} + +; +; FCMGE +; + +define @fcmge_h( %pg, %a, %b) { +; CHECK-LABEL: fcmge_h: +; CHECK: fcmge p0.h, p0/z, z0.h, z1.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpge.nxv8f16( %pg, + %a, + %b) + ret %out +} + +define @fcmge_s( %pg, %a, %b) { +; CHECK-LABEL: fcmge_s: +; CHECK: fcmge p0.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpge.nxv4f32( %pg, + %a, + %b) + ret %out +} + +define @fcmge_d( %pg, %a, %b) { +; CHECK-LABEL: fcmge_d: +; CHECK: fcmge p0.d, p0/z, z0.d, z1.d +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpge.nxv2f64( %pg, + %a, + %b) + ret %out +} + +; +; FCMGT +; + +define @fcmgt_h( %pg, %a, %b) { +; CHECK-LABEL: fcmgt_h: +; CHECK: fcmgt p0.h, p0/z, z0.h, z1.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpgt.nxv8f16( %pg, + %a, + %b) + ret %out +} + +define @fcmgt_s( %pg, %a, %b) { +; CHECK-LABEL: fcmgt_s: +; CHECK: fcmgt p0.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpgt.nxv4f32( %pg, + %a, + %b) + ret %out +} + +define @fcmgt_d( %pg, %a, %b) { +; CHECK-LABEL: fcmgt_d: +; CHECK: fcmgt p0.d, p0/z, z0.d, z1.d +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpgt.nxv2f64( %pg, + %a, + %b) + ret %out +} + +; +; FCMNE +; + +define @fcmne_h( %pg, %a, %b) { +; CHECK-LABEL: fcmne_h: +; CHECK: fcmne p0.h, p0/z, z0.h, z1.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpne.nxv8f16( %pg, + %a, + %b) + ret %out +} + +define @fcmne_s( %pg, %a, %b) { +; CHECK-LABEL: fcmne_s: +; CHECK: fcmne p0.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpne.nxv4f32( %pg, + %a, + %b) + ret %out +} + +define @fcmne_d( %pg, %a, %b) { +; CHECK-LABEL: fcmne_d: +; CHECK: fcmne p0.d, p0/z, z0.d, z1.d +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpne.nxv2f64( %pg, + %a, + %b) + ret %out +} + +; +; FCMPUO +; + +define @fcmuo_h( %pg, %a, %b) { +; CHECK-LABEL: fcmuo_h: +; CHECK: fcmuo p0.h, p0/z, z0.h, z1.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpuo.nxv8f16( %pg, + %a, + %b) + ret %out +} + +define @fcmuo_s( %pg, %a, %b) { +; CHECK-LABEL: fcmuo_s: +; CHECK: fcmuo p0.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpuo.nxv4f32( %pg, + %a, + %b) + ret %out +} + +define @fcmuo_d( %pg, %a, %b) { +; CHECK-LABEL: fcmuo_d: +; CHECK: fcmuo p0.d, p0/z, z0.d, z1.d +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fcmpuo.nxv2f64( %pg, + %a, + %b) + ret %out +} + +declare @llvm.aarch64.sve.facge.nxv8f16(, , ) +declare @llvm.aarch64.sve.facge.nxv4f32(, , ) +declare @llvm.aarch64.sve.facge.nxv2f64(, , ) + +declare @llvm.aarch64.sve.facgt.nxv8f16(, , ) +declare @llvm.aarch64.sve.facgt.nxv4f32(, , ) +declare @llvm.aarch64.sve.facgt.nxv2f64(, , ) + +declare @llvm.aarch64.sve.fcmpeq.nxv8f16(, , ) +declare @llvm.aarch64.sve.fcmpeq.nxv4f32(, , ) +declare @llvm.aarch64.sve.fcmpeq.nxv2f64(, , ) + +declare @llvm.aarch64.sve.fcmpge.nxv8f16(, , ) +declare @llvm.aarch64.sve.fcmpge.nxv4f32(, , ) +declare @llvm.aarch64.sve.fcmpge.nxv2f64(, , ) + +declare @llvm.aarch64.sve.fcmpgt.nxv8f16(, , ) +declare @llvm.aarch64.sve.fcmpgt.nxv4f32(, , ) +declare @llvm.aarch64.sve.fcmpgt.nxv2f64(, , ) + +declare @llvm.aarch64.sve.fcmpne.nxv8f16(, , ) +declare @llvm.aarch64.sve.fcmpne.nxv4f32(, , ) +declare @llvm.aarch64.sve.fcmpne.nxv2f64(, , ) + +declare @llvm.aarch64.sve.fcmpuo.nxv8f16(, , ) +declare @llvm.aarch64.sve.fcmpuo.nxv4f32(, , ) +declare @llvm.aarch64.sve.fcmpuo.nxv2f64(, , ) diff --git a/llvm/test/CodeGen/AArch64/sve-intrinsics-fp-reduce.ll b/llvm/test/CodeGen/AArch64/sve-intrinsics-fp-reduce.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve-intrinsics-fp-reduce.ll @@ -0,0 +1,214 @@ +; RUN: llc -mtriple=aarch64--linux-gnu -mattr=+sve < %s | FileCheck %s + +; +; FADDA +; + +define half @fadda_f16( %pg, half %init, %a) { +; CHECK-LABEL: fadda_f16: +; CHECK: fadda h0, p0, h0, z1.h +; CHECK-NEXT: ret + %res = call half @llvm.aarch64.sve.fadda.nxv8f16( %pg, + half %init, + %a) + ret half %res +} + +define float @fadda_f32( %pg, float %init, %a) { +; CHECK-LABEL: fadda_f32: +; CHECK: fadda s0, p0, s0, z1.s +; CHECK-NEXT: ret + %res = call float @llvm.aarch64.sve.fadda.nxv4f32( %pg, + float %init, + %a) + ret float %res +} + +define double @fadda_f64( %pg, double %init, %a) { +; CHECK-LABEL: fadda_f64: +; CHECK: fadda d0, p0, d0, z1.d +; CHECK-NEXT: ret + %res = call double @llvm.aarch64.sve.fadda.nxv2f64( %pg, + double %init, + %a) + ret double %res +} + +; +; FADDV +; + +define half @faddv_f16( %pg, %a) { +; CHECK-LABEL: faddv_f16: +; CHECK: faddv h0, p0, z0.h +; CHECK-NEXT: ret + %res = call half @llvm.aarch64.sve.faddv.nxv8f16( %pg, + %a) + ret half %res +} + +define float @faddv_f32( %pg, %a) { +; CHECK-LABEL: faddv_f32: +; CHECK: faddv s0, p0, z0.s +; CHECK-NEXT: ret + %res = call float @llvm.aarch64.sve.faddv.nxv4f32( %pg, + %a) + ret float %res +} + +define double @faddv_f64( %pg, %a) { +; CHECK-LABEL: faddv_f64: +; CHECK: faddv d0, p0, z0.d +; CHECK-NEXT: ret + %res = call double @llvm.aarch64.sve.faddv.nxv2f64( %pg, + %a) + ret double %res +} + +; +; FMAXNMV +; + +define half @fmaxnmv_f16( %pg, %a) { +; CHECK-LABEL: fmaxnmv_f16: +; CHECK: fmaxnmv h0, p0, z0.h +; CHECK-NEXT: ret + %res = call half @llvm.aarch64.sve.fmaxnmv.nxv8f16( %pg, + %a) + ret half %res +} + +define float @fmaxnmv_f32( %pg, %a) { +; CHECK-LABEL: fmaxnmv_f32: +; CHECK: fmaxnmv s0, p0, z0.s +; CHECK-NEXT: ret + %res = call float @llvm.aarch64.sve.fmaxnmv.nxv4f32( %pg, + %a) + ret float %res +} + +define double @fmaxnmv_f64( %pg, %a) { +; CHECK-LABEL: fmaxnmv_f64: +; CHECK: fmaxnmv d0, p0, z0.d +; CHECK-NEXT: ret + %res = call double @llvm.aarch64.sve.fmaxnmv.nxv2f64( %pg, + %a) + ret double %res +} + +; +; FMAXV +; + +define half @fmaxv_f16( %pg, %a) { +; CHECK-LABEL: fmaxv_f16: +; CHECK: fmaxv h0, p0, z0.h +; CHECK-NEXT: ret + %res = call half @llvm.aarch64.sve.fmaxv.nxv8f16( %pg, + %a) + ret half %res +} + +define float @fmaxv_f32( %pg, %a) { +; CHECK-LABEL: fmaxv_f32: +; CHECK: fmaxv s0, p0, z0.s +; CHECK-NEXT: ret + %res = call float @llvm.aarch64.sve.fmaxv.nxv4f32( %pg, + %a) + ret float %res +} + +define double @fmaxv_f64( %pg, %a) { +; CHECK-LABEL: fmaxv_f64: +; CHECK: fmaxv d0, p0, z0.d +; CHECK-NEXT: ret + %res = call double @llvm.aarch64.sve.fmaxv.nxv2f64( %pg, + %a) + ret double %res +} + +; +; FMINNMV +; + +define half @fminnmv_f16( %pg, %a) { +; CHECK-LABEL: fminnmv_f16: +; CHECK: fminnmv h0, p0, z0.h +; CHECK-NEXT: ret + %res = call half @llvm.aarch64.sve.fminnmv.nxv8f16( %pg, + %a) + ret half %res +} + +define float @fminnmv_f32( %pg, %a) { +; CHECK-LABEL: fminnmv_f32: +; CHECK: fminnmv s0, p0, z0.s +; CHECK-NEXT: ret + %res = call float @llvm.aarch64.sve.fminnmv.nxv4f32( %pg, + %a) + ret float %res +} + +define double @fminnmv_f64( %pg, %a) { +; CHECK-LABEL: fminnmv_f64: +; CHECK: fminnmv d0, p0, z0.d +; CHECK-NEXT: ret + %res = call double @llvm.aarch64.sve.fminnmv.nxv2f64( %pg, + %a) + ret double %res +} + +; +; FMINV +; + +define half @fminv_f16( %pg, %a) { +; CHECK-LABEL: fminv_f16: +; CHECK: fminv h0, p0, z0.h +; CHECK-NEXT: ret + %res = call half @llvm.aarch64.sve.fminv.nxv8f16( %pg, + %a) + ret half %res +} + +define float @fminv_f32( %pg, %a) { +; CHECK-LABEL: fminv_f32: +; CHECK: fminv s0, p0, z0.s +; CHECK-NEXT: ret + %res = call float @llvm.aarch64.sve.fminv.nxv4f32( %pg, + %a) + ret float %res +} + +define double @fminv_f64( %pg, %a) { +; CHECK-LABEL: fminv_f64: +; CHECK: fminv d0, p0, z0.d +; CHECK-NEXT: ret + %res = call double @llvm.aarch64.sve.fminv.nxv2f64( %pg, + %a) + ret double %res +} + +declare half @llvm.aarch64.sve.fadda.nxv8f16(, half, ) +declare float @llvm.aarch64.sve.fadda.nxv4f32(, float, ) +declare double @llvm.aarch64.sve.fadda.nxv2f64(, double, ) + +declare half @llvm.aarch64.sve.faddv.nxv8f16(, ) +declare float @llvm.aarch64.sve.faddv.nxv4f32(, ) +declare double @llvm.aarch64.sve.faddv.nxv2f64(, ) + +declare half @llvm.aarch64.sve.fmaxnmv.nxv8f16(, ) +declare float @llvm.aarch64.sve.fmaxnmv.nxv4f32(, ) +declare double @llvm.aarch64.sve.fmaxnmv.nxv2f64(, ) + +declare half @llvm.aarch64.sve.fmaxv.nxv8f16(, ) +declare float @llvm.aarch64.sve.fmaxv.nxv4f32(, ) +declare double @llvm.aarch64.sve.fmaxv.nxv2f64(, ) + +declare half @llvm.aarch64.sve.fminnmv.nxv8f16(, ) +declare float @llvm.aarch64.sve.fminnmv.nxv4f32(, ) +declare double @llvm.aarch64.sve.fminnmv.nxv2f64(, ) + +declare half @llvm.aarch64.sve.fminv.nxv8f16(, ) +declare float @llvm.aarch64.sve.fminv.nxv4f32(, ) +declare double @llvm.aarch64.sve.fminv.nxv2f64(, )