-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Decompollaborate/develop
1.6.0
- Loading branch information
Showing
22 changed files
with
162 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
src/instructions/RabbitizerInstruction/instrOpercandCallbacks_array.table.h linguist-generated=true | ||
|
||
src/instructions/InstrCategory_Names_array.table.h linguist-generated=true | ||
src/instructions/InstrDescriptor_Descriptors_array.table.h linguist-generated=true | ||
src/instructions/InstrId_Names_array.table.h linguist-generated=true | ||
src/instructions/RegisterDescriptor_Descriptors_arrays.table.h linguist-generated=true | ||
src/instructions/Registers_Names_arrays.table.h linguist-generated=true | ||
|
||
include/common/Abi_enum.table.h linguist-generated=true | ||
|
||
include/instructions/AccessType_enum.table.h linguist-generated=true | ||
include/instructions/InstrCategory_enum.table.h linguist-generated=true | ||
include/instructions/InstrId_enum.table.h linguist-generated=true | ||
include/instructions/InstrSuffix_enum.table.h linguist-generated=true | ||
include/instructions/OperandType_enum.table.h linguist-generated=true | ||
include/instructions/OperandType_function_declarations.table.h linguist-generated=true | ||
include/instructions/Registers_enums.table.h linguist-generated=true | ||
|
||
cplusplus/include/instructions/AccessType_enum_class.table.h linguist-generated=true | ||
cplusplus/include/instructions/OperandType_enum_class.table.h linguist-generated=true | ||
cplusplus/include/instructions/Registers_enum_classes.table.h linguist-generated=true | ||
cplusplus/include/instructions/UniqueId_enum_class.table.h linguist-generated=true | ||
|
||
rust/src/abi_enum.rs linguist-generated=true | ||
rust/src/access_type_enum.rs linguist-generated=true | ||
rust/src/instr_category_enum.rs linguist-generated=true | ||
rust/src/instr_id_enum.rs linguist-generated=true | ||
rust/src/instr_suffix_enum.rs linguist-generated=true | ||
rust/src/operand_type_enum.rs linguist-generated=true | ||
rust/src/registers_enum.rs linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
[package] | ||
name = "rabbitizer" | ||
# Version should be synced with include/common/RabbitizerVersion.h | ||
version = "1.5.11" | ||
version = "1.6.0" | ||
edition = "2021" | ||
authors = ["Anghelo Carvajal <[email protected]>"] | ||
description = "MIPS instruction decoder" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.set noreorder | ||
|
||
.section .text | ||
|
||
.global test | ||
trunc.w.s $f0, $f12 | ||
jr $31 | ||
nop | ||
|
||
.global test2 | ||
cvt.w.s $f0, $f12 | ||
jr $31 | ||
nop | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* SPDX-FileCopyrightText: © 2023 Decompollaborate */ | ||
/* SPDX-License-Identifier: MIT */ | ||
|
||
#include "rabbitizer.h" | ||
|
||
#include <string.h> | ||
#include <stdlib.h> | ||
#include <assert.h> | ||
|
||
|
||
typedef struct TestEntry { | ||
uint32_t word; | ||
bool gnuMode; | ||
const char *expectedStr; | ||
} TestEntry; | ||
|
||
|
||
const TestEntry entries[] = { | ||
{ 0x4600600D, true, ".word 0x4600600D # trunc.w.s $f0, $f12 # 00000000" }, | ||
{ 0x46006024, true, ".word 0x46006024 # cvt.w.s $f0, $f12 # 00000000" }, | ||
{ 0x4600600D, false, "trunc.w.s $f0, $f12" }, | ||
{ 0x46006024, false, "cvt.w.s $f0, $f12" }, | ||
}; | ||
|
||
int main() { | ||
int errorCount = 0; | ||
size_t i; | ||
|
||
for (i = 0; i < ARRAY_COUNT(entries); i++) { | ||
const TestEntry *entry = &entries[i]; | ||
RabbitizerConfig_Cfg.toolchainTweaks.gnuMode = entry->gnuMode; | ||
RabbitizerInstruction instr; | ||
char *buffer; | ||
size_t bufferSize; | ||
|
||
RabbitizerInstructionR5900_init(&instr, entry->word, 0x80000000); | ||
RabbitizerInstructionR5900_processUniqueId(&instr); | ||
|
||
bufferSize = RabbitizerInstruction_getSizeForBuffer(&instr, 0, 0); | ||
buffer = malloc(bufferSize + 1); | ||
assert(buffer != NULL); | ||
|
||
RabbitizerInstruction_disassemble(&instr, buffer, NULL, 0, 0); | ||
|
||
if (entry->expectedStr == NULL) { | ||
printf("Word '0x%08X' gnuMode '%s' doesn't have a expected str, got '%s'\n", entry->word, entry->gnuMode ? "true" : "false", buffer); | ||
errorCount++; | ||
} else if (strcmp(buffer, entry->expectedStr) != 0) { | ||
fprintf(stderr, "Error on word '0x%08X' gnuMode '%s'. Expected '%s', got '%s'\n", entry->word, entry->gnuMode ? "true" : "false", entry->expectedStr, buffer); | ||
errorCount++; | ||
} | ||
|
||
free(buffer); | ||
RabbitizerInstructionR5900_destroy(&instr); | ||
} | ||
|
||
return errorCount; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# SPDX-FileCopyrightText: © 2022 Decompollaborate | ||
# SPDX-FileCopyrightText: © 2022-2023 Decompollaborate | ||
# SPDX-License-Identifier: MIT | ||
|
||
set -e | ||
|
||
./build/tests/c/instruction_checks/jalr.elf | ||
./build/tests/c/instruction_checks/plain_disassembly.elf | ||
./build/tests/c/instruction_checks/r5900_trunc_cvt.elf |