Skip to content

Commit 293378b

Browse files
authored
Merge pull request jserv#62 from lecopzer/master
Fix incorrect usage of modulo ABI
2 parents 9bfc428 + 770e4c9 commit 293378b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

amacc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,10 @@ int *codegen(int *jitmem, int *jitmap)
14071407
if (!imm0) imm0 = je;
14081408
*il++ = (int) je++ + 1;
14091409
*iv++ = tmp;
1410+
// ARM EABI modulo helper function produces quotient in r0
1411+
// and the remainder in r1.
1412+
if (i == MOD)
1413+
*je++ = 0xe1a00001; // mov r0, r1
14101414
break;
14111415
case CLCA:
14121416
*je++ = 0xe59d0004; *je++ = 0xe59d1000; // ldr r0, [sp, #4]

0 commit comments

Comments
 (0)