Skip to content

Commit 60c48e6

Browse files
committed
Note that this is for scalars
1 parent 476c0cc commit 60c48e6

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,39 +2421,40 @@ let Predicates = [HasSVEorSME] in {
24212421
defm FSQRT_ZPmZ : sve_fp_2op_p_zd_HSD<0b01101, "fsqrt", AArch64fsqrt_mt>;
24222422
} // End HasSVEorSME
24232423

2424-
// Helper for creating fp -> int -> fp conversions using SVE.
2425-
class sve_fp_int_fp_cvt<Instruction PTRUE, Instruction FROM_INT, Instruction TO_INT, SubRegIndex sub>
2424+
// Helper for creating scalar fp -> int -> fp conversions using SVE.
2425+
class sve_scalar_fp_int_fp_cvt
2426+
<Instruction PTRUE, Instruction FROM_INT, Instruction TO_INT, SubRegIndex sub>
24262427
: OutPatFrag<(ops node: $Rn),
24272428
(EXTRACT_SUBREG
24282429
(FROM_INT (IMPLICIT_DEF), (PTRUE 1),
24292430
(TO_INT (IMPLICIT_DEF), (PTRUE 1),
24302431
(INSERT_SUBREG (IMPLICIT_DEF), $Rn, sub))), sub)>;
24312432

2432-
// Some float -> int -> float conversion patterns where we want to keep the int
2433-
// values in FP registers using the SVE instructions to avoid costly GPR <-> FPR
2434-
// register transfers. Only used when NEON is not available (e.g. in streaming
2435-
// functions).
2436-
// TODO: When +sme2p2 is available single-element vectors should be preferred.
2433+
// Some scalar float -> int -> float conversion patterns where we want to keep
2434+
// the int values in FP registers to avoid costly GPR <-> FPR register
2435+
// transfers using SVE instructions. Only used when NEON is not available (e.g.
2436+
// in streaming functions).
2437+
// TODO: When +sme2p2 is available Neon single-element vectors should be preferred.
24372438
def HasNoNEON : Predicate<"!Subtarget->isNeonAvailable()">;
24382439
let Predicates = [HasSVEorSME, HasNoNEON] in {
24392440
def : Pat<
24402441
(f64 (sint_to_fp (i64 (fp_to_sint f64:$Rn)))),
2441-
(sve_fp_int_fp_cvt<PTRUE_D, SCVTF_ZPmZ_DtoD, FCVTZS_ZPmZ_DtoD, dsub> $Rn)>;
2442+
(sve_scalar_fp_int_fp_cvt<PTRUE_D, SCVTF_ZPmZ_DtoD, FCVTZS_ZPmZ_DtoD, dsub> $Rn)>;
24422443
def : Pat<
24432444
(f64 (uint_to_fp (i64 (fp_to_uint f64:$Rn)))),
2444-
(sve_fp_int_fp_cvt<PTRUE_D, UCVTF_ZPmZ_DtoD, FCVTZU_ZPmZ_DtoD, dsub> $Rn)>;
2445+
(sve_scalar_fp_int_fp_cvt<PTRUE_D, UCVTF_ZPmZ_DtoD, FCVTZU_ZPmZ_DtoD, dsub> $Rn)>;
24452446
def : Pat<
24462447
(f32 (sint_to_fp (i32 (fp_to_sint f32:$Rn)))),
2447-
(sve_fp_int_fp_cvt<PTRUE_S, SCVTF_ZPmZ_StoS, FCVTZS_ZPmZ_StoS, ssub> $Rn)>;
2448+
(sve_scalar_fp_int_fp_cvt<PTRUE_S, SCVTF_ZPmZ_StoS, FCVTZS_ZPmZ_StoS, ssub> $Rn)>;
24482449
def : Pat<
24492450
(f32 (uint_to_fp (i32 (fp_to_uint f32:$Rn)))),
2450-
(sve_fp_int_fp_cvt<PTRUE_S, UCVTF_ZPmZ_StoS, FCVTZU_ZPmZ_StoS, ssub> $Rn)>;
2451+
(sve_scalar_fp_int_fp_cvt<PTRUE_S, UCVTF_ZPmZ_StoS, FCVTZU_ZPmZ_StoS, ssub> $Rn)>;
24512452
def : Pat<
24522453
(f16 (sint_to_fp (i32 (fp_to_sint f16:$Rn)))),
2453-
(sve_fp_int_fp_cvt<PTRUE_H, SCVTF_ZPmZ_HtoH, FCVTZS_ZPmZ_HtoH, hsub> $Rn)>;
2454+
(sve_scalar_fp_int_fp_cvt<PTRUE_H, SCVTF_ZPmZ_HtoH, FCVTZS_ZPmZ_HtoH, hsub> $Rn)>;
24542455
def : Pat<
24552456
(f16 (uint_to_fp (i32 (fp_to_uint f16:$Rn)))),
2456-
(sve_fp_int_fp_cvt<PTRUE_H, UCVTF_ZPmZ_HtoH, FCVTZU_ZPmZ_HtoH, hsub> $Rn)>;
2457+
(sve_scalar_fp_int_fp_cvt<PTRUE_H, UCVTF_ZPmZ_HtoH, FCVTZU_ZPmZ_HtoH, hsub> $Rn)>;
24572458
} // End HasSVEorSME, HasNoNEON
24582459

24592460
let Predicates = [HasBF16, HasSVEorSME] in {

0 commit comments

Comments
 (0)