[Mips] Add the MIPS I/II rfe instruction #5

Merged
techwritescode merged 1 commit from ps2-mips1-rfe into r5900-ee 2026-10-12 22:30:21 +00:00

PS2-176. rfe (COP0 function 0x10, encoding 0x42000010) is the R3000's return from exception. The IOP is an R3000A and ioptrap uses it; LLVM's assembler reported "unknown instruction".

  • Valid for MIPS I and II only (ISA_MIPS1_MIPS2); rejected for MIPS32 and later, MIPS III and later, and the R5900 (they use eret).
  • The encoding equals the virtualization ASE's tlbgp, so rfe has its own decoder namespace (MipsRfe) that the disassembler tries only for MIPS I and II.
  • Scheduling entries next to tlbp in the Generic and P5600 models.

Tests: MC/Mips/mips1/valid.s, the two Disassembler/Mips/mips1 files, and new MC/Mips/rfe-invalid.s. I ran each RUN line by hand with llvm-mc and FileCheck (lit is not built here). Also checked that 0x42000010 disassembles as tlbgp for mips32r5 with virt and as rfe for mips1.

The older note that the three-operand mult1/madd/div1 forms are rejected no longer applies: they assemble with the current r5900-ee.

🤖 Generated with Claude Code

PS2-176. `rfe` (COP0 function 0x10, encoding 0x42000010) is the R3000's return from exception. The IOP is an R3000A and `ioptrap` uses it; LLVM's assembler reported "unknown instruction". - Valid for MIPS I and II only (`ISA_MIPS1_MIPS2`); rejected for MIPS32 and later, MIPS III and later, and the R5900 (they use `eret`). - The encoding equals the virtualization ASE's `tlbgp`, so `rfe` has its own decoder namespace (`MipsRfe`) that the disassembler tries only for MIPS I and II. - Scheduling entries next to `tlbp` in the Generic and P5600 models. Tests: `MC/Mips/mips1/valid.s`, the two `Disassembler/Mips/mips1` files, and new `MC/Mips/rfe-invalid.s`. I ran each RUN line by hand with llvm-mc and FileCheck (lit is not built here). Also checked that `0x42000010` disassembles as `tlbgp` for mips32r5 with virt and as `rfe` for mips1. The older note that the three-operand `mult1/madd/div1` forms are rejected no longer applies: they assemble with the current r5900-ee. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
[Mips] Add the MIPS I/II rfe instruction
Some checks failed
action.yml / [Mips] Add the MIPS I/II rfe instruction (push) Failing after 0s
release-binaries-all.yml / [Mips] Add the MIPS I/II rfe instruction (push) Failing after 0s
release-binaries.yml / [Mips] Add the MIPS I/II rfe instruction (push) Failing after 0s
release-documentation.yml / [Mips] Add the MIPS I/II rfe instruction (push) Failing after 0s
release-sources.yml / [Mips] Add the MIPS I/II rfe instruction (push) Failing after 0s
Check for private emails used in PRs / validate_email (pull_request) Has been skipped
action.yml / [Mips] Add the MIPS I/II rfe instruction (pull_request) Failing after 0s
Check LLVM ABI annotations / Check LLVM_ABI annotations with ids (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 / [Mips] Add the MIPS I/II rfe instruction (pull_request) Failing after 0s
release-binaries.yml / [Mips] Add the MIPS I/II rfe instruction (pull_request) Failing after 0s
release-documentation.yml / [Mips] Add the MIPS I/II rfe instruction (pull_request) Failing after 0s
release-sources.yml / [Mips] Add the MIPS I/II rfe instruction (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
32b95f90b5
rfe (COP0 function 0x10, return from exception) is the R3000's exception
return and was missing from the assembler. It shares its encoding with the
virtualization ASE's tlbgp, so it gets its own decoder namespace, tried by the
disassembler only for MIPS I and II.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
techwritescode deleted branch ps2-mips1-rfe 2026-10-12 22:30:25 +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!5
No description provided.