[Mips] Select the R5900's integer movz and movn #16
Loading…
Reference in a new issue
No description provided.
Delete branch "r5900-cmov"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on ps2/llvm#15 (base
r5900-sched-coverage); retarget tor5900-eeonce #15 is merged.The R5900 implements the integer MIPS IV conditional moves (
movz,movn) but LLVM models it as MIPS III, so every integer select became a branch. This enables them for the R5900 in instruction selection, the assembler and the disassembler. The FPU conditional moves (movz.s,movn.s,movt,movf) stay unavailable, as on the hardware. GCC already usesmovz/movnfor-march=r5900. Gated onFeatureR5900; other CPUs are unchanged.On the console all checksums match. Speed is unchanged at -O1, -O2 and -O3 (raster minimum over 2 to 4 boots within 0.1%). At -Os the raster pixel loop is the same instructions at a different address (setup got shorter), and the result is not settled: raster shows per-boot modes for every compiler, and this build gave 8.11M cycles on 7 of 7 boots against 7.63M to 7.89M before; with
fb4 KB-aligned it gave 7.54M on 1 of 4 boots and 8.11M on the others. GCC -Os is 9.37M to 9.62M.Tests:
CodeGen/Mips/r5900-cmov.ll,MC/Mips/r5900-cmov.s(including the MIPS III rejection and the FPU forms staying invalid),MC/Disassembler/Mips/r5900-cmov.txt. All 2026 tests in CodeGen/Mips, MC/Mips, MC/Disassembler/Mips and Transforms/SimplifyCFG pass.🤖 Generated with Claude Code
b6eaff4ae6db4a34fca9db4a34fca95c05831eb6