Skip to content

Commit

Permalink
arm64: mask value operand when calling a write mem handler
Browse files Browse the repository at this point in the history
AppleClang doesn't mask the operand in the callee. This must be done in
the dynarec.
See 6115a91
Tentative fix for barcode reader not working on macOS/arm
  • Loading branch information
flyinghead committed Nov 7, 2024
1 parent f892630 commit e03e11b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/rec-ARM64/rec_arm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,10 +1109,12 @@ class Arm64Assembler : public MacroAssembler
switch (size)
{
case 1:
Uxtb(w1, w1);
GenCallRuntime(addrspace::write8);
break;

case 2:
Uxth(w1, w1);
GenCallRuntime(addrspace::write16);
break;

Expand Down Expand Up @@ -1977,6 +1979,10 @@ class Arm64Assembler : public MacroAssembler
}
else
{
if (op.size == 1)
Uxtb(w1, w1);
else if (op.size == 2)
Uxth(w1, w1);
GenCallRuntime((void (*)())ptr);
}
}
Expand Down

0 comments on commit e03e11b

Please sign in to comment.