Skip to content

Commit

Permalink
Merge pull request #57 from Decompollaborate/develop
Browse files Browse the repository at this point in the history
1.9.3
  • Loading branch information
AngheloAlf authored Mar 17, 2024
2 parents 078574d + 7b35aa7 commit fce67c9
Show file tree
Hide file tree
Showing 30 changed files with 102 additions and 20 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.9.3] - 2024-03-17

### Fixed

- Fix the disassembly of `pref`.
- Fix typo on `c.seq.d`.
- Was typed as `c.deq.d`.

## [1.9.2] - 2024-03-10

### Fixed
Expand Down Expand Up @@ -554,6 +562,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.9.3]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.2...1.9.3
[1.9.2]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.1...1.9.2
[1.9.1]: https://github.com/Decompollaborate/rabbitizer/compare/1.9.0...1.9.1
[1.9.0]: https://github.com/Decompollaborate/rabbitizer/compare/1.8.3...1.9.0
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.2"
version = "1.9.3"
edition = "2021"
authors = ["Anghelo Carvajal <[email protected]>"]
description = "MIPS instruction decoder"
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ dynamic: $(DYNAMIC_LIB) $(DYNAMIC_LIB_XX)
tables:
make -C tables

cleantables:
make -C tables distclean

clean:
$(RM) -rf build

Expand All @@ -121,7 +124,7 @@ tidy:

tests: $(TESTS_ELFS)

.PHONY: all static dynamic tables clean distclean format tidy tests
.PHONY: all static dynamic tables cleantables clean distclean format tidy tests
.DEFAULT_GOAL := all
.SECONDARY:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ cargo add rabbitizer
Or you can add it manually to your `Cargo.toml`:

```toml
rabbitizer = "1.9.2"
rabbitizer = "1.9.3"
```

See this crate at <https://crates.io/crates/rabbitizer>.
Expand Down
2 changes: 2 additions & 0 deletions cplusplus/include/generated/OperandType_enum_class.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cplusplus/include/generated/UniqueId_enum_class.hpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion include/common/RabbitizerVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extern "C" {
// Header version
#define RAB_VERSION_MAJOR 1
#define RAB_VERSION_MINOR 9
#define RAB_VERSION_PATCH 2
#define RAB_VERSION_PATCH 3

#define RAB_VERSION_STR RAB_STRINGIFY(RAB_VERSION_MAJOR) "." RAB_STRINGIFY(RAB_VERSION_MINOR) "." RAB_STRINGIFY(RAB_VERSION_PATCH)

Expand Down
6 changes: 3 additions & 3 deletions include/generated/InstrDescriptor_Descriptors_array.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion include/generated/InstrId_Names_array.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion include/generated/InstrId_enum.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions include/generated/OperandType_enum.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions include/generated/OperandType_function_declarations.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions include/generated/instrOpercandCallbacks_array.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions include/instructions/RabbitizerInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ typedef struct RabbitizerInstruction {
#define RAB_INSTR_GET_cop1cs(self) (SHIFTR((self)->word, 11, 5))

#define RAB_INSTR_GET_op(self) (SHIFTR((self)->word, 16, 5))
#define RAB_INSTR_GET_hint(self) (SHIFTR((self)->word, 16, 5))

#define RAB_INSTR_GET_code(self) (SHIFTR((self)->word, 6, 20))
#define RAB_INSTR_GET_code_upper(self) (SHIFTR((self)->word, 16, 10))
Expand Down Expand Up @@ -134,6 +135,7 @@ typedef struct RabbitizerInstruction {
#define RAB_INSTR_PACK_cop1cs(word, value) (BITREPACK((word), (value), 11, 5))

#define RAB_INSTR_PACK_op(word, value) (BITREPACK((word), (value), 16, 5))
#define RAB_INSTR_PACK_hint(word, value) (BITREPACK((word), (value), 16, 5))

#define RAB_INSTR_PACK_cop2t(word, value) (BITREPACK((word), (value), 16, 5))
#define RAB_INSTR_PACK_cop2cd(word, value) (BITREPACK((word), value, 11, 5))
Expand Down
4 changes: 4 additions & 0 deletions include/instructions/RabbitizerInstructionRsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extern "C" {
#define RAB_INSTR_RSP_GET_vt(self) (SHIFTR((self)->word, 16, 5))
#define RAB_INSTR_RSP_GET_vd(self) (SHIFTR((self)->word, 6, 5))

#define RAB_INSTR_RSP_GET_hint(self) (SHIFTR((self)->word, 16, 5))

#define RAB_INSTR_RSP_GET_elementhigh(self) (SHIFTR((self)->word, 21, 4))
#define RAB_INSTR_RSP_GET_elementlow(self) (SHIFTR((self)->word, 7, 4))
#define RAB_INSTR_RSP_GET_OFFSET_VECTOR_RAW(self) (SHIFTR((self)->word, 0, 7))
Expand All @@ -34,6 +36,8 @@ extern "C" {
#define RAB_INSTR_RSP_PACK_vt(word, value) (BITREPACK((word), value, 16, 5))
#define RAB_INSTR_RSP_PACK_vd(word, value) (BITREPACK((word), value, 6, 5))

#define RAB_INSTR_RSP_PACK_hint(word, value) (BITREPACK((word), (value), 16, 5))

#define RAB_INSTR_RSP_PACK_elementhigh(word, value) (BITREPACK((word), value, 21, 4))
#define RAB_INSTR_RSP_PACK_elementlow(word, value) (BITREPACK((word), value, 7, 4))

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[project]
name = "rabbitizer"
# Version should be synced with include/common/RabbitizerVersion.h
version = "1.9.2"
version = "1.9.3"
description = "MIPS instruction decoder"
# license = "MIT"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion rabbitizer/InstrId.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rabbitizer/OperandType.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/src/instr_id_enum.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rust/src/operand_type_enum.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/instructions/RabbitizerInstrDescriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ bool RabbitizerInstrDescriptor_hasOperandAlias(const RabbitizerInstrDescriptor *
case RAB_OPERAND_cpu_cop2t:
case RAB_OPERAND_cpu_cop2cd:
case RAB_OPERAND_cpu_op:
case RAB_OPERAND_cpu_hint:
break;

case RAB_OPERAND_cpu_code:
Expand Down Expand Up @@ -173,6 +174,9 @@ bool RabbitizerInstrDescriptor_hasOperandAlias(const RabbitizerInstrDescriptor *
case RAB_OPERAND_rsp_cop2cd:
break;

case RAB_OPERAND_rsp_hint:
break;

// case RAB_OPERAND_rsp_elementhigh:
// case RAB_OPERAND_rsp_elementlow:
// case RAB_OPERAND_rsp_index:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ void RabbitizerInstruction_blankOut(RabbitizerInstruction *self) {
self->word = RAB_INSTR_PACK_op(self->word, 0);
break;

case RAB_OPERAND_cpu_hint:
self->word = RAB_INSTR_PACK_hint(self->word, 0);
break;

case RAB_OPERAND_cpu_code:
self->word = RAB_INSTR_PACK_code(self->word, 0);
break;
Expand Down Expand Up @@ -277,6 +281,10 @@ void RabbitizerInstruction_blankOut(RabbitizerInstruction *self) {
self->word = RAB_INSTR_RSP_PACK_cop2cd(self->word, 0);
break;

case RAB_OPERAND_rsp_hint:
self->word = RAB_INSTR_RSP_PACK_hint(self->word, 0);
break;

case RAB_OPERAND_rsp_vs:
self->word = RAB_INSTR_RSP_PACK_vs(self->word, 0);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ uint32_t RabbitizerInstruction_getValidBits(const RabbitizerInstruction *self) {
validbits = RAB_INSTR_PACK_op(validbits, ~0);
break;

case RAB_OPERAND_cpu_hint:
validbits = RAB_INSTR_PACK_hint(validbits, ~0);
break;

case RAB_OPERAND_cpu_code:
validbits = RAB_INSTR_PACK_code(validbits, ~0);
break;
Expand Down Expand Up @@ -323,6 +327,10 @@ uint32_t RabbitizerInstruction_getValidBits(const RabbitizerInstruction *self) {
validbits = RAB_INSTR_RSP_PACK_cop2cd(validbits, ~0);
break;

case RAB_OPERAND_rsp_hint:
validbits = RAB_INSTR_RSP_PACK_hint(validbits, ~0);
break;

case RAB_OPERAND_rsp_vs:
validbits = RAB_INSTR_RSP_PACK_vs(validbits, ~0);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@ size_t RabbitizerOperandType_process_cpu_op(const RabbitizerInstruction *self, c
return totalSize;
}

size_t RabbitizerOperandType_process_cpu_hint(const RabbitizerInstruction *self, char *dst,
UNUSED const char *immOverride, UNUSED size_t immOverrideLength) {
size_t totalSize = 0;

// TODO: consider making this a proper configuration
#if 0
if (RAB_INSTR_GET_hint(self) < 10) {
RABUTILS_BUFFER_SPRINTF(dst, totalSize, "%i", RAB_INSTR_GET_hint(self));
} else {
RABUTILS_BUFFER_SPRINTF(dst, totalSize, "0x%x", RAB_INSTR_GET_hint(self));
}
#endif
RABUTILS_BUFFER_SPRINTF(dst, totalSize, "0x%02X", RAB_INSTR_GET_hint(self));
return totalSize;
}

size_t RabbitizerOperandType_process_cpu_code(const RabbitizerInstruction *self, char *dst,
UNUSED const char *immOverride, UNUSED size_t immOverrideLength) {
size_t totalSize = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ size_t RabbitizerOperandType_process_rsp_vd(const RabbitizerInstruction *self, c
return totalSize;
}

size_t RabbitizerOperandType_process_rsp_hint(const RabbitizerInstruction *self, char *dst,
UNUSED const char *immOverride, UNUSED size_t immOverrideLength) {
size_t totalSize = 0;

// TODO: consider making this a proper configuration
#if 0
if (RAB_INSTR_RSP_GET_hint(self) < 10) {
RABUTILS_BUFFER_SPRINTF(dst, totalSize, "%i", RAB_INSTR_RSP_GET_hint(self));
} else {
RABUTILS_BUFFER_SPRINTF(dst, totalSize, "0x%x", RAB_INSTR_RSP_GET_hint(self));
}
#endif
RABUTILS_BUFFER_SPRINTF(dst, totalSize, "0x%02X", RAB_INSTR_RSP_GET_hint(self));
return totalSize;
}

size_t RabbitizerOperandType_process_rsp_vt_elementhigh(const RabbitizerInstruction *self, char *dst,
const char *immOverride, size_t immOverrideLength) {
size_t totalSize = 0;
Expand Down
Loading

0 comments on commit fce67c9

Please sign in to comment.