diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc index 9e0f58fd..16af1f29 100644 --- a/src/vm_x64.dasc +++ b/src/vm_x64.dasc @@ -1411,17 +1411,15 @@ static void build_subroutines(BuildCtx *ctx) | checkint RA, ->fff_fallback |.else | checknumtp [BASE+8], ->fff_fallback - | movsd xmm0, qword [BASE+8] + | cvttsd2si RAd, qword [BASE+8] |.endif | mov PC, [BASE-8] - |.if DUALNUM | add RAd, 1 + |.if DUALNUM | setint ITYPE, RA | mov [BASE-16], ITYPE |.else - | sseconst_1 xmm1, TMPR - | addsd xmm0, xmm1 - | cvttsd2si RAd, xmm0 + | cvtsi2sd xmm0, RAd | movsd qword [BASE-16], xmm0 |.endif | cmp RAd, TAB:RB->asize; jae >2 // Not in array part? diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index 7e3d68a0..2c938656 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc @@ -1730,10 +1730,9 @@ static void build_subroutines(BuildCtx *ctx) | mov dword [BASE-4], LJ_TISNUM | mov dword [BASE-8], RD |.else - | movsd xmm0, qword [BASE+8] - | sseconst_1 xmm1, RBa - | addsd xmm0, xmm1 - | cvttsd2si RD, xmm0 + | cvttsd2si RD, qword [BASE+8] + | add RD, 1 + | cvtsi2sd xmm0, RD | movsd qword [BASE-8], xmm0 |.endif | mov TAB:RB, [BASE]