From 64b1f10835acc18bf8923adf248dce4894867882 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 25 May 2026 01:18:53 +0200 Subject: x86/x64: Change ipairs_aux to match JIT backend behavior. Thanks to Sergey Kaplun. #1463 --- src/vm_x64.dasc | 8 +++----- src/vm_x86.dasc | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc index 9e0f58fd3..16af1f299 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 7e3d68a00..2c9386562 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] -- cgit v1.2.3-55-g6feb