Skip to content

Commit

Permalink
Merge pull request #61 from Decompollaborate/develop
Browse files Browse the repository at this point in the history
1.10.0
  • Loading branch information
AngheloAlf authored Apr 22, 2024
2 parents e281d46 + 704294b commit adc30b6
Show file tree
Hide file tree
Showing 181 changed files with 44,920 additions and 412 deletions.
231 changes: 220 additions & 11 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,230 @@ on: [push, pull_request]

jobs:
build_repo:
name: Build repo and run tests
name: Build repo
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4
- name: Checkout reposistory
uses: actions/checkout@v4

- name: make
run: make -j $(nproc) WERROR=1
- name: make
run: make -j $(nproc) WERROR=1

- name: Run build info checks
run: ./tests/run_build_info_checks.sh
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: build/

- name: Run logic checks
run: ./tests/run_logic_checks.sh
build_info_checks:
name: Test - build_info_checks
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run build info checks
run: ./tests/run_build_info_checks.sh

logic_checks:
name: Test - logic_checks
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run logic checks
run: ./tests/run_logic_checks.sh

instruction_checks_all:
name: Test - instruction_checks_all
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: test
run: tree build/

- name: Run instruction checks
run: ./tests/run_instruction_checks.sh

instruction_checks_jalr:
name: Test - instruction_checks_jalr
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run instruction check - jalr
run: ./build/tests/c/instruction_checks/jalr.elf

instruction_checks_plain_disassembly:
name: Test - instruction_checks_plain_disassembly
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run instruction check - plain_disassembly
run: ./build/tests/c/instruction_checks/plain_disassembly.elf

instruction_checks_r3000gte_disasm:
name: Test - instruction_checks_r3000gte_disasm
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run instruction check - r3000gte_disasm
run: ./build/tests/c/instruction_checks/r3000gte_disasm.elf

instruction_checks_r4000allegrex_disasm:
name: Test - instruction_checks_r4000allegrex_disasm
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run instruction check - r4000allegrex_disasm
run: ./build/tests/c/instruction_checks/r4000allegrex_disasm.elf

instruction_checks_r4000allegrex_vfpu_disasm:
name: Test - instruction_checks_r4000allegrex_vfpu_disasm
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run instruction check - r4000allegrex_vfpu_disasm
run: ./build/tests/c/instruction_checks/r4000allegrex_vfpu_disasm.elf

instruction_checks_r5900_trunc_cvt:
name: Test - instruction_checks_r5900_trunc_cvt
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run instruction check - r5900_trunc_cvt
run: ./build/tests/c/instruction_checks/r5900_trunc_cvt.elf

instruction_checks_r5900_vcallms:
name: Test - instruction_checks_r5900_vcallms
needs: [build_repo]
runs-on: ubuntu-latest

steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: build/

- name: Make tests executable
run: chmod --recursive +x build/

- name: Run instruction checks
run: ./tests/run_instruction_checks.sh
- name: Run instruction check - r5900_vcallms
run: ./build/tests/c/instruction_checks/r5900_vcallms.elf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,5 @@ Cargo.lock
# Added by cargo

/target

.make_options
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.10.0] - 2024-04-22

### Added

- Add PSP's ALLEGREX instruction set support.
- The global `regNames.r4000AllegrexVfpuControlNamedRegisters` option controls
if named registers should be used for the VFPU control registers of the R4000
ALLEGREX.
- `Utils.floatRepr_32From16` function.
- Converts a half float to a single precision float.
- Both the argument and the return value correspond to their hex
representation instead of an actual float.

### Changed

- Cleanups in tests code.

### Fixed

- Fix typo on C++ bindings.
- The registers getters of the R5900 instruction class was checking for the
wrong operands.

## [1.9.5] - 2024-04-03

### Changed
Expand Down Expand Up @@ -578,6 +601,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- First version

[unreleased]: https://github.com/Decompollaborate/rabbitizer/compare/master...develop
[1.10.0]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.5...1.10.0
[1.9.5]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.4...1.9.5
[1.9.4]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.3...1.9.4
[1.9.3]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.2...1.9.3
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[package]
name = "rabbitizer"
# Version should be synced with include/common/RabbitizerVersion.h
version = "1.9.5"
version = "1.10.0"
edition = "2021"
authors = ["Anghelo Carvajal <[email protected]>"]
description = "MIPS instruction decoder"
Expand Down
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Build options can be changed by modifying the makefile or by building with 'make SETTING=value'.
# It is also possible to override the settings in Defaults in a file called .make_options as 'SETTING=value'.

-include .make_options

DEBUG ?= 0
WERROR ?= 0
ASAN ?= 0
Expand All @@ -24,6 +28,7 @@ WARNINGS += -Werror=unused-parameter -Werror=shadow -Werror=switch -Werro
WARNINGS_C := -Werror=implicit-function-declaration -Werror=incompatible-pointer-types
WARNINGS += -Werror=type-limits
WARNINGS_CXX :=
WARNINGS_ELFS := -Wno-override-init

ifeq ($(CC),gcc)
WARNINGS += -Wno-cast-function-type -Wformat-truncation -Wformat-overflow -Wno-nonnull-compare
Expand Down Expand Up @@ -67,13 +72,13 @@ CXX_FILES := $(foreach dir,$(SRCXX_DIRS),$(wildcard $(dir)/*.cpp))
HXX_FILES := $(foreach dir,$(IINC_XX),$(wildcard $(dir)/**/*.hpp))
OXX_FILES := $(foreach f,$(CXX_FILES:.cpp=.o),build/$f)

DEP_FILES := $(O_FILES:%.o=%.d) $(OXX_FILES:%.o=%.d)

TESTS_DIRS := $(shell find tests -type d)
TESTS_DIRS := $(shell find tests -mindepth 1 -type d -not -path "tests/asm*")
TESTS_C := $(foreach dir,$(TESTS_DIRS),$(wildcard $(dir)/*.c))
TESTS_CXX := $(foreach dir,$(TESTS_DIRS),$(wildcard $(dir)/*.cpp))
TESTS_ELFS := $(foreach f,$(TESTS_C:.c=.elf) $(TESTS_CXX:.cpp=.elf),build/$f)

DEP_FILES := $(O_FILES:%.o=%.d) $(OXX_FILES:%.o=%.d) $(TESTS_ELFS:%.elf=%.d)

STATIC_LIB := build/librabbitizer.a
DYNAMIC_LIB := build/librabbitizer.so

Expand Down Expand Up @@ -132,10 +137,10 @@ tests: $(TESTS_ELFS)
#### Various Recipes ####

build/%.elf: %.c $(STATIC_LIB)
$(CC) -MMD -MP $(CSTD) $(OPTFLAGS) $(IINC) $(WARNINGS) $(WARNINGS_C) $(CFLAGS) -o $@ $< $(LDFLAGS)
$(CC) -MMD -MP $(CSTD) $(OPTFLAGS) $(IINC) $(WARNINGS) $(WARNINGS_C) $(WARNINGS_ELFS) $(CFLAGS) -o $@ $< $(LDFLAGS)

build/%.elf: %.cpp $(STATIC_LIB_XX)
$(CXX) -MMD -MP $(CXXSTD) $(OPTFLAGS) $(IINC_XX) $(WARNINGS) $(WARNINGS_CXX) $(CXXFLAGS) -o $@ $< $(LDXXFLAGS)
$(CXX) -MMD -MP $(CXXSTD) $(OPTFLAGS) $(IINC_XX) $(WARNINGS) $(WARNINGS_CXX) $(WARNINGS_ELFS) $(CXXFLAGS) -o $@ $< $(LDXXFLAGS)

build/%.a:
$(AR) rcs $@ $^
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ MIPS instruction decoder API.
- Main focus on MIPS I, II and III architectures. Partial support for MIPS IV too.
- N64 RSP instruction decoding support.
- RSP decoding has been tested to build back to matching assemblies with [armips](https://github.com/Kingcom/armips/).
- R3000 GTE (PSX's CPU) decoding support.
- R4000 ALLEGREX (PSP's CPU) decoding support.
- R5900 (PS2's Emotion Engine processor) decoding support.

## Non-features
Expand All @@ -63,7 +65,7 @@ If you use a `requirements.txt` file in your repository, then you can add this
library with the following line:

```txt
rabbitizer>=1.9.5,<2.0.0
rabbitizer>=1.10.0,<2.0.0
```

### Development version
Expand All @@ -72,6 +74,13 @@ The unstable development version is located at the
[develop](https://github.com/Decompollaborate/rabbitizer/tree/develop)
branch. PRs should be made into that branch instead of the main one.

Note that building the Python bindings from source require the Python
development package. Under Ubuntu/Debian based distros it can be installed with:

```bash
apt install python3-dev
```

In case you want to mess with the latest development version without wanting to
clone the repository, then you could use the following command:

Expand All @@ -96,7 +105,7 @@ cargo add rabbitizer
Or you can add it manually to your `Cargo.toml`:

```toml
rabbitizer = "1.9.5"
rabbitizer = "1.10.0"
```

See this crate at <https://crates.io/crates/rabbitizer>.
Expand All @@ -118,6 +127,15 @@ See this crate at <https://crates.io/crates/rabbitizer>.
- no$psx documentation: <http://problemkaputt.de/psx-spx.htm#geometrytransformationenginegte>
- <http://www.raphnet.net/electronique/psx_adaptor/Playstation.txt>

- R4000 ALLEGREX:
- ALLEGREX-Instruction_Manual-English <https://github.com/Decompollaborate/rabbitizer/files/11356332/ALLEGREX-Instruction_Manual-English.pdf>
- FPU-Instruction_Manual-English <https://github.com/Decompollaborate/rabbitizer/files/14950191/FPU-Instruction_Manual-English.pdf>
- VFPU-Instruction_Manual-English <https://github.com/Decompollaborate/rabbitizer/files/11356335/VFPU-Instruction_Manual-English.pdf>
- VFPU-Users_Manual-English <https://github.com/Decompollaborate/rabbitizer/files/11356333/VFPU-Users_Manual-English.pdf>
- yet another PlayStationPortable Documentation <http://hitmen.c02.at/files/yapspd/psp_doc/frames.html>
- Chapter "4.8 Allegrex Instructions" <http://hitmen.c02.at/files/yapspd/psp_doc/chap4.html#sec4.8>
- GNU binutils: <https://github.com/bminor/binutils-gdb/compare/011365b...a0176d8>

- R5900:
- EmotionEngine instruction decoding: <https://psi-rockin.github.io/ps2tek/#eeinstructiondecoding>
- Official documentation from Toshiba: <https://wiki.qemu.org/images/2/2a/C790.pdf>
Expand Down
Loading

0 comments on commit adc30b6

Please sign in to comment.