Skip to content

Commit b1b279b

Browse files
committed
fix: probably correct LHBRX instruction
1 parent 8bfdb91 commit b1b279b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

XenonRecomp/recompiler.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,11 +1125,11 @@ bool Recompiler::Recompile(
11251125
break;
11261126

11271127
case PPC_INST_LHBRX:
1128-
// TODO: generated by LLM, check that it works correctly
1129-
print("\t{}.u64 = PPC_LOAD_U16(", r(insn.operands[0])); // Destination register, unsigned 64-bit
1130-
if (insn.operands[1] != 0) // RA register
1128+
// TODO: verify
1129+
print("\t{}.u64 = __builtin_bswap16(PPC_LOAD_U16(", r(insn.operands[0]));
1130+
if (insn.operands[1] != 0)
11311131
print("{}.u32 + ", r(insn.operands[1]));
1132-
println("{}.u32);", r(insn.operands[2])); // RB register
1132+
println("{}.u32));", r(insn.operands[2]));
11331133
break;
11341134

11351135
case PPC_INST_LI:
@@ -1731,7 +1731,7 @@ bool Recompiler::Recompile(
17311731

17321732
case PPC_INST_TWI:
17331733
// no op
1734-
println("__debugbreak();");
1734+
// println("__debugbreak();");
17351735
break;
17361736

17371737
case PPC_INST_TWLGEI:

0 commit comments

Comments
 (0)