@@ -1486,10 +1486,14 @@ let Predicates = [HasVSX, HasP9Vector] in {
1486
1486
1487
1487
// Truncate & Convert QP -> (Un)Signed (D)Word (dword[1] is set to zero)
1488
1488
let mayRaiseFPException = 1 in {
1489
- def XSCVQPSDZ : X_VT5_XO5_VB5<63, 25, 836, "xscvqpsdz", []>;
1490
- def XSCVQPSWZ : X_VT5_XO5_VB5<63, 9, 836, "xscvqpswz", []>;
1491
- def XSCVQPUDZ : X_VT5_XO5_VB5<63, 17, 836, "xscvqpudz", []>;
1492
- def XSCVQPUWZ : X_VT5_XO5_VB5<63, 1, 836, "xscvqpuwz", []>;
1489
+ def XSCVQPSDZ : X_VT5_XO5_VB5<63, 25, 836, "xscvqpsdz",
1490
+ [(set f128:$RST, (PPCany_fctidz f128:$RB))]>;
1491
+ def XSCVQPSWZ : X_VT5_XO5_VB5<63, 9, 836, "xscvqpswz",
1492
+ [(set f128:$RST, (PPCany_fctiwz f128:$RB))]>;
1493
+ def XSCVQPUDZ : X_VT5_XO5_VB5<63, 17, 836, "xscvqpudz",
1494
+ [(set f128:$RST, (PPCany_fctiduz f128:$RB))]>;
1495
+ def XSCVQPUWZ : X_VT5_XO5_VB5<63, 1, 836, "xscvqpuwz",
1496
+ [(set f128:$RST, (PPCany_fctiwuz f128:$RB))]>;
1493
1497
}
1494
1498
1495
1499
// Convert (Un)Signed DWord -> QP.
@@ -2909,6 +2913,10 @@ def:Pat<(vmrglw_swapped_shuffle v16i8:$vA, v16i8:$vB),
2909
2913
def:Pat<(vmrghw_swapped_shuffle v16i8:$vA, v16i8:$vB),
2910
2914
(COPY_TO_REGCLASS (XXMRGHW (COPY_TO_REGCLASS $vB, VSRC),
2911
2915
(COPY_TO_REGCLASS $vA, VSRC)), VRRC)>;
2916
+ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, XForm:$dst, 8),
2917
+ (STXSDX $src, XForm:$dst)>;
2918
+ def : Pat<(PPCstore_scal_int_from_vsr f128:$src, XForm:$dst, 8),
2919
+ (STXSDX (COPY_TO_REGCLASS $src, VSFRC), XForm:$dst)>;
2912
2920
} // HasVSX
2913
2921
2914
2922
// Any big endian VSX subtarget.
@@ -3151,12 +3159,10 @@ def : Pat<(v2f64 (insertelt v2f64:$A, f64:$B, 1)),
3151
3159
3152
3160
// Any pre-Power9 VSX subtarget.
3153
3161
let Predicates = [HasVSX, NoP9Vector] in {
3154
- def : Pat<(PPCstore_scal_int_from_vsr
3155
- (f64 (PPCcv_fp_to_sint_in_vsr f64:$src)), ForceXForm:$dst, 8),
3156
- (STXSDX (XSCVDPSXDS f64:$src), ForceXForm:$dst)>;
3157
- def : Pat<(PPCstore_scal_int_from_vsr
3158
- (f64 (PPCcv_fp_to_uint_in_vsr f64:$src)), ForceXForm:$dst, 8),
3159
- (STXSDX (XSCVDPUXDS f64:$src), ForceXForm:$dst)>;
3162
+ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, ForceXForm:$dst, 8),
3163
+ (STXSDX $src, ForceXForm:$dst)>;
3164
+ def : Pat<(PPCstore_scal_int_from_vsr f128:$src, ForceXForm:$dst, 8),
3165
+ (STXSDX (COPY_TO_REGCLASS $src, VSFRC), ForceXForm:$dst)>;
3160
3166
3161
3167
// Load-and-splat with fp-to-int conversion (using X-Form VSX/FP loads).
3162
3168
defm : ScalToVecWPermute<
@@ -3303,12 +3309,15 @@ def : Pat<(f32 (fneg f32:$S)),
3303
3309
(COPY_TO_REGCLASS $S, VSFRC)), VSSRC))>;
3304
3310
3305
3311
// Instructions for converting float to i32 feeding a store.
3306
- def : Pat<(PPCstore_scal_int_from_vsr
3307
- (f64 (PPCcv_fp_to_sint_in_vsr f64:$src)), ForceXForm:$dst, 4),
3308
- (STIWX (XSCVDPSXWS f64:$src), ForceXForm:$dst)>;
3309
- def : Pat<(PPCstore_scal_int_from_vsr
3310
- (f64 (PPCcv_fp_to_uint_in_vsr f64:$src)), ForceXForm:$dst, 4),
3311
- (STIWX (XSCVDPUXWS f64:$src), ForceXForm:$dst)>;
3312
+ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, ForceXForm:$dst, 4),
3313
+ (STIWX $src, ForceXForm:$dst)>;
3314
+ def : Pat<(PPCstore_scal_int_from_vsr f128:$src, ForceXForm:$dst, 4),
3315
+ (STIWX (COPY_TO_REGCLASS $src, VSFRC), ForceXForm:$dst)>;
3316
+
3317
+ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, ForceXForm:$dst, 4),
3318
+ (STXSIWX $src, ForceXForm:$dst)>;
3319
+ def : Pat<(PPCstore_scal_int_from_vsr f128:$src, ForceXForm:$dst, 4),
3320
+ (STXSIWX (COPY_TO_REGCLASS $src, VSFRC), ForceXForm:$dst)>;
3312
3321
3313
3322
def : Pat<(v2i64 (smax v2i64:$src1, v2i64:$src2)),
3314
3323
(v2i64 (VMAXSD (COPY_TO_REGCLASS $src1, VRRC),
@@ -4042,67 +4051,19 @@ def : Pat<(i32 (any_fp_to_uint f128:$src)),
4042
4051
(i32 (MFVSRWZ (COPY_TO_REGCLASS (XSCVQPUWZ $src), VFRC)))>;
4043
4052
4044
4053
// Instructions for store(fptosi).
4045
- // The 8-byte version is repeated here due to availability of D-Form STXSD.
4046
- def : Pat<(PPCstore_scal_int_from_vsr
4047
- (f64 (PPCcv_fp_to_sint_in_vsr f128:$src)), XForm:$dst, 8),
4048
- (STXSDX (COPY_TO_REGCLASS (XSCVQPSDZ f128:$src), VFRC),
4049
- XForm:$dst)>;
4050
- def : Pat<(PPCstore_scal_int_from_vsr
4051
- (f64 (PPCcv_fp_to_sint_in_vsr f128:$src)), DSForm:$dst, 8),
4052
- (STXSD (COPY_TO_REGCLASS (XSCVQPSDZ f128:$src), VFRC),
4053
- DSForm:$dst)>;
4054
- def : Pat<(PPCstore_scal_int_from_vsr
4055
- (f64 (PPCcv_fp_to_sint_in_vsr f128:$src)), ForceXForm:$dst, 4),
4056
- (STXSIWX (COPY_TO_REGCLASS (XSCVQPSWZ $src), VFRC), ForceXForm:$dst)>;
4057
- def : Pat<(PPCstore_scal_int_from_vsr
4058
- (f64 (PPCcv_fp_to_sint_in_vsr f128:$src)), ForceXForm:$dst, 2),
4059
- (STXSIHX (COPY_TO_REGCLASS (XSCVQPSWZ $src), VFRC), ForceXForm:$dst)>;
4060
- def : Pat<(PPCstore_scal_int_from_vsr
4061
- (f64 (PPCcv_fp_to_sint_in_vsr f128:$src)), ForceXForm:$dst, 1),
4062
- (STXSIBX (COPY_TO_REGCLASS (XSCVQPSWZ $src), VFRC), ForceXForm:$dst)>;
4063
- def : Pat<(PPCstore_scal_int_from_vsr
4064
- (f64 (PPCcv_fp_to_sint_in_vsr f64:$src)), XForm:$dst, 8),
4065
- (STXSDX (XSCVDPSXDS f64:$src), XForm:$dst)>;
4066
- def : Pat<(PPCstore_scal_int_from_vsr
4067
- (f64 (PPCcv_fp_to_sint_in_vsr f64:$src)), DSForm:$dst, 8),
4068
- (STXSD (XSCVDPSXDS f64:$src), DSForm:$dst)>;
4069
- def : Pat<(PPCstore_scal_int_from_vsr
4070
- (f64 (PPCcv_fp_to_sint_in_vsr f64:$src)), ForceXForm:$dst, 2),
4071
- (STXSIHX (XSCVDPSXWS f64:$src), ForceXForm:$dst)>;
4072
- def : Pat<(PPCstore_scal_int_from_vsr
4073
- (f64 (PPCcv_fp_to_sint_in_vsr f64:$src)), ForceXForm:$dst, 1),
4074
- (STXSIBX (XSCVDPSXWS f64:$src), ForceXForm:$dst)>;
4075
-
4076
- // Instructions for store(fptoui).
4077
- def : Pat<(PPCstore_scal_int_from_vsr
4078
- (f64 (PPCcv_fp_to_uint_in_vsr f128:$src)), XForm:$dst, 8),
4079
- (STXSDX (COPY_TO_REGCLASS (XSCVQPUDZ f128:$src), VFRC),
4080
- XForm:$dst)>;
4081
- def : Pat<(PPCstore_scal_int_from_vsr
4082
- (f64 (PPCcv_fp_to_uint_in_vsr f128:$src)), DSForm:$dst, 8),
4083
- (STXSD (COPY_TO_REGCLASS (XSCVQPUDZ f128:$src), VFRC),
4084
- DSForm:$dst)>;
4085
- def : Pat<(PPCstore_scal_int_from_vsr
4086
- (f64 (PPCcv_fp_to_uint_in_vsr f128:$src)), ForceXForm:$dst, 4),
4087
- (STXSIWX (COPY_TO_REGCLASS (XSCVQPUWZ $src), VFRC), ForceXForm:$dst)>;
4088
- def : Pat<(PPCstore_scal_int_from_vsr
4089
- (f64 (PPCcv_fp_to_uint_in_vsr f128:$src)), ForceXForm:$dst, 2),
4090
- (STXSIHX (COPY_TO_REGCLASS (XSCVQPUWZ $src), VFRC), ForceXForm:$dst)>;
4091
- def : Pat<(PPCstore_scal_int_from_vsr
4092
- (f64 (PPCcv_fp_to_uint_in_vsr f128:$src)), ForceXForm:$dst, 1),
4093
- (STXSIBX (COPY_TO_REGCLASS (XSCVQPUWZ $src), VFRC), ForceXForm:$dst)>;
4094
- def : Pat<(PPCstore_scal_int_from_vsr
4095
- (f64 (PPCcv_fp_to_uint_in_vsr f64:$src)), XForm:$dst, 8),
4096
- (STXSDX (XSCVDPUXDS f64:$src), XForm:$dst)>;
4097
- def : Pat<(PPCstore_scal_int_from_vsr
4098
- (f64 (PPCcv_fp_to_uint_in_vsr f64:$src)), DSForm:$dst, 8),
4099
- (STXSD (XSCVDPUXDS f64:$src), DSForm:$dst)>;
4100
- def : Pat<(PPCstore_scal_int_from_vsr
4101
- (f64 (PPCcv_fp_to_uint_in_vsr f64:$src)), ForceXForm:$dst, 2),
4102
- (STXSIHX (XSCVDPUXWS f64:$src), ForceXForm:$dst)>;
4103
- def : Pat<(PPCstore_scal_int_from_vsr
4104
- (f64 (PPCcv_fp_to_uint_in_vsr f64:$src)), ForceXForm:$dst, 1),
4105
- (STXSIBX (XSCVDPUXWS f64:$src), ForceXForm:$dst)>;
4054
+ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, DSForm:$dst, 8),
4055
+ (STXSD $src, DSForm:$dst)>;
4056
+ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, ForceXForm:$dst, 2),
4057
+ (STXSIHX $src, ForceXForm:$dst)>;
4058
+ def : Pat<(PPCstore_scal_int_from_vsr f64:$src, ForceXForm:$dst, 1),
4059
+ (STXSIBX $src, ForceXForm:$dst)>;
4060
+
4061
+ def : Pat<(PPCstore_scal_int_from_vsr f128:$src, DSForm:$dst, 8),
4062
+ (STXSD (COPY_TO_REGCLASS $src, VFRC), DSForm:$dst)>;
4063
+ def : Pat<(PPCstore_scal_int_from_vsr f128:$src, ForceXForm:$dst, 2),
4064
+ (STXSIHX (COPY_TO_REGCLASS $src, VSFRC), ForceXForm:$dst)>;
4065
+ def : Pat<(PPCstore_scal_int_from_vsr f128:$src, ForceXForm:$dst, 1),
4066
+ (STXSIBX (COPY_TO_REGCLASS $src, VSFRC), ForceXForm:$dst)>;
4106
4067
4107
4068
// Round & Convert QP -> DP/SP
4108
4069
def : Pat<(f64 (any_fpround f128:$src)), (f64 (XSCVQPDP $src))>;
0 commit comments