aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2026-05-25 01:18:53 +0200
committerMike Pall <mike>2026-05-25 01:18:53 +0200
commit64b1f10835acc18bf8923adf248dce4894867882 (patch)
tree91214600c2db89c7021cf878dd52b28e74c87f2f
parent5b2e51db2c5e445cb98e026fc1e290c14eca67c1 (diff)
downloadluajit-64b1f10835acc18bf8923adf248dce4894867882.tar.gz
luajit-64b1f10835acc18bf8923adf248dce4894867882.tar.bz2
luajit-64b1f10835acc18bf8923adf248dce4894867882.zip
x86/x64: Change ipairs_aux to match JIT backend behavior.
Thanks to Sergey Kaplun. #1463
-rw-r--r--src/vm_x64.dasc8
-rw-r--r--src/vm_x86.dasc7
2 files changed, 6 insertions, 9 deletions
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)
1411 | checkint RA, ->fff_fallback 1411 | checkint RA, ->fff_fallback
1412 |.else 1412 |.else
1413 | checknumtp [BASE+8], ->fff_fallback 1413 | checknumtp [BASE+8], ->fff_fallback
1414 | movsd xmm0, qword [BASE+8] 1414 | cvttsd2si RAd, qword [BASE+8]
1415 |.endif 1415 |.endif
1416 | mov PC, [BASE-8] 1416 | mov PC, [BASE-8]
1417 |.if DUALNUM
1418 | add RAd, 1 1417 | add RAd, 1
1418 |.if DUALNUM
1419 | setint ITYPE, RA 1419 | setint ITYPE, RA
1420 | mov [BASE-16], ITYPE 1420 | mov [BASE-16], ITYPE
1421 |.else 1421 |.else
1422 | sseconst_1 xmm1, TMPR 1422 | cvtsi2sd xmm0, RAd
1423 | addsd xmm0, xmm1
1424 | cvttsd2si RAd, xmm0
1425 | movsd qword [BASE-16], xmm0 1423 | movsd qword [BASE-16], xmm0
1426 |.endif 1424 |.endif
1427 | cmp RAd, TAB:RB->asize; jae >2 // Not in array part? 1425 | 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)
1730 | mov dword [BASE-4], LJ_TISNUM 1730 | mov dword [BASE-4], LJ_TISNUM
1731 | mov dword [BASE-8], RD 1731 | mov dword [BASE-8], RD
1732 |.else 1732 |.else
1733 | movsd xmm0, qword [BASE+8] 1733 | cvttsd2si RD, qword [BASE+8]
1734 | sseconst_1 xmm1, RBa 1734 | add RD, 1
1735 | addsd xmm0, xmm1 1735 | cvtsi2sd xmm0, RD
1736 | cvttsd2si RD, xmm0
1737 | movsd qword [BASE-8], xmm0 1736 | movsd qword [BASE-8], xmm0
1738 |.endif 1737 |.endif
1739 | mov TAB:RB, [BASE] 1738 | mov TAB:RB, [BASE]