Gate the remaining non-PS2 changes on the PS2 CPUs #14

Merged
techwritescode merged 3 commits from ps2-gate-cleanup into r5900-ee 2026-10-15 17:12:20 +00:00

Follow-up to #13: a file-by-file review of r5900-ee against upstream (fa360c3) found four changes that reached other MIPS CPUs or other libc++ targets.

  • [Mips] Accept rfe only on the R3000A: rfe was enabled for every MIPS I/II CPU. It now needs -mcpu=r3000a in both the assembler and the disassembler, and its tests move from the generic mips1 files to r3000a-rfe.s/r3000a-rfe.txt. IOP builds already pass -mcpu=r3000a.
  • [Mips] Parse VU0 register names only when VU0 is present: $vfN, $viN, $ACC, $Q and $I were parsed as registers on every MIPS CPU. New test r5900-vu0-regs-invalid.s.
  • libcxx/src/regex.cpp: the ctype_base mask cast is now under __ps2sdk__, so other targets compile the upstream initialisers. The four-line comment is now one line.
  • MipsSubtarget.h: the enableMachineScheduler comment now names the R3000A too.

Left as is: the bc2f/bc2t errors on mips32r6/mips64r6 now say "requires a CPU feature" because the VU0 mnemonics exist. That's how the assembler reports any feature-gated mnemonic.

Testing: llvm-lit over test/MC/Mips, test/MC/Disassembler/Mips and test/CodeGen/Mips, 1674 tests, all pass. The regex change was not compiled as part of a libc++ build.

🤖 Generated with Claude Code

Follow-up to #13: a file-by-file review of `r5900-ee` against upstream (fa360c3) found four changes that reached other MIPS CPUs or other libc++ targets. - `[Mips] Accept rfe only on the R3000A`: `rfe` was enabled for every MIPS I/II CPU. It now needs `-mcpu=r3000a` in both the assembler and the disassembler, and its tests move from the generic mips1 files to `r3000a-rfe.s`/`r3000a-rfe.txt`. IOP builds already pass `-mcpu=r3000a`. - `[Mips] Parse VU0 register names only when VU0 is present`: `$vfN`, `$viN`, `$ACC`, `$Q` and `$I` were parsed as registers on every MIPS CPU. New test `r5900-vu0-regs-invalid.s`. - `libcxx/src/regex.cpp`: the `ctype_base` mask cast is now under `__ps2sdk__`, so other targets compile the upstream initialisers. The four-line comment is now one line. - `MipsSubtarget.h`: the `enableMachineScheduler` comment now names the R3000A too. Left as is: the `bc2f`/`bc2t` errors on mips32r6/mips64r6 now say "requires a CPU feature" because the VU0 mnemonics exist. That's how the assembler reports any feature-gated mnemonic. Testing: `llvm-lit` over `test/MC/Mips`, `test/MC/Disassembler/Mips` and `test/CodeGen/Mips`, 1674 tests, all pass. The regex change was not compiled as part of a libc++ build. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
rfe was enabled for every MIPS I/II CPU. Gate it on the R3000A so other
MIPS targets keep upstream behaviour, and move its tests out of the
generic mips1 files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
$vfN, $viN, $ACC, $Q and $I were matched as registers on every MIPS CPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Scope the regex mask cast to __ps2sdk__, fix the scheduler comment
Some checks failed
[libc++] Conformance tests / stage3 (generic-tsan) (pull_request) Has been skipped
[libc++] Conformance tests / stage3 (generic-ubsan) (pull_request) Has been skipped
[libc++] Conformance tests / macos (apple-configuration, 26.5) (pull_request) Has been skipped
[libc++] Conformance tests / macos (apple-system, 26.5) (pull_request) Has been skipped
[libc++] Conformance tests / macos (apple-system-hardened, 26.5) (pull_request) Has been skipped
[libc++] Conformance tests / macos (generic-cxx03, 26.5) (pull_request) Has been skipped
[libc++] Conformance tests / macos (generic-cxx23, 26.5) (pull_request) Has been skipped
[libc++] Conformance tests / macos (generic-modules, 26.5) (pull_request) Has been skipped
[libc++] Conformance tests / windows (cc, mingw-dll, c++, true) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (cc, mingw-incomplete-sysroot, c++, true) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (cc, mingw-static, c++, true) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (cc, mingw-static, c++, true, windows-11-arm) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (clang-cl, clang-cl-debug, clang-cl, false) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (clang-cl, clang-cl-dll, clang-cl, false) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (clang-cl, clang-cl-no-vcruntime, clang-cl, false) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (clang-cl, clang-cl-static, clang-cl, false) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (clang-cl, clang-cl-static-crt, clang-cl, false) (pull_request) Failing after 0s
[libc++] Conformance tests / windows (i686-w64-mingw32-clang, mingw-dll, i686-w64-mingw32-clang++, true) (pull_request) Failing after 0s
[libc++] Test tools / test-tools (pull_request) Has been skipped
CI Checks / Build and Test Linux (pull_request) Has been skipped
CI Checks / Build and Test Windows (pull_request) Has been skipped
CI Checks / Compute macOS Projects (pull_request) Has been skipped
CI Checks / Build and Test macOS arm64 (pull_request) Has been skipped
release-binaries-all.yml / Scope the regex mask cast to __ps2sdk__, fix the scheduler comment (pull_request) Failing after 0s
release-binaries.yml / Scope the regex mask cast to __ps2sdk__, fix the scheduler comment (pull_request) Failing after 0s
release-documentation.yml / Scope the regex mask cast to __ps2sdk__, fix the scheduler comment (pull_request) Failing after 0s
release-sources.yml / Scope the regex mask cast to __ps2sdk__, fix the scheduler comment (pull_request) Failing after 0s
Add buildbot information to first PRs from new contributors / buildbot_comment (pull_request_target) Has been skipped
Labelling new pull requests / greeter (pull_request_target) Has been cancelled
Labelling new pull requests / automate-prs-labels (pull_request_target) Has been cancelled
1674a90691
The cast in libc++ regex.cpp is needed only for newlib's ctype masks, so
other targets now see the upstream initialisers. enableMachineScheduler's
comment named only the R5900 though it also covers the R3000A.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
techwritescode deleted branch ps2-gate-cleanup 2026-10-15 17:12:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ps2/llvm!14
No description provided.