Skip to content

Commit d9f3fae

Browse files
committed
[RISCV] Add NoStdExtZfa predicates to BuildPairF64Pseudo and SplitF64Pseudo.
The makes the priority of the Zfa patterns of the pseudos explicit. Previously the priority only worked because instructions with usesCustomInserter=1 have lower priority.
1 parent 1235a93 commit d9f3fae

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ def FeatureStdExtZfa
316316
def HasStdExtZfa : Predicate<"Subtarget->hasStdExtZfa()">,
317317
AssemblerPredicate<(all_of FeatureStdExtZfa),
318318
"'Zfa' (Additional Floating-Point)">;
319+
def NoStdExtZfa : Predicate<"!Subtarget->hasStdExtZfa()">;
319320

320321
def FeatureStdExtZfinx
321322
: RISCVExtension<1, 0, "Float in Integer", [FeatureStdExtZicsr]>;

llvm/lib/Target/RISCV/RISCVInstrInfoD.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ def : LdPat<load, FLD, f64>;
488488
/// Stores
489489

490490
def : StPat<store, FSD, FPR64, f64>;
491+
} // Predicates = [HasStdExtD]
491492

493+
let Predicates = [HasStdExtD, NoStdExtZfa, IsRV32] in {
492494
/// Pseudo-instructions needed for the soft-float ABI with RV32D
493495

494496
// Moves two GPRs to an FPR.
@@ -503,7 +505,7 @@ def SplitF64Pseudo
503505
: Pseudo<(outs GPR:$dst1, GPR:$dst2), (ins FPR64:$src),
504506
[(set GPR:$dst1, GPR:$dst2, (RISCVSplitF64 FPR64:$src))]>;
505507

506-
} // Predicates = [HasStdExtD]
508+
} // Predicates = [HasStdExtD, NoStdExtZfa, IsRV32]
507509

508510
let Predicates = [HasStdExtZdinx, IsRV64] in {
509511
defm Select_FPR64INX : SelectCC_GPR_rrirr<FPR64INX, f64>;

0 commit comments

Comments
 (0)