@@ -59,9 +59,9 @@ def FPR64IN32X : RegisterOperand<GPRPair> {
59
59
def DExt : ExtInfo<"", "", [HasStdExtD], f64, FPR64, FPR32, FPR64, ?>;
60
60
61
61
def ZdinxExt : ExtInfo<"_INX", "Zfinx", [HasStdExtZdinx, IsRV64],
62
- f64, FPR64INX, FPR32INX, FPR64INX, ?>;
62
+ f64, FPR64INX, FPR32INX, FPR64INX, ?, i64 >;
63
63
def Zdinx32Ext : ExtInfo<"_IN32X", "ZdinxRV32Only", [HasStdExtZdinx, IsRV32],
64
- f64, FPR64IN32X, FPR32INX, FPR64IN32X, ?>;
64
+ f64, FPR64IN32X, FPR32INX, FPR64IN32X, ?, i32 >;
65
65
66
66
defvar DExts = [DExt, ZdinxExt, Zdinx32Ext];
67
67
defvar DExtsRV64 = [DExt, ZdinxExt];
@@ -261,8 +261,10 @@ let Predicates = [HasStdExtZdinx, IsRV32] in {
261
261
/// Float conversion operations
262
262
263
263
// 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))>;
266
268
} // Predicates = [HasStdExtZdinx, IsRV32]
267
269
268
270
// [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)>;
321
323
def : Pat<(fneg FPR64INX:$rs1), (FSGNJN_D_INX $rs1, $rs1)>;
322
324
def : Pat<(fabs FPR64INX:$rs1), (FSGNJX_D_INX $rs1, $rs1)>;
323
325
324
- def : Pat<(riscv_fclass FPR64INX:$rs1), (FCLASS_D_INX $rs1)>;
326
+ def : Pat<(i64 ( riscv_fclass FPR64INX:$rs1) ), (FCLASS_D_INX $rs1)>;
325
327
326
328
def : PatFprFpr<fcopysign, FSGNJ_D_INX, FPR64INX, f64>;
327
329
def : PatFprFpr<riscv_fsgnjx, FSGNJX_D_INX, FPR64INX, f64>;
@@ -354,41 +356,46 @@ def : Pat<(fneg (any_fma_nsz FPR64INX:$rs1, FPR64INX:$rs2, FPR64INX:$rs3)),
354
356
} // Predicates = [HasStdExtZdinx, IsRV64]
355
357
356
358
let 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))>;
358
361
359
362
def : Pat<(fneg FPR64IN32X:$rs1), (FSGNJN_D_IN32X $rs1, $rs1)>;
360
363
def : Pat<(fabs FPR64IN32X:$rs1), (FSGNJX_D_IN32X $rs1, $rs1)>;
361
364
362
- def : Pat<(riscv_fclass FPR64IN32X:$rs1), (FCLASS_D_IN32X $rs1)>;
365
+ def : Pat<(i32 ( riscv_fclass FPR64IN32X:$rs1) ), (FCLASS_D_IN32X $rs1)>;
363
366
364
367
def : PatFprFpr<fcopysign, FSGNJ_D_IN32X, FPR64IN32X, f64>;
365
368
def : PatFprFpr<riscv_fsgnjx, FSGNJX_D_IN32X, FPR64IN32X, f64>;
366
369
def : Pat<(fcopysign FPR64IN32X:$rs1, (fneg FPR64IN32X:$rs2)),
367
370
(FSGNJN_D_IN32X FPR64IN32X:$rs1, FPR64IN32X:$rs2)>;
368
371
def : 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) ))>;
370
373
def : 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) ))>;
372
375
373
376
// fmadd: rs1 * rs2 + rs3
374
377
def : 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) )>;
376
379
377
380
// fmsub: rs1 * rs2 - rs3
378
381
def : 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))>;
380
384
381
385
// fnmsub: -rs1 * rs2 + rs3
382
386
def : 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))>;
384
389
385
390
// fnmadd: -rs1 * rs2 - rs3
386
391
def : 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))>;
388
394
389
395
// fnmadd: -(rs1 * rs2 + rs3) (the nsz flag on the FMA)
390
396
def : 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))>;
392
399
} // Predicates = [HasStdExtZdinx, IsRV32]
393
400
394
401
// 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>;
441
448
442
449
let Predicates = [HasStdExtZdinx, IsRV64] in {
443
450
// 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)),
445
452
(AND (XLenVT (FLE_D_INX $rs1, $rs2)),
446
453
(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)),
448
455
(AND (XLenVT (FLE_D_INX $rs1, $rs2)),
449
456
(XLenVT (FLE_D_INX $rs2, $rs1)))>;
450
457
// 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)),
452
459
(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)),
454
461
(FLE_D_INX $rs1, $rs1)>;
455
462
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 >;
460
467
} // Predicates = [HasStdExtZdinx, IsRV64]
461
468
462
469
let Predicates = [HasStdExtZdinx, IsRV32] in {
463
470
// 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)),
465
472
(AND (XLenVT (FLE_D_IN32X $rs1, $rs2)),
466
473
(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)),
468
475
(AND (XLenVT (FLE_D_IN32X $rs1, $rs2)),
469
476
(XLenVT (FLE_D_IN32X $rs2, $rs1)))>;
470
477
// 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)),
472
479
(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)),
474
481
(FLE_D_IN32X $rs1, $rs1)>;
475
482
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 >;
480
487
} // Predicates = [HasStdExtZdinx, IsRV32]
481
488
482
489
let Predicates = [HasStdExtD] in {
@@ -511,7 +518,7 @@ def SplitF64Pseudo
511
518
} // Predicates = [HasStdExtD, NoStdExtZfa, IsRV32]
512
519
513
520
let Predicates = [HasStdExtZdinx, IsRV64] in {
514
- defm Select_FPR64INX : SelectCC_GPR_rrirr<FPR64INX, f64>;
521
+ defm Select_FPR64INX : SelectCC_GPR_rrirr<FPR64INX, f64, i64 >;
515
522
516
523
def PseudoFROUND_D_INX : PseudoFROUND<FPR64INX, f64>;
517
524
@@ -523,9 +530,9 @@ def : StPat<store, SD, GPR, f64>;
523
530
} // Predicates = [HasStdExtZdinx, IsRV64]
524
531
525
532
let Predicates = [HasStdExtZdinx, IsRV32] in {
526
- defm Select_FPR64IN32X : SelectCC_GPR_rrirr<FPR64IN32X, f64>;
533
+ defm Select_FPR64IN32X : SelectCC_GPR_rrirr<FPR64IN32X, f64, i32 >;
527
534
528
- def PseudoFROUND_D_IN32X : PseudoFROUND<FPR64IN32X, f64>;
535
+ def PseudoFROUND_D_IN32X : PseudoFROUND<FPR64IN32X, f64, i32 >;
529
536
530
537
/// Loads
531
538
let hasSideEffects = 0, mayLoad = 1, mayStore = 0, Size = 8, isCodeGenOnly = 1 in
0 commit comments