Rick Gaiser
98fe2fb67a
[Mips] Add r5900 (PlayStation 2 Emotion Engine) FPU Support ( #178942 )
...
This PR adds basic FPU support for the MIPS R5900 processor used in the
PlayStation 2 Emotion Engine. The R5900 has a non-standard
single-precision-only FPU with limited functionality compared to
standard MIPS FPUs. Just like the previous r5900 PR, only existing
instructions are used to implement basic support first.
## Changes
### Infrastructure for single-precision-only FPU (ce13ddea7bc7)
- Add `isSingleFloat()` method to MipsAsmParser
- Add `SINGLE` FpABIKind to MipsABIFlagsSection
- Properly set CPR1Size and FpABI for single-float mode
- Exclude double-precision PseudoCVT instructions when using
single-float
### R5900 FPU support (13032c4d55b2)
- Switch R5900 from soft-float to single-float mode
- Implement R5900-specific FPU lowering with limited compare conditions
- Use CVT.W.S instead of TRUNC.W.S for FP-to-int conversion (R5900 lacks
TRUNC)
- Add test coverage for R5900 FPU instructions and comparisons
### Invalidate unsupported FPU instructions (ee4222711dab)
- Add predicates to exclude FPU instructions not supported by the R5900
- Add `C_COND_NOTR5900_M` multiclass for unsupported compare conditions
- Add `ISA_MIPS2_NOT_R5900` predicate for ROUND/TRUNC/CEIL/FLOOR.W.S
- Add test coverage for invalid R5900 FPU instructions
## R5900 FPU Limitations
The R5900 FPU differs from standard MIPS FPUs in several ways:
| Feature | Standard MIPS | R5900 |
|---------|---------------|-------|
| Precision | Single + Double | Single only |
| Compare conditions | 16 | 4 (C.F, C.EQ, C.LT, C.LE) |
| Rounding instructions | ROUND/TRUNC/CEIL/FLOOR.W.S | None (use
CVT.W.S) |
## Test Plan
- [x] Added `llvm/test/MC/Mips/r5900-fpu.s` - tests valid R5900 FPU
instructions
- [x] Added `llvm/test/MC/Mips/r5900-invalid.s` - tests rejection of
unsupported instructions
- [x] Added R5900 FPU comparison tests in
`llvm/test/CodeGen/Mips/fcmp.ll`
2026-03-22 23:48:00 -04:00
..
2025-09-28 10:49:40 +08:00
2025-12-12 20:55:12 +01:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2026-02-11 16:27:57 +08:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2026-02-26 18:49:16 +08:00
2025-12-26 18:49:41 +08:00
2025-08-12 11:23:05 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-08-12 11:23:05 -07:00
2026-01-21 09:50:28 +00:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-09-20 07:37:18 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-01-31 14:05:34 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-07-28 09:07:51 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-12-26 18:49:41 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2026-03-13 08:29:35 +08:00
2025-09-25 23:29:13 -04:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2025-12-12 20:55:12 +01:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2025-03-29 21:51:59 +08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-07-30 14:56:39 -07:00
2025-07-30 14:56:39 -07:00
2025-07-30 14:56:39 -07:00
2024-12-20 17:31:38 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2025-12-12 20:55:12 +01:00
2025-12-12 20:55:12 +01:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-05-30 08:03:50 +02:00
2026-01-28 04:32:59 -05:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-11-06 16:14:30 +01:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-02-06 16:27:42 +01:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2026-01-08 16:36:00 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-01-21 16:18:02 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2025-03-30 16:38:16 -07:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-10 22:14:06 -08:00
2026-01-26 15:11:17 +00:00
2026-02-26 18:49:16 +08:00
2025-07-15 13:22:33 -04:00
2026-03-22 23:48:00 -04:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2026-03-13 09:29:28 +00:00
2025-08-18 09:22:41 +02:00
2026-03-13 09:29:28 +00:00
2025-02-19 10:16:57 +01:00
2025-10-25 12:56:47 +08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-07-15 13:22:33 -04:00
2025-11-24 22:07:57 -05:00
2025-12-04 10:20:02 +08:00
2024-12-10 22:14:06 -08:00
2025-11-25 00:02:37 -05:00
2025-12-18 23:06:36 +01:00
2025-12-26 18:49:41 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-08-25 09:15:44 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-09-28 10:49:40 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-07-07 18:31:13 +01:00
2025-09-28 10:49:40 +08:00
2024-12-10 22:14:06 -08:00
2025-03-30 16:38:16 -07:00
2025-01-31 14:05:34 -08:00
2025-06-06 15:44:21 +08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-07-15 17:35:39 +09:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2026-01-08 12:40:10 +01:00
2025-08-19 09:26:38 +02:00
2025-08-19 09:26:38 +02:00
2025-03-30 16:38:16 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-07-15 13:22:33 -04:00
2026-01-08 12:40:10 +01:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-03-30 16:38:16 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-08-12 11:23:05 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-12-26 18:49:41 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-12-08 21:53:15 -08:00
2024-12-10 22:14:06 -08:00
2025-08-12 11:23:05 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2024-12-14 17:46:30 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-06-11 22:19:31 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2026-01-26 15:11:17 +00:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-05-09 07:40:02 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2026-02-07 08:18:35 +01:00
2026-02-09 21:36:35 +08:00
2026-02-08 17:41:30 +00:00
2024-10-18 09:35:42 +04:00
2025-12-12 16:11:29 +08:00
2025-12-12 16:11:29 +08:00
2025-12-12 16:11:29 +08:00
2025-07-28 10:36:40 +02:00
2024-12-10 22:14:06 -08:00
2026-03-13 09:29:28 +00:00
2025-10-02 13:36:47 +09:00
2024-11-01 08:42:34 +08:00
2025-05-15 16:05:15 +08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-10 22:14:06 -08:00
2026-03-06 10:52:04 +00:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2025-05-16 11:22:44 +08:00
2024-12-10 22:14:06 -08:00
2025-01-31 14:05:34 -08:00
2026-03-22 23:48:00 -04:00
2026-03-22 23:48:00 -04:00
2026-01-28 04:32:59 -05:00
2024-12-10 22:14:06 -08:00
2025-02-20 20:53:30 +08:00
2025-03-30 16:38:16 -07:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2025-10-25 12:56:47 +08:00
2025-12-26 18:49:41 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2024-12-20 17:31:38 +08:00
2025-12-08 21:53:15 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-03-30 16:38:16 -07:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-08-12 11:23:05 -07:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2025-10-25 12:56:47 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-11-05 14:42:15 +00:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-12-26 16:32:03 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-10-23 13:37:02 +02:00
2025-10-25 12:56:47 +08:00
2024-12-14 17:46:30 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-08-12 11:23:05 -07:00
2024-12-10 22:14:06 -08:00
2025-03-30 16:38:16 -07:00
2025-05-14 19:52:31 +08:00
2025-04-16 10:56:06 +08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2024-12-10 22:14:06 -08:00
2025-05-07 03:42:47 -04:00
2025-03-30 16:38:16 -07:00
2024-12-10 22:14:06 -08:00