@@ -59,9 +59,9 @@ def FPR64IN32X : RegisterOperand<GPRPair> {
5959def DExt : ExtInfo<"", "", [HasStdExtD], f64, FPR64, FPR32, FPR64, ?>;
6060
6161def ZdinxExt : ExtInfo<"_INX", "Zfinx", [HasStdExtZdinx, IsRV64],
62- f64, FPR64INX, FPR32INX, FPR64INX, ?>;
62+ f64, FPR64INX, FPR32INX, FPR64INX, ?, i64 >;
6363def Zdinx32Ext : ExtInfo<"_IN32X", "ZdinxRV32Only", [HasStdExtZdinx, IsRV32],
64- f64, FPR64IN32X, FPR32INX, FPR64IN32X, ?>;
64+ f64, FPR64IN32X, FPR32INX, FPR64IN32X, ?, i32 >;
6565
6666defvar DExts = [DExt, ZdinxExt, Zdinx32Ext];
6767defvar DExtsRV64 = [DExt, ZdinxExt];
@@ -261,8 +261,10 @@ let Predicates = [HasStdExtZdinx, IsRV32] in {
261261/// Float conversion operations
262262
263263// f64 -> f32, f32 -> f64
264- def : Pat<(any_fpround FPR64IN32X:$rs1), (FCVT_S_D_IN32X FPR64IN32X:$rs1, FRM_DYN)>;
265- def : Pat<(any_fpextend FPR32INX:$rs1), (FCVT_D_S_IN32X FPR32INX:$rs1, FRM_RNE)>;
264+ def : Pat<(any_fpround FPR64IN32X:$rs1),
265+ (FCVT_S_D_IN32X FPR64IN32X:$rs1, (i32 FRM_DYN))>;
266+ def : Pat<(any_fpextend FPR32INX:$rs1),
267+ (FCVT_D_S_IN32X FPR32INX:$rs1, (i32 FRM_RNE))>;
266268} // Predicates = [HasStdExtZdinx, IsRV32]
267269
268270// [u]int<->double conversion patterns must be gated on IsRV32 or IsRV64, so
@@ -321,7 +323,7 @@ def : Pat<(any_fsqrt FPR64INX:$rs1), (FSQRT_D_INX FPR64INX:$rs1, FRM_DYN)>;
321323def : Pat<(fneg FPR64INX:$rs1), (FSGNJN_D_INX $rs1, $rs1)>;
322324def : Pat<(fabs FPR64INX:$rs1), (FSGNJX_D_INX $rs1, $rs1)>;
323325
324- def : Pat<(riscv_fclass FPR64INX:$rs1), (FCLASS_D_INX $rs1)>;
326+ def : Pat<(i64 ( riscv_fclass FPR64INX:$rs1) ), (FCLASS_D_INX $rs1)>;
325327
326328def : PatFprFpr<fcopysign, FSGNJ_D_INX, FPR64INX, f64>;
327329def : PatFprFpr<riscv_fsgnjx, FSGNJX_D_INX, FPR64INX, f64>;
@@ -354,41 +356,46 @@ def : Pat<(fneg (any_fma_nsz FPR64INX:$rs1, FPR64INX:$rs2, FPR64INX:$rs3)),
354356} // Predicates = [HasStdExtZdinx, IsRV64]
355357
356358let Predicates = [HasStdExtZdinx, IsRV32] in {
357- def : Pat<(any_fsqrt FPR64IN32X:$rs1), (FSQRT_D_IN32X FPR64IN32X:$rs1, FRM_DYN)>;
359+ def : Pat<(any_fsqrt FPR64IN32X:$rs1),
360+ (FSQRT_D_IN32X FPR64IN32X:$rs1, (i32 FRM_DYN))>;
358361
359362def : Pat<(fneg FPR64IN32X:$rs1), (FSGNJN_D_IN32X $rs1, $rs1)>;
360363def : Pat<(fabs FPR64IN32X:$rs1), (FSGNJX_D_IN32X $rs1, $rs1)>;
361364
362- def : Pat<(riscv_fclass FPR64IN32X:$rs1), (FCLASS_D_IN32X $rs1)>;
365+ def : Pat<(i32 ( riscv_fclass FPR64IN32X:$rs1) ), (FCLASS_D_IN32X $rs1)>;
363366
364367def : PatFprFpr<fcopysign, FSGNJ_D_IN32X, FPR64IN32X, f64>;
365368def : PatFprFpr<riscv_fsgnjx, FSGNJX_D_IN32X, FPR64IN32X, f64>;
366369def : Pat<(fcopysign FPR64IN32X:$rs1, (fneg FPR64IN32X:$rs2)),
367370 (FSGNJN_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2)>;
368371def : Pat<(fcopysign FPR64IN32X:$rs1, FPR32INX:$rs2),
369- (FSGNJ_D_IN32X $rs1, (FCVT_D_S_IN32X $rs2, FRM_RNE))>;
372+ (FSGNJ_D_IN32X $rs1, (FCVT_D_S_IN32X $rs2, (i32 FRM_RNE) ))>;
370373def : Pat<(fcopysign FPR32INX:$rs1, FPR64IN32X:$rs2),
371- (FSGNJ_S_INX $rs1, (FCVT_S_D_IN32X $rs2, FRM_DYN))>;
374+ (FSGNJ_S_INX $rs1, (FCVT_S_D_IN32X $rs2, (i32 FRM_DYN) ))>;
372375
373376// fmadd: rs1 * rs2 + rs3
374377def : Pat<(any_fma FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3),
375- (FMADD_D_IN32X $rs1, $rs2, $rs3, FRM_DYN)>;
378+ (FMADD_D_IN32X $rs1, $rs2, $rs3, (i32 FRM_DYN) )>;
376379
377380// fmsub: rs1 * rs2 - rs3
378381def : Pat<(any_fma FPR64IN32X:$rs1, FPR64IN32X:$rs2, (fneg FPR64IN32X:$rs3)),
379- (FMSUB_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3, FRM_DYN)>;
382+ (FMSUB_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3,
383+ (i32 FRM_DYN))>;
380384
381385// fnmsub: -rs1 * rs2 + rs3
382386def : Pat<(any_fma (fneg FPR64IN32X:$rs1), FPR64IN32X:$rs2, FPR64IN32X:$rs3),
383- (FNMSUB_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3, FRM_DYN)>;
387+ (FNMSUB_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3,
388+ (i32 FRM_DYN))>;
384389
385390// fnmadd: -rs1 * rs2 - rs3
386391def : Pat<(any_fma (fneg FPR64IN32X:$rs1), FPR64IN32X:$rs2, (fneg FPR64IN32X:$rs3)),
387- (FNMADD_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3, FRM_DYN)>;
392+ (FNMADD_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3,
393+ (i32 FRM_DYN))>;
388394
389395// fnmadd: -(rs1 * rs2 + rs3) (the nsz flag on the FMA)
390396def : Pat<(fneg (any_fma_nsz FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3)),
391- (FNMADD_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3, FRM_DYN)>;
397+ (FNMADD_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2, FPR64IN32X:$rs3,
398+ (i32 FRM_DYN))>;
392399} // Predicates = [HasStdExtZdinx, IsRV32]
393400
394401// The ratified 20191213 ISA spec defines fmin and fmax in a way that matches
@@ -441,42 +448,42 @@ def : PatSetCC<FPR64, any_fsetccs, SETOLE, FLE_D, f64>;
441448
442449let Predicates = [HasStdExtZdinx, IsRV64] in {
443450// Match signaling FEQ_D
444- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64INX:$rs1) , FPR64INX:$rs2, SETEQ)),
451+ def : Pat<(XLenVT (strict_fsetccs FPR64INX:$rs1, FPR64INX:$rs2, SETEQ)),
445452 (AND (XLenVT (FLE_D_INX $rs1, $rs2)),
446453 (XLenVT (FLE_D_INX $rs2, $rs1)))>;
447- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64INX:$rs1) , FPR64INX:$rs2, SETOEQ)),
454+ def : Pat<(XLenVT (strict_fsetccs FPR64INX:$rs1, FPR64INX:$rs2, SETOEQ)),
448455 (AND (XLenVT (FLE_D_INX $rs1, $rs2)),
449456 (XLenVT (FLE_D_INX $rs2, $rs1)))>;
450457// If both operands are the same, use a single FLE.
451- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64INX:$rs1) , FPR64INX:$rs1, SETEQ)),
458+ def : Pat<(XLenVT (strict_fsetccs FPR64INX:$rs1, FPR64INX:$rs1, SETEQ)),
452459 (FLE_D_INX $rs1, $rs1)>;
453- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64INX:$rs1) , FPR64INX:$rs1, SETOEQ)),
460+ def : Pat<(XLenVT (strict_fsetccs FPR64INX:$rs1, FPR64INX:$rs1, SETOEQ)),
454461 (FLE_D_INX $rs1, $rs1)>;
455462
456- def : PatSetCC<FPR64INX, any_fsetccs, SETLT, FLT_D_INX, f64>;
457- def : PatSetCC<FPR64INX, any_fsetccs, SETOLT, FLT_D_INX, f64>;
458- def : PatSetCC<FPR64INX, any_fsetccs, SETLE, FLE_D_INX, f64>;
459- def : PatSetCC<FPR64INX, any_fsetccs, SETOLE, FLE_D_INX, f64>;
463+ def : PatSetCC<FPR64INX, any_fsetccs, SETLT, FLT_D_INX, f64, i64 >;
464+ def : PatSetCC<FPR64INX, any_fsetccs, SETOLT, FLT_D_INX, f64, i64 >;
465+ def : PatSetCC<FPR64INX, any_fsetccs, SETLE, FLE_D_INX, f64, i64 >;
466+ def : PatSetCC<FPR64INX, any_fsetccs, SETOLE, FLE_D_INX, f64, i64 >;
460467} // Predicates = [HasStdExtZdinx, IsRV64]
461468
462469let Predicates = [HasStdExtZdinx, IsRV32] in {
463470// Match signaling FEQ_D
464- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64IN32X:$rs1) , FPR64IN32X:$rs2, SETEQ)),
471+ def : Pat<(i32 (strict_fsetccs FPR64IN32X:$rs1, FPR64IN32X:$rs2, SETEQ)),
465472 (AND (XLenVT (FLE_D_IN32X $rs1, $rs2)),
466473 (XLenVT (FLE_D_IN32X $rs2, $rs1)))>;
467- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64IN32X:$rs1) , FPR64IN32X:$rs2, SETOEQ)),
474+ def : Pat<(i32 (strict_fsetccs FPR64IN32X:$rs1, FPR64IN32X:$rs2, SETOEQ)),
468475 (AND (XLenVT (FLE_D_IN32X $rs1, $rs2)),
469476 (XLenVT (FLE_D_IN32X $rs2, $rs1)))>;
470477// If both operands are the same, use a single FLE.
471- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64IN32X:$rs1) , FPR64IN32X:$rs1, SETEQ)),
478+ def : Pat<(i32 (strict_fsetccs FPR64IN32X:$rs1, FPR64IN32X:$rs1, SETEQ)),
472479 (FLE_D_IN32X $rs1, $rs1)>;
473- def : Pat<(XLenVT (strict_fsetccs (f64 FPR64IN32X:$rs1) , FPR64IN32X:$rs1, SETOEQ)),
480+ def : Pat<(i32 (strict_fsetccs FPR64IN32X:$rs1, FPR64IN32X:$rs1, SETOEQ)),
474481 (FLE_D_IN32X $rs1, $rs1)>;
475482
476- def : PatSetCC<FPR64IN32X, any_fsetccs, SETLT, FLT_D_IN32X, f64>;
477- def : PatSetCC<FPR64IN32X, any_fsetccs, SETOLT, FLT_D_IN32X, f64>;
478- def : PatSetCC<FPR64IN32X, any_fsetccs, SETLE, FLE_D_IN32X, f64>;
479- def : PatSetCC<FPR64IN32X, any_fsetccs, SETOLE, FLE_D_IN32X, f64>;
483+ def : PatSetCC<FPR64IN32X, any_fsetccs, SETLT, FLT_D_IN32X, f64, i32 >;
484+ def : PatSetCC<FPR64IN32X, any_fsetccs, SETOLT, FLT_D_IN32X, f64, i32 >;
485+ def : PatSetCC<FPR64IN32X, any_fsetccs, SETLE, FLE_D_IN32X, f64, i32 >;
486+ def : PatSetCC<FPR64IN32X, any_fsetccs, SETOLE, FLE_D_IN32X, f64, i32 >;
480487} // Predicates = [HasStdExtZdinx, IsRV32]
481488
482489let Predicates = [HasStdExtD] in {
@@ -511,7 +518,7 @@ def SplitF64Pseudo
511518} // Predicates = [HasStdExtD, NoStdExtZfa, IsRV32]
512519
513520let Predicates = [HasStdExtZdinx, IsRV64] in {
514- defm Select_FPR64INX : SelectCC_GPR_rrirr<FPR64INX, f64>;
521+ defm Select_FPR64INX : SelectCC_GPR_rrirr<FPR64INX, f64, i64 >;
515522
516523def PseudoFROUND_D_INX : PseudoFROUND<FPR64INX, f64>;
517524
@@ -523,9 +530,9 @@ def : StPat<store, SD, GPR, f64>;
523530} // Predicates = [HasStdExtZdinx, IsRV64]
524531
525532let Predicates = [HasStdExtZdinx, IsRV32] in {
526- defm Select_FPR64IN32X : SelectCC_GPR_rrirr<FPR64IN32X, f64>;
533+ defm Select_FPR64IN32X : SelectCC_GPR_rrirr<FPR64IN32X, f64, i32 >;
527534
528- def PseudoFROUND_D_IN32X : PseudoFROUND<FPR64IN32X, f64>;
535+ def PseudoFROUND_D_IN32X : PseudoFROUND<FPR64IN32X, f64, i32 >;
529536
530537/// Loads
531538let hasSideEffects = 0, mayLoad = 1, mayStore = 0, Size = 8, isCodeGenOnly = 1 in
0 commit comments