[Mips] Define __mips as 1 for the R3000A #21

Merged
techwritescode merged 1 commit from r3000a-mips1-predefines into r5900-ee 2026-10-16 04:55:54 +00:00

On the o32 ABI, -mcpu=r3000a predefined __mips as 32 and _MIPS_ISA as _MIPS_ISA_MIPS32. newlib memcpy.S and memset.S gate prefetching on __mips, so IOP builds with LLVM emitted pref (60 instructions in sdk-core sysclib), which the R3000A does not implement. GCC defines __mips as 1 here.

r3000a now defines __mips=1 and _MIPS_ISA_MIPS1. Other CPUs are unchanged; checked r3000a, mips32 and r5900 with a local clang build. Adds clang/test/Preprocessor/mips-r3000a-predefines.c (not run through lit).

Found while working on PS2-193.

🤖 Generated with Claude Code

On the o32 ABI, -mcpu=r3000a predefined __mips as 32 and _MIPS_ISA as _MIPS_ISA_MIPS32. newlib memcpy.S and memset.S gate prefetching on __mips, so IOP builds with LLVM emitted pref (60 instructions in sdk-core sysclib), which the R3000A does not implement. GCC defines __mips as 1 here. r3000a now defines __mips=1 and _MIPS_ISA_MIPS1. Other CPUs are unchanged; checked r3000a, mips32 and r5900 with a local clang build. Adds clang/test/Preprocessor/mips-r3000a-predefines.c (not run through lit). Found while working on PS2-193. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
[Mips] Define __mips as 1 for the R3000A
Some checks failed
action.yml / [Mips] Define __mips as 1 for the R3000A (push) Failing after 0s
release-binaries-all.yml / [Mips] Define __mips as 1 for the R3000A (push) Failing after 0s
release-binaries.yml / [Mips] Define __mips as 1 for the R3000A (push) Failing after 0s
release-documentation.yml / [Mips] Define __mips as 1 for the R3000A (push) Failing after 0s
release-sources.yml / [Mips] Define __mips as 1 for the R3000A (push) Failing after 0s
Check for private emails used in PRs / validate_email (pull_request) Has been skipped
action.yml / [Mips] Define __mips as 1 for the R3000A (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] Define __mips as 1 for the R3000A (pull_request) Failing after 0s
release-binaries.yml / [Mips] Define __mips as 1 for the R3000A (pull_request) Failing after 0s
release-documentation.yml / [Mips] Define __mips as 1 for the R3000A (pull_request) Failing after 0s
release-sources.yml / [Mips] Define __mips as 1 for the R3000A (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
a00cdac55d
-mcpu=r3000a on the o32 ABI predefined __mips as 32 and _MIPS_ISA as
_MIPS_ISA_MIPS32, so sources that gate on __mips (newlib's memcpy.S and
memset.S) took their MIPS32 prefetch path and emitted pref, which the
R3000A does not implement. Define MIPS1 for r3000a instead, matching GCC.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
techwritescode deleted branch r3000a-mips1-predefines 2026-10-16 04:55:59 +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!21
No description provided.