Add $ to special PS2 regs (#41)

* Add $ to special PS2 regs

* Hide it behind gnuMode option

* remove suffix from vclipw

it has a suffixless version and one with .xyz, but it doesn't have one with .xy or .z like Rabbitizer currently emits

* Regenerating tables

---------

Co-authored-by: angie <angheloalf95@gmail.com>
This commit is contained in:
Ethan Roseman 2023-09-13 22:58:25 +09:00 committed by GitHub
parent a3c7c93b2d
commit 0f4691b409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 6 deletions

View File

@ -677,7 +677,7 @@ const RabbitizerInstrDescriptor RabbitizerInstrDescriptor_Descriptors[] = {
[RABBITIZER_INSTR_ID_r5900_vmulaq] = { .operands={RAB_OPERAND_r5900_ACCxyzw, RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_Q}, .instrSuffix=RABINSTRSUFFIX_R5900_xyzw },
[RABBITIZER_INSTR_ID_r5900_vabs] = { .operands={RAB_OPERAND_r5900_vftxyzw, RAB_OPERAND_r5900_vfsxyzw}, .instrSuffix=RABINSTRSUFFIX_R5900_xyzw, .isFloat=true },
[RABBITIZER_INSTR_ID_r5900_vmulai] = { .operands={RAB_OPERAND_r5900_ACCxyzw, RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_I}, .instrSuffix=RABINSTRSUFFIX_R5900_xyzw },
[RABBITIZER_INSTR_ID_r5900_vclipw] = { .operands={RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_vftn}, .instrSuffix=RABINSTRSUFFIX_R5900_xyzw, .isFloat=true },
[RABBITIZER_INSTR_ID_r5900_vclipw] = { .operands={RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_vftn}, .isFloat=true },
[RABBITIZER_INSTR_ID_r5900_vaddaq] = { .operands={RAB_OPERAND_r5900_ACCxyzw, RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_Q}, .instrSuffix=RABINSTRSUFFIX_R5900_xyzw, .isFloat=true },
[RABBITIZER_INSTR_ID_r5900_vmaddaq] = { .operands={RAB_OPERAND_r5900_ACCxyzw, RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_Q}, .instrSuffix=RABINSTRSUFFIX_R5900_xyzw, .isFloat=true },
[RABBITIZER_INSTR_ID_r5900_vaddai] = { .operands={RAB_OPERAND_r5900_ACCxyzw, RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_I}, .instrSuffix=RABINSTRSUFFIX_R5900_xyzw, .isFloat=true },

View File

@ -15,7 +15,11 @@ size_t RabbitizerOperandType_process_r5900_I(UNUSED const RabbitizerInstruction
UNUSED const char *immOverride, UNUSED size_t immOverrideLength) {
size_t totalSize = 0;
RABUTILS_BUFFER_CPY(dst, totalSize, "I");
if (RabbitizerConfig_Cfg.toolchainTweaks.gnuMode) {
RABUTILS_BUFFER_CPY(dst, totalSize, "$I");
} else {
RABUTILS_BUFFER_CPY(dst, totalSize, "I");
}
return totalSize;
}
@ -24,7 +28,11 @@ size_t RabbitizerOperandType_process_r5900_Q(UNUSED const RabbitizerInstruction
UNUSED const char *immOverride, UNUSED size_t immOverrideLength) {
size_t totalSize = 0;
RABUTILS_BUFFER_CPY(dst, totalSize, "Q");
if (RabbitizerConfig_Cfg.toolchainTweaks.gnuMode) {
RABUTILS_BUFFER_CPY(dst, totalSize, "$Q");
} else {
RABUTILS_BUFFER_CPY(dst, totalSize, "Q");
}
return totalSize;
}
@ -33,7 +41,11 @@ size_t RabbitizerOperandType_process_r5900_R(UNUSED const RabbitizerInstruction
UNUSED const char *immOverride, UNUSED size_t immOverrideLength) {
size_t totalSize = 0;
RABUTILS_BUFFER_CPY(dst, totalSize, "R");
if (RabbitizerConfig_Cfg.toolchainTweaks.gnuMode) {
RABUTILS_BUFFER_CPY(dst, totalSize, "$R");
} else {
RABUTILS_BUFFER_CPY(dst, totalSize, "R");
}
return totalSize;
}
@ -42,7 +54,11 @@ size_t RabbitizerOperandType_process_r5900_ACC(UNUSED const RabbitizerInstructio
UNUSED const char *immOverride, UNUSED size_t immOverrideLength) {
size_t totalSize = 0;
RABUTILS_BUFFER_CPY(dst, totalSize, "ACC");
if (RabbitizerConfig_Cfg.toolchainTweaks.gnuMode) {
RABUTILS_BUFFER_CPY(dst, totalSize, "$ACC");
} else {
RABUTILS_BUFFER_CPY(dst, totalSize, "ACC");
}
return totalSize;
}

View File

@ -216,7 +216,6 @@ Note: opcode is flo | (
RABBITIZER_DEF_INSTR_ID(
r5900, 0x1F, vclipw,
.operands={RAB_OPERAND_r5900_vfsxyzw, RAB_OPERAND_r5900_vftn},
.instrSuffix=RABINSTRSUFFIX_R5900_xyzw,
.isFloat=true
) // Clip