[llvm] [Mips] Add r5900 (PlayStation 2 Emotion Engine) FPU Support (PR #178942)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 7 03:59:19 PST 2026
================
@@ -539,6 +539,65 @@ static Mips::CondCode condCodeToFCC(ISD::CondCode CC) {
}
}
+// R5900 FPU only supports 4 compare conditions: C.F, C.EQ, C.LT, C.LE
+// (opcodes 0x30, 0x32, 0x34, 0x36). Map unsupported conditions to equivalents.
+// The R5900 FPU doesn't produce NaN, so unordered comparisons can be mapped
+// to their ordered equivalents.
+// Returns the R5900-compatible condition code and whether operands should be
+// swapped.
+static std::pair<Mips::CondCode, bool> condCodeToFCCR5900(ISD::CondCode CC) {
+ // R5900 supports: FCOND_F (0), FCOND_OEQ (2), FCOND_OLT (4), FCOND_OLE (6)
----------------
arsenm wrote:
The generic legalizer has the code already to legalize compares in terms of other compares if you use setCondCodeAction
https://github.com/llvm/llvm-project/pull/178942
More information about the llvm-commits
mailing list