Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cherry-pick] [MIPS] Initial support for MIPS-I load delay slots #135

Merged
merged 1 commit into from
Apr 22, 2022
Merged

[cherry-pick] [MIPS] Initial support for MIPS-I load delay slots #135

merged 1 commit into from
Apr 22, 2022

Conversation

ayrtonm
Copy link

@ayrtonm ayrtonm commented Apr 15, 2022

There's been interest in adding a target for the Sony PlayStation 1 so this cherry picks the commit adding initial support for MIPS-I since LLVM was previously generating incorrect code. Both the github issue and LLVM review in the original commit message below list remaining tasks for MIPS-I support, but load delay slots were the main issue for the PS1.

LLVM so far has only supported the MIPS-II and above architectures. MIPS-II is pretty close to MIPS-I, the major difference
being that "load" instructions always take one extra instruction slot to propogate to registers. This patch adds support for
MIPS-I by adding hazard handling for load delay slots, alongside MIPSR6 forbidden slots and FPU slots, inserting a NOP
instruction between a load and any instruction immediately following that reads the load's destination register. I also
included a simple regression test. Since no existing tests target MIPS-I, those all still pass.

Issue ref: simias/psx-sdk-rs#1

I also tested by building a simple demo app with Clang and running it in an emulator.

Patch by: @impiaaa

Differential Revision: https://reviews.llvm.org/D122427

LLVM so far has only supported the MIPS-II and above architectures. MIPS-II is pretty close to MIPS-I, the major difference
being that "load" instructions always take one extra instruction slot to propogate to registers. This patch adds support for
MIPS-I by adding hazard handling for load delay slots, alongside MIPSR6 forbidden slots and FPU slots, inserting a NOP
instruction between a load and any instruction immediately following that reads the load's destination register. I also
included a simple regression test. Since no existing tests target MIPS-I, those all still pass.

Issue ref: simias/psx-sdk-rs#1

I also tested by building a simple demo app with Clang and running it in an emulator.

Patch by: @impiaaa

Differential Revision: https://reviews.llvm.org/D122427
@nikic nikic merged commit 161fd6b into rust-lang:rustc/14.0-2022-03-22 Apr 22, 2022
vext01 pushed a commit to vext01/llvm-project that referenced this pull request Apr 22, 2024
Send the function index for local variable operands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants