diff options
author | YunQiang Su <yunqiang@isrc.iscas.ac.cn> | 2025-05-09 16:26:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-09 16:26:08 +0800 |
commit | 08b3617b9f413c9225e9e985bc671fa46ff9e570 (patch) | |
tree | c38b9cc418d7e0c57212ff2c0fe09cb6bc00b148 | |
parent | 68dccb9fa0b09b3485acfc0d436c1d66a4089b8f (diff) | |
download | llvm-08b3617b9f413c9225e9e985bc671fa46ff9e570.zip llvm-08b3617b9f413c9225e9e985bc671fa46ff9e570.tar.gz llvm-08b3617b9f413c9225e9e985bc671fa46ff9e570.tar.bz2 |
LoongArch: Set FMAXNUM and FMINNUM as Legal (#139010)
Now we define FMAXNUM and FMINNUM as IEEE754-2008 with +0.0>-0.0.
LoongArch's fmax/fmin just follow this rules full.
FMAXNUM_IEEE and FMINNUM_IEEE will be removed in future once:
Fixes FMAXNUM/FMINNUM for all targets
The use of FMAXNUM_IEEE/FMINNUM_IEEE are not used by middle end anymore.
5 files changed, 48 insertions, 94 deletions
diff --git a/llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td b/llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td index 65802d6..d5a5f17 100644 --- a/llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td +++ b/llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td @@ -172,7 +172,9 @@ def : PatFprFpr<fmul, FMUL_S, FPR32>; def : PatFprFpr<fdiv, FDIV_S, FPR32>; def : PatFprFpr<fcopysign, FCOPYSIGN_S, FPR32>; def : PatFprFpr<fmaxnum_ieee, FMAX_S, FPR32>; +def : PatFprFpr<fmaxnum, FMAX_S, FPR32>; def : PatFprFpr<fminnum_ieee, FMIN_S, FPR32>; +def : PatFprFpr<fminnum, FMIN_S, FPR32>; def : PatFpr<fneg, FNEG_S, FPR32>; def : PatFpr<fabs, FABS_S, FPR32>; def : PatFpr<fsqrt, FSQRT_S, FPR32>; diff --git a/llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td b/llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td index b980256..c5d1765 100644 --- a/llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td +++ b/llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td @@ -140,7 +140,9 @@ def : PatFprFpr<fmul, FMUL_D, FPR64>; def : PatFprFpr<fdiv, FDIV_D, FPR64>; def : PatFprFpr<fcopysign, FCOPYSIGN_D, FPR64>; def : PatFprFpr<fmaxnum_ieee, FMAX_D, FPR64>; +def : PatFprFpr<fmaxnum, FMAX_D, FPR64>; def : PatFprFpr<fminnum_ieee, FMIN_D, FPR64>; +def : PatFprFpr<fminnum, FMIN_D, FPR64>; def : PatFpr<fneg, FNEG_D, FPR64>; def : PatFpr<fabs, FABS_D, FPR64>; def : PatFpr<fsqrt, FSQRT_D, FPR64>; diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp index 258891a..b729b4e 100644 --- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp +++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp @@ -176,7 +176,9 @@ LoongArchTargetLowering::LoongArchTargetLowering(const TargetMachine &TM, setOperationAction(ISD::BR_CC, MVT::f32, Expand); setOperationAction(ISD::FMA, MVT::f32, Legal); setOperationAction(ISD::FMINNUM_IEEE, MVT::f32, Legal); + setOperationAction(ISD::FMINNUM, MVT::f32, Legal); setOperationAction(ISD::FMAXNUM_IEEE, MVT::f32, Legal); + setOperationAction(ISD::FMAXNUM, MVT::f32, Legal); setOperationAction(ISD::STRICT_FSETCCS, MVT::f32, Legal); setOperationAction(ISD::STRICT_FSETCC, MVT::f32, Legal); setOperationAction(ISD::IS_FPCLASS, MVT::f32, Legal); @@ -215,7 +217,9 @@ LoongArchTargetLowering::LoongArchTargetLowering(const TargetMachine &TM, setOperationAction(ISD::STRICT_FSETCC, MVT::f64, Legal); setOperationAction(ISD::FMA, MVT::f64, Legal); setOperationAction(ISD::FMINNUM_IEEE, MVT::f64, Legal); + setOperationAction(ISD::FMINNUM, MVT::f64, Legal); setOperationAction(ISD::FMAXNUM_IEEE, MVT::f64, Legal); + setOperationAction(ISD::FMAXNUM, MVT::f64, Legal); setOperationAction(ISD::IS_FPCLASS, MVT::f64, Legal); setOperationAction(ISD::FSIN, MVT::f64, Expand); setOperationAction(ISD::FCOS, MVT::f64, Expand); diff --git a/llvm/test/CodeGen/LoongArch/fp-max-min.ll b/llvm/test/CodeGen/LoongArch/fp-max-min.ll index 9bf3e6c..967c366 100644 --- a/llvm/test/CodeGen/LoongArch/fp-max-min.ll +++ b/llvm/test/CodeGen/LoongArch/fp-max-min.ll @@ -12,29 +12,21 @@ declare double @llvm.minnum.f64(double, double) define float @maxnum_float(float %x, float %y) { ; LA32F-LABEL: maxnum_float: ; LA32F: # %bb.0: -; LA32F-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA32F-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA32F-NEXT: fmax.s $fa0, $fa0, $fa1 ; LA32F-NEXT: ret ; ; LA32D-LABEL: maxnum_float: ; LA32D: # %bb.0: -; LA32D-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA32D-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA32D-NEXT: fmax.s $fa0, $fa0, $fa1 ; LA32D-NEXT: ret ; ; LA64F-LABEL: maxnum_float: ; LA64F: # %bb.0: -; LA64F-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA64F-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA64F-NEXT: fmax.s $fa0, $fa0, $fa1 ; LA64F-NEXT: ret ; ; LA64D-LABEL: maxnum_float: ; LA64D: # %bb.0: -; LA64D-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA64D-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA64D-NEXT: fmax.s $fa0, $fa0, $fa1 ; LA64D-NEXT: ret %z = call float @llvm.maxnum.f32(float %x, float %y) @@ -55,8 +47,6 @@ define double @maxnum_double(double %x, double %y) { ; ; LA32D-LABEL: maxnum_double: ; LA32D: # %bb.0: -; LA32D-NEXT: fmax.d $fa1, $fa1, $fa1 -; LA32D-NEXT: fmax.d $fa0, $fa0, $fa0 ; LA32D-NEXT: fmax.d $fa0, $fa0, $fa1 ; LA32D-NEXT: ret ; @@ -74,8 +64,6 @@ define double @maxnum_double(double %x, double %y) { ; ; LA64D-LABEL: maxnum_double: ; LA64D: # %bb.0: -; LA64D-NEXT: fmax.d $fa1, $fa1, $fa1 -; LA64D-NEXT: fmax.d $fa0, $fa0, $fa0 ; LA64D-NEXT: fmax.d $fa0, $fa0, $fa1 ; LA64D-NEXT: ret %z = call double @llvm.maxnum.f64(double %x, double %y) @@ -85,29 +73,21 @@ define double @maxnum_double(double %x, double %y) { define float @minnum_float(float %x, float %y) { ; LA32F-LABEL: minnum_float: ; LA32F: # %bb.0: -; LA32F-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA32F-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA32F-NEXT: fmin.s $fa0, $fa0, $fa1 ; LA32F-NEXT: ret ; ; LA32D-LABEL: minnum_float: ; LA32D: # %bb.0: -; LA32D-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA32D-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA32D-NEXT: fmin.s $fa0, $fa0, $fa1 ; LA32D-NEXT: ret ; ; LA64F-LABEL: minnum_float: ; LA64F: # %bb.0: -; LA64F-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA64F-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA64F-NEXT: fmin.s $fa0, $fa0, $fa1 ; LA64F-NEXT: ret ; ; LA64D-LABEL: minnum_float: ; LA64D: # %bb.0: -; LA64D-NEXT: fmax.s $fa1, $fa1, $fa1 -; LA64D-NEXT: fmax.s $fa0, $fa0, $fa0 ; LA64D-NEXT: fmin.s $fa0, $fa0, $fa1 ; LA64D-NEXT: ret %z = call float @llvm.minnum.f32(float %x, float %y) @@ -128,8 +108,6 @@ define double @minnum_double(double %x, double %y) { ; ; LA32D-LABEL: minnum_double: ; LA32D: # %bb.0: -; LA32D-NEXT: fmax.d $fa1, $fa1, $fa1 -; LA32D-NEXT: fmax.d $fa0, $fa0, $fa0 ; LA32D-NEXT: fmin.d $fa0, $fa0, $fa1 ; LA32D-NEXT: ret ; @@ -147,8 +125,6 @@ define double @minnum_double(double %x, double %y) { ; ; LA64D-LABEL: minnum_double: ; LA64D: # %bb.0: -; LA64D-NEXT: fmax.d $fa1, $fa1, $fa1 -; LA64D-NEXT: fmax.d $fa0, $fa0, $fa0 ; LA64D-NEXT: fmin.d $fa0, $fa0, $fa1 ; LA64D-NEXT: ret %z = call double @llvm.minnum.f64(double %x, double %y) diff --git a/llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw-fp.ll b/llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw-fp.ll index caded4b..f47f79d 100644 --- a/llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw-fp.ll +++ b/llvm/test/CodeGen/LoongArch/ir-instruction/atomicrmw-fp.ll @@ -152,8 +152,7 @@ define float @float_fmin_acquire(ptr %p) nounwind { ; LA64F-NEXT: .LBB2_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB2_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB2_3: # %atomicrmw.start @@ -185,8 +184,7 @@ define float @float_fmin_acquire(ptr %p) nounwind { ; LA64D-NEXT: .LBB2_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB2_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB2_3: # %atomicrmw.start @@ -224,8 +222,7 @@ define float @float_fmax_acquire(ptr %p) nounwind { ; LA64F-NEXT: .LBB3_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB3_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB3_3: # %atomicrmw.start @@ -257,8 +254,7 @@ define float @float_fmax_acquire(ptr %p) nounwind { ; LA64D-NEXT: .LBB3_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB3_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB3_3: # %atomicrmw.start @@ -478,9 +474,8 @@ define double @double_fmin_acquire(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB6_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmin.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmin.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -551,9 +546,8 @@ define double @double_fmax_acquire(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB7_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmax.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmax.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -725,8 +719,7 @@ define float @float_fmin_release(ptr %p) nounwind { ; LA64F-NEXT: .LBB10_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB10_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB10_3: # %atomicrmw.start @@ -758,8 +751,7 @@ define float @float_fmin_release(ptr %p) nounwind { ; LA64D-NEXT: .LBB10_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB10_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB10_3: # %atomicrmw.start @@ -797,8 +789,7 @@ define float @float_fmax_release(ptr %p) nounwind { ; LA64F-NEXT: .LBB11_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB11_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB11_3: # %atomicrmw.start @@ -830,8 +821,7 @@ define float @float_fmax_release(ptr %p) nounwind { ; LA64D-NEXT: .LBB11_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB11_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB11_3: # %atomicrmw.start @@ -1051,9 +1041,8 @@ define double @double_fmin_release(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB14_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmin.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmin.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -1124,9 +1113,8 @@ define double @double_fmax_release(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB15_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmax.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmax.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -1298,8 +1286,7 @@ define float @float_fmin_acq_rel(ptr %p) nounwind { ; LA64F-NEXT: .LBB18_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB18_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB18_3: # %atomicrmw.start @@ -1331,8 +1318,7 @@ define float @float_fmin_acq_rel(ptr %p) nounwind { ; LA64D-NEXT: .LBB18_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB18_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB18_3: # %atomicrmw.start @@ -1370,8 +1356,7 @@ define float @float_fmax_acq_rel(ptr %p) nounwind { ; LA64F-NEXT: .LBB19_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB19_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB19_3: # %atomicrmw.start @@ -1403,8 +1388,7 @@ define float @float_fmax_acq_rel(ptr %p) nounwind { ; LA64D-NEXT: .LBB19_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB19_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB19_3: # %atomicrmw.start @@ -1624,9 +1608,8 @@ define double @double_fmin_acq_rel(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB22_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmin.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmin.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -1697,9 +1680,8 @@ define double @double_fmax_acq_rel(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB23_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmax.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmax.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -1871,8 +1853,7 @@ define float @float_fmin_seq_cst(ptr %p) nounwind { ; LA64F-NEXT: .LBB26_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB26_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB26_3: # %atomicrmw.start @@ -1904,8 +1885,7 @@ define float @float_fmin_seq_cst(ptr %p) nounwind { ; LA64D-NEXT: .LBB26_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB26_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB26_3: # %atomicrmw.start @@ -1943,8 +1923,7 @@ define float @float_fmax_seq_cst(ptr %p) nounwind { ; LA64F-NEXT: .LBB27_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB27_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB27_3: # %atomicrmw.start @@ -1976,8 +1955,7 @@ define float @float_fmax_seq_cst(ptr %p) nounwind { ; LA64D-NEXT: .LBB27_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB27_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB27_3: # %atomicrmw.start @@ -2197,9 +2175,8 @@ define double @double_fmin_seq_cst(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB30_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmin.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmin.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -2270,9 +2247,8 @@ define double @double_fmax_seq_cst(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB31_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmax.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmax.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -2444,8 +2420,7 @@ define float @float_fmin_monotonic(ptr %p) nounwind { ; LA64F-NEXT: .LBB34_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB34_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB34_3: # %atomicrmw.start @@ -2477,8 +2452,7 @@ define float @float_fmin_monotonic(ptr %p) nounwind { ; LA64D-NEXT: .LBB34_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB34_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmin.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmin.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB34_3: # %atomicrmw.start @@ -2516,8 +2490,7 @@ define float @float_fmax_monotonic(ptr %p) nounwind { ; LA64F-NEXT: .LBB35_1: # %atomicrmw.start ; LA64F-NEXT: # =>This Loop Header: Depth=1 ; LA64F-NEXT: # Child Loop BB35_3 Depth 2 -; LA64F-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64F-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64F-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64F-NEXT: movfr2gr.s $a1, $fa2 ; LA64F-NEXT: movfr2gr.s $a2, $fa0 ; LA64F-NEXT: .LBB35_3: # %atomicrmw.start @@ -2549,8 +2522,7 @@ define float @float_fmax_monotonic(ptr %p) nounwind { ; LA64D-NEXT: .LBB35_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Loop Header: Depth=1 ; LA64D-NEXT: # Child Loop BB35_3 Depth 2 -; LA64D-NEXT: fmax.s $fa2, $fa0, $fa0 -; LA64D-NEXT: fmax.s $fa2, $fa2, $fa1 +; LA64D-NEXT: fmax.s $fa2, $fa0, $fa1 ; LA64D-NEXT: movfr2gr.s $a1, $fa2 ; LA64D-NEXT: movfr2gr.s $a2, $fa0 ; LA64D-NEXT: .LBB35_3: # %atomicrmw.start @@ -2770,9 +2742,8 @@ define double @double_fmin_monotonic(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB38_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmin.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmin.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 @@ -2843,9 +2814,8 @@ define double @double_fmax_monotonic(ptr %p) nounwind { ; LA64D-NEXT: .p2align 4, , 16 ; LA64D-NEXT: .LBB39_1: # %atomicrmw.start ; LA64D-NEXT: # =>This Inner Loop Header: Depth=1 -; LA64D-NEXT: fmax.d $fa1, $fa0, $fa0 -; LA64D-NEXT: vldi $vr2, -912 -; LA64D-NEXT: fmax.d $fa1, $fa1, $fa2 +; LA64D-NEXT: vldi $vr1, -912 +; LA64D-NEXT: fmax.d $fa1, $fa0, $fa1 ; LA64D-NEXT: fst.d $fa0, $sp, 8 ; LA64D-NEXT: fst.d $fa1, $sp, 0 ; LA64D-NEXT: ori $a0, $zero, 8 |