Rust tools for PowerPC 750CL
Go to file
Luke Street 0de65eb1b6 Reduce binary size using const arrays
Before, the mnemonic arrays would be generated
on the stack at runtime in each parse function.
This ensures that the arrays  themselves are
treated as const data.
2024-09-26 23:20:49 -06:00
.github/workflows Always build CI on push 2023-01-14 13:27:34 -05:00
asm Add badges to README.md & add documentation keys 2024-09-09 19:28:14 -06:00
disasm Reduce binary size using const arrays 2024-09-26 23:20:49 -06:00
fuzz Use workspace.package fields & update deps 2024-09-09 19:13:44 -06:00
genisa Reduce binary size using const arrays 2024-09-26 23:20:49 -06:00
.gitignore Read from DOL 2021-08-22 04:09:51 +02:00
Cargo.lock Add readme key to Cargo.toml 2024-09-09 19:19:58 -06:00
Cargo.toml Add readme key to Cargo.toml 2024-09-09 19:19:58 -06:00
LICENSE-APACHE Rewrite the entire crate, add assembler 2024-03-14 00:55:08 -06:00
LICENSE-MIT Rewrite the entire crate, add assembler 2024-03-14 00:55:08 -06:00
README.md Add badges to README.md & add documentation keys 2024-09-09 19:28:14 -06:00
isa.yaml Rewrite the entire crate, add assembler 2024-03-14 00:55:08 -06:00
rustfmt.toml Rewrite the entire crate, add assembler 2024-03-14 00:55:08 -06:00

README.md

ppc750cl Build Status Latest Version Api Rustdoc Rust Version

Rust tools for working with the PowerPC 750CL family of processors.

Building

cargo run --package ppc750cl-genisa
cargo build --release

Instruction Set

For those unfamiliar with PowerPC, here are some basics.

  • PowerPC 7xx is a family of RISC CPUs produced from 1997 to 2012.
    • They operate with 32-bit words and every instruction is 32-bits wide.
  • This project focuses (only) on compatibility with the PowerPC 750CL.
    • This chip is famously packaged as codename "Broadway" for the Nintendo Wii.
    • Its predecessor PowerPC 750CXe is used in the Nintendo GameCube.
    • It adds a "paired-singles" SIMD unit and a bunch of other instructions.

isa.yaml

The file isa.yaml contains a full definition of the PowerPC 750CL instruction set.

It powers the disassembler and assembler.

Similarly to LLVM TableGen, the program ppc750cl-genisa generates a Rust file implementing an instruction decoder.

Safety & Correctness

  • This project does not use unsafe Rust code outside of testing utils.
  • The disassembler has been fuzzed over all ~4.29 billion possible instructions (via ppc750cl-fuzz).
  • It is safe to run the disassembler over untrusted byte arrays.
  • However, no guarantees on correctness are made (yet). Expect bugs.

Performance

With a single thread on Ryzen 9 3900X:

  • Disassembling & printing: ~5M insn/s (~20 MB/s)
  • Disassembling only: ~50M insn/s (~200 MB/s)