aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-15 18:04:06 +0100
committerMike Pall <mike>2010-02-15 18:04:06 +0100
commite1905f498a8436434b0c1fba2f68d34376be4cbd (patch)
tree62d5afd62f9b5d76ae9d039640ab2c8d4b72e205 /src
parent3452bfcf8cb2dc67819485c7b011e5c6a59310f8 (diff)
downloadluajit-e1905f498a8436434b0c1fba2f68d34376be4cbd.tar.gz
luajit-e1905f498a8436434b0c1fba2f68d34376be4cbd.tar.bz2
luajit-e1905f498a8436434b0c1fba2f68d34376be4cbd.zip
Use a different marker for hot calls.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_x64.h686
-rw-r--r--src/buildvm_x64win.h790
-rw-r--r--src/buildvm_x86.dasc9
-rw-r--r--src/buildvm_x86.h688
-rw-r--r--src/lj_dispatch.c5
5 files changed, 1097 insertions, 1081 deletions
diff --git a/src/buildvm_x64.h b/src/buildvm_x64.h
index c738eaa4..7632f70b 100644
--- a/src/buildvm_x64.h
+++ b/src/buildvm_x64.h
@@ -12,7 +12,7 @@
12#define DASM_SECTION_CODE_OP 0 12#define DASM_SECTION_CODE_OP 0
13#define DASM_SECTION_CODE_SUB 1 13#define DASM_SECTION_CODE_SUB 1
14#define DASM_MAXSECTION 2 14#define DASM_MAXSECTION 2
15static const unsigned char build_actionlist[13682] = { 15static const unsigned char build_actionlist[13678] = {
16 254,1,248,10,252,247,195,237,15,132,244,11,131,227,252,248,41,218,72,141, 16 254,1,248,10,252,247,195,237,15,132,244,11,131,227,252,248,41,218,72,141,
17 76,25,252,248,139,90,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,4, 17 76,25,252,248,139,90,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,4,
18 252,247,195,237,15,132,244,13,248,14,252,247,195,237,15,132,244,10,65,199, 18 252,247,195,237,15,132,244,13,248,14,252,247,195,237,15,132,244,10,65,199,
@@ -360,53 +360,53 @@ static const unsigned char build_actionlist[13682] = {
360 233,137,222,137,252,239,232,251,1,20,248,3,139,149,233,248,4,15,182,75,252, 360 233,137,222,137,252,239,232,251,1,20,248,3,139,149,233,248,4,15,182,75,252,
361 253,248,5,15,182,107,252,252,15,183,67,252,254,65,252,255,164,253,252,238, 361 253,248,5,15,182,107,252,252,15,183,67,252,254,65,252,255,164,253,252,238,
362 233,248,139,131,195,4,139,77,232,137,76,36,4,252,233,244,4,248,140,255,204, 362 233,248,139,131,195,4,139,77,232,137,76,36,4,252,233,244,4,248,140,255,204,
363 255,248,141,255,73,199,134,233,0,0,0,0,252,233,244,247,255,248,142,255,73, 363 255,248,141,137,92,36,20,255,248,142,255,137,92,36,20,131,203,1,248,1,255,
364 137,174,233,248,1,255,141,68,194,252,248,139,108,36,16,137,149,233,137,133, 364 141,68,194,252,248,139,108,36,16,137,149,233,137,133,233,137,222,137,252,
365 233,137,222,137,252,239,137,92,36,20,232,251,1,21,199,68,36,20,0,0,0,0,139, 365 239,232,251,1,21,199,68,36,20,0,0,0,0,255,131,227,252,254,255,139,149,233,
366 149,233,72,137,193,139,133,233,41,208,72,137,205,15,182,75,252,253,193,232, 366 72,137,193,139,133,233,41,208,72,137,205,15,182,75,252,253,193,232,3,131,
367 3,131,192,1,252,255,229,248,143,255,248,144,255,68,139,122,252,248,69,139, 367 192,1,252,255,229,248,143,255,248,144,255,68,139,122,252,248,69,139,191,233,
368 191,233,69,139,191,233,65,199,134,233,0,0,0,0,65,199,134,233,237,139,3,15, 368 69,139,191,233,65,199,134,233,0,0,0,0,65,199,134,233,237,139,3,15,182,204,
369 182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,255,248,82, 369 15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,255,248,82,255,217,
370 255,217,124,36,4,137,68,36,8,102,184,0,4,102,11,68,36,4,102,37,252,255,252, 370 124,36,4,137,68,36,8,102,184,0,4,102,11,68,36,4,102,37,252,255,252,247,102,
371 247,102,137,68,36,6,217,108,36,6,217,252,252,217,108,36,4,139,68,36,8,195, 371 137,68,36,6,217,108,36,6,217,252,252,217,108,36,4,139,68,36,8,195,255,248,
372 255,248,145,72,184,237,237,102,72,15,110,208,72,184,237,237,102,72,15,110, 372 145,72,184,237,237,102,72,15,110,208,72,184,237,237,102,72,15,110,216,15,
373 216,15,40,200,102,15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,252, 373 40,200,102,15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,252,242,15,
374 242,15,88,203,252,242,15,92,203,102,15,86,202,72,184,237,237,102,72,15,110, 374 88,203,252,242,15,92,203,102,15,86,202,72,184,237,237,102,72,15,110,208,252,
375 208,252,242,15,194,193,1,102,15,84,194,252,242,15,92,200,15,40,193,248,1, 375 242,15,194,193,1,102,15,84,194,252,242,15,92,200,15,40,193,248,1,195,248,
376 195,248,84,255,217,124,36,4,137,68,36,8,102,184,0,8,102,11,68,36,4,102,37, 376 84,255,217,124,36,4,137,68,36,8,102,184,0,8,102,11,68,36,4,102,37,252,255,
377 252,255,252,251,102,137,68,36,6,217,108,36,6,217,252,252,217,108,36,4,139, 377 252,251,102,137,68,36,6,217,108,36,6,217,252,252,217,108,36,4,139,68,36,8,
378 68,36,8,195,255,248,146,72,184,237,237,102,72,15,110,208,72,184,237,237,102, 378 195,255,248,146,72,184,237,237,102,72,15,110,208,72,184,237,237,102,72,15,
379 72,15,110,216,15,40,200,102,15,84,202,102,15,46,217,15,134,244,247,102,15, 379 110,216,15,40,200,102,15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,
380 85,208,252,242,15,88,203,252,242,15,92,203,102,15,86,202,72,184,237,237,102, 380 252,242,15,88,203,252,242,15,92,203,102,15,86,202,72,184,237,237,102,72,15,
381 72,15,110,208,252,242,15,194,193,6,102,15,84,194,252,242,15,92,200,15,40, 381 110,208,252,242,15,194,193,6,102,15,84,194,252,242,15,92,200,15,40,193,248,
382 193,248,1,195,248,104,255,217,124,36,4,137,68,36,8,102,184,0,12,102,11,68, 382 1,195,248,104,255,217,124,36,4,137,68,36,8,102,184,0,12,102,11,68,36,4,102,
383 36,4,102,137,68,36,6,217,108,36,6,217,252,252,217,108,36,4,139,68,36,8,195, 383 137,68,36,6,217,108,36,6,217,252,252,217,108,36,4,139,68,36,8,195,255,248,
384 255,248,147,72,184,237,237,102,72,15,110,208,72,184,237,237,102,72,15,110, 384 147,72,184,237,237,102,72,15,110,208,72,184,237,237,102,72,15,110,216,15,
385 216,15,40,200,102,15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,15, 385 40,200,102,15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,15,40,193,
386 40,193,252,242,15,88,203,252,242,15,92,203,72,184,237,237,102,72,15,110,216, 386 252,242,15,88,203,252,242,15,92,203,72,184,237,237,102,72,15,110,216,252,
387 252,242,15,194,193,1,102,15,84,195,252,242,15,92,200,102,15,86,202,15,40, 387 242,15,194,193,1,102,15,84,195,252,242,15,92,200,102,15,86,202,15,40,193,
388 193,248,1,195,248,148,255,15,40,232,252,242,15,94,193,72,184,237,237,102, 388 248,1,195,248,148,255,15,40,232,252,242,15,94,193,72,184,237,237,102,72,15,
389 72,15,110,208,72,184,237,237,102,72,15,110,216,15,40,224,102,15,84,226,102, 389 110,208,72,184,237,237,102,72,15,110,216,15,40,224,102,15,84,226,102,15,46,
390 15,46,220,15,134,244,247,102,15,85,208,252,242,15,88,227,252,242,15,92,227, 390 220,15,134,244,247,102,15,85,208,252,242,15,88,227,252,242,15,92,227,102,
391 102,15,86,226,72,184,237,237,102,72,15,110,208,252,242,15,194,196,1,102,15, 391 15,86,226,72,184,237,237,102,72,15,110,208,252,242,15,194,196,1,102,15,84,
392 84,194,252,242,15,92,224,15,40,197,252,242,15,89,204,252,242,15,92,193,195, 392 194,252,242,15,92,224,15,40,197,252,242,15,89,204,252,242,15,92,193,195,248,
393 248,1,252,242,15,89,200,15,40,197,252,242,15,92,193,195,255,217,193,216,252, 393 1,252,242,15,89,200,15,40,197,252,242,15,92,193,195,255,217,193,216,252,241,
394 241,217,124,36,4,102,184,0,4,102,11,68,36,4,102,37,252,255,252,247,102,137, 394 217,124,36,4,102,184,0,4,102,11,68,36,4,102,37,252,255,252,247,102,137,68,
395 68,36,6,217,108,36,6,217,252,252,217,108,36,4,222,201,222,252,233,195,255, 395 36,6,217,108,36,6,217,252,252,217,108,36,4,222,201,222,252,233,195,255,248,
396 248,88,217,252,234,222,201,248,149,217,84,36,252,248,129,124,36,252,248,0, 396 88,217,252,234,222,201,248,149,217,84,36,252,248,129,124,36,252,248,0,0,128,
397 0,128,127,15,132,244,247,129,124,36,252,248,0,0,128,252,255,15,132,244,248, 397 127,15,132,244,247,129,124,36,252,248,0,0,128,252,255,15,132,244,248,248,
398 248,150,217,192,217,252,252,220,252,233,217,201,217,252,240,217,232,222,193, 398 150,217,192,217,252,252,220,252,233,217,201,217,252,240,217,232,222,193,217,
399 217,252,253,221,217,248,1,195,248,2,221,216,217,252,238,195,255,248,107,255, 399 252,253,221,217,248,1,195,248,2,221,216,217,252,238,195,255,248,107,255,248,
400 248,151,252,242,15,45,193,252,242,15,42,208,102,15,46,202,15,133,244,254, 400 151,252,242,15,45,193,252,242,15,42,208,102,15,46,202,15,133,244,254,15,138,
401 15,138,244,255,248,152,131,252,248,1,15,142,244,252,248,1,169,1,0,0,0,15, 401 244,255,248,152,131,252,248,1,15,142,244,252,248,1,169,1,0,0,0,15,133,244,
402 133,244,248,252,242,15,89,192,209,232,252,233,244,1,248,2,209,232,15,132, 402 248,252,242,15,89,192,209,232,252,233,244,1,248,2,209,232,15,132,244,251,
403 244,251,15,40,200,248,3,252,242,15,89,192,209,232,15,132,244,250,15,131,244, 403 15,40,200,248,3,252,242,15,89,192,209,232,15,132,244,250,15,131,244,3,255,
404 3,255,252,242,15,89,200,252,233,244,3,248,4,252,242,15,89,193,248,5,195,248, 404 252,242,15,89,200,252,233,244,3,248,4,252,242,15,89,193,248,5,195,248,6,15,
405 6,15,132,244,5,15,130,244,253,80,72,184,237,237,102,72,15,110,200,252,242, 405 132,244,5,15,130,244,253,80,72,184,237,237,102,72,15,110,200,252,242,15,94,
406 15,94,200,88,15,40,193,252,247,216,131,252,248,1,15,132,244,5,252,233,244, 406 200,88,15,40,193,252,247,216,131,252,248,1,15,132,244,5,252,233,244,1,248,
407 1,248,7,72,184,237,237,102,72,15,110,192,195,248,8,102,72,15,126,200,72,209, 407 7,72,184,237,237,102,72,15,110,192,195,248,8,102,72,15,126,200,72,209,224,
408 224,72,193,192,12,72,61,252,254,15,0,0,15,132,244,248,255,102,72,15,126,192, 408 72,193,192,12,72,61,252,254,15,0,0,15,132,244,248,255,102,72,15,126,192,72,
409 72,209,224,15,132,244,250,72,193,192,12,72,61,252,254,15,0,0,15,132,244,251, 409 209,224,15,132,244,250,72,193,192,12,72,61,252,254,15,0,0,15,132,244,251,
410 252,242,15,17,76,36,252,240,252,242,15,17,68,36,252,248,221,68,36,252,240, 410 252,242,15,17,76,36,252,240,252,242,15,17,68,36,252,248,221,68,36,252,240,
411 221,68,36,252,248,217,252,241,217,192,217,252,252,220,252,233,217,201,217, 411 221,68,36,252,248,217,252,241,217,192,217,252,252,220,252,233,217,201,217,
412 252,240,217,232,222,193,217,252,253,221,217,221,92,36,252,248,252,242,15, 412 252,240,217,232,222,193,217,252,253,221,217,221,92,36,252,248,252,242,15,
@@ -1332,77 +1332,81 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
1332#endif 1332#endif
1333 dasm_put(Dst, 7165); 1333 dasm_put(Dst, 7165);
1334#if LJ_HASJIT 1334#if LJ_HASJIT
1335 dasm_put(Dst, 7168, DISPATCH_J(L)); 1335 dasm_put(Dst, 7037);
1336#endif 1336#endif
1337 dasm_put(Dst, 7181); 1337 dasm_put(Dst, 7172);
1338#if LJ_HASJIT 1338#if LJ_HASJIT
1339 dasm_put(Dst, 7184, DISPATCH_J(L)); 1339 dasm_put(Dst, 7175);
1340#endif 1340#endif
1341 dasm_put(Dst, 7191, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 1341 dasm_put(Dst, 7185, Dt1(->base), Dt1(->top));
1342#if LJ_HASJIT
1343 dasm_put(Dst, 7218);
1344#endif
1345 dasm_put(Dst, 7223, Dt1(->base), Dt1(->top));
1342#if LJ_HASJIT 1346#if LJ_HASJIT
1343 dasm_put(Dst, 7163); 1347 dasm_put(Dst, 7163);
1344#endif 1348#endif
1345 dasm_put(Dst, 7258); 1349 dasm_put(Dst, 7254);
1346#if LJ_HASJIT 1350#if LJ_HASJIT
1347 dasm_put(Dst, 7261, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP); 1351 dasm_put(Dst, 7257, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP);
1348#endif 1352#endif
1349 dasm_put(Dst, 7308); 1353 dasm_put(Dst, 7304);
1350 if (!sse) { 1354 if (!sse) {
1351 dasm_put(Dst, 7311); 1355 dasm_put(Dst, 7307);
1352 } 1356 }
1353 dasm_put(Dst, 7356, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1357 dasm_put(Dst, 7352, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1354 if (!sse) { 1358 if (!sse) {
1355 dasm_put(Dst, 7442); 1359 dasm_put(Dst, 7438);
1356 } 1360 }
1357 dasm_put(Dst, 7487, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32)); 1361 dasm_put(Dst, 7483, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32));
1358 if (!sse) { 1362 if (!sse) {
1359 dasm_put(Dst, 7573); 1363 dasm_put(Dst, 7569);
1360 } 1364 }
1361 dasm_put(Dst, 7612, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1365 dasm_put(Dst, 7608, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1362 if (sse) { 1366 if (sse) {
1363 dasm_put(Dst, 7701, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1367 dasm_put(Dst, 7697, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1364 } else { 1368 } else {
1365 dasm_put(Dst, 7815); 1369 dasm_put(Dst, 7811);
1366 } 1370 }
1367 dasm_put(Dst, 7862); 1371 dasm_put(Dst, 7858);
1368 if (!sse) { 1372 if (!sse) {
1369 } else { 1373 } else {
1370 dasm_put(Dst, 7939); 1374 dasm_put(Dst, 7935);
1371 } 1375 }
1372 dasm_put(Dst, 7942); 1376 dasm_put(Dst, 7938);
1373 dasm_put(Dst, 8027, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1377 dasm_put(Dst, 8023, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1374 dasm_put(Dst, 8128, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32)); 1378 dasm_put(Dst, 8124, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32));
1375 dasm_put(Dst, 8302); 1379 dasm_put(Dst, 8298);
1376 if (sse) { 1380 if (sse) {
1377 dasm_put(Dst, 8343); 1381 dasm_put(Dst, 8339);
1378 dasm_put(Dst, 8413); 1382 dasm_put(Dst, 8409);
1379 dasm_put(Dst, 8485); 1383 dasm_put(Dst, 8481);
1380 } else { 1384 } else {
1381 dasm_put(Dst, 8537); 1385 dasm_put(Dst, 8533);
1382 dasm_put(Dst, 8629); 1386 dasm_put(Dst, 8625);
1383 } 1387 }
1384 dasm_put(Dst, 8675); 1388 dasm_put(Dst, 8671);
1385 if (sse) { 1389 if (sse) {
1386 dasm_put(Dst, 8681, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); 1390 dasm_put(Dst, 8677, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32));
1387 dasm_put(Dst, 8766, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32)); 1391 dasm_put(Dst, 8762, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32));
1388 } else { 1392 } else {
1389 dasm_put(Dst, 8894); 1393 dasm_put(Dst, 8890);
1390 dasm_put(Dst, 8977); 1394 dasm_put(Dst, 8973);
1391 if (cmov) { 1395 if (cmov) {
1392 dasm_put(Dst, 9032); 1396 dasm_put(Dst, 9028);
1393 } else { 1397 } else {
1394 dasm_put(Dst, 9051); 1398 dasm_put(Dst, 9047);
1395 } 1399 }
1396 dasm_put(Dst, 8890); 1400 dasm_put(Dst, 8886);
1397 } 1401 }
1398 dasm_put(Dst, 9092); 1402 dasm_put(Dst, 9088);
1399} 1403}
1400 1404
1401/* Generate the code for a single instruction. */ 1405/* Generate the code for a single instruction. */
1402static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) 1406static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1403{ 1407{
1404 int vk = 0; 1408 int vk = 0;
1405 dasm_put(Dst, 9114, defop); 1409 dasm_put(Dst, 9110, defop);
1406 1410
1407 switch (op) { 1411 switch (op) {
1408 1412
@@ -1411,600 +1415,600 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1411 /* Remember: all ops branch for a true comparison, fall through otherwise. */ 1415 /* Remember: all ops branch for a true comparison, fall through otherwise. */
1412 1416
1413 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: 1417 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
1414 dasm_put(Dst, 9116, LJ_TISNUM, LJ_TISNUM); 1418 dasm_put(Dst, 9112, LJ_TISNUM, LJ_TISNUM);
1415 if (sse) { 1419 if (sse) {
1416 dasm_put(Dst, 9137); 1420 dasm_put(Dst, 9133);
1417 } else { 1421 } else {
1418 dasm_put(Dst, 9152); 1422 dasm_put(Dst, 9148);
1419 if (cmov) { 1423 if (cmov) {
1420 dasm_put(Dst, 9162); 1424 dasm_put(Dst, 9158);
1421 } else { 1425 } else {
1422 dasm_put(Dst, 9168); 1426 dasm_put(Dst, 9164);
1423 } 1427 }
1424 } 1428 }
1425 switch (op) { 1429 switch (op) {
1426 case BC_ISLT: 1430 case BC_ISLT:
1427 dasm_put(Dst, 9175); 1431 dasm_put(Dst, 9171);
1428 break; 1432 break;
1429 case BC_ISGE: 1433 case BC_ISGE:
1430 dasm_put(Dst, 8972); 1434 dasm_put(Dst, 8968);
1431 break; 1435 break;
1432 case BC_ISLE: 1436 case BC_ISLE:
1433 dasm_put(Dst, 5914); 1437 dasm_put(Dst, 5914);
1434 break; 1438 break;
1435 case BC_ISGT: 1439 case BC_ISGT:
1436 dasm_put(Dst, 9180); 1440 dasm_put(Dst, 9176);
1437 break; 1441 break;
1438 default: break; /* Shut up GCC. */ 1442 default: break; /* Shut up GCC. */
1439 } 1443 }
1440 dasm_put(Dst, 9185, -BCBIAS_J*4); 1444 dasm_put(Dst, 9181, -BCBIAS_J*4);
1441 break; 1445 break;
1442 1446
1443 case BC_ISEQV: case BC_ISNEV: 1447 case BC_ISEQV: case BC_ISNEV:
1444 vk = op == BC_ISEQV; 1448 vk = op == BC_ISEQV;
1445 dasm_put(Dst, 9220, LJ_TISNUM, LJ_TISNUM); 1449 dasm_put(Dst, 9216, LJ_TISNUM, LJ_TISNUM);
1446 if (sse) { 1450 if (sse) {
1447 dasm_put(Dst, 9246); 1451 dasm_put(Dst, 9242);
1448 } else { 1452 } else {
1449 dasm_put(Dst, 9258); 1453 dasm_put(Dst, 9254);
1450 if (cmov) { 1454 if (cmov) {
1451 dasm_put(Dst, 9162); 1455 dasm_put(Dst, 9158);
1452 } else { 1456 } else {
1453 dasm_put(Dst, 9168); 1457 dasm_put(Dst, 9164);
1454 } 1458 }
1455 } 1459 }
1456 iseqne_fp: 1460 iseqne_fp:
1457 if (vk) { 1461 if (vk) {
1458 dasm_put(Dst, 9265); 1462 dasm_put(Dst, 9261);
1459 } else { 1463 } else {
1460 dasm_put(Dst, 9274); 1464 dasm_put(Dst, 9270);
1461 } 1465 }
1462 iseqne_end: 1466 iseqne_end:
1463 if (vk) { 1467 if (vk) {
1464 dasm_put(Dst, 9283, -BCBIAS_J*4); 1468 dasm_put(Dst, 9279, -BCBIAS_J*4);
1465 } else { 1469 } else {
1466 dasm_put(Dst, 9298, -BCBIAS_J*4); 1470 dasm_put(Dst, 9294, -BCBIAS_J*4);
1467 } 1471 }
1468 dasm_put(Dst, 7287); 1472 dasm_put(Dst, 7283);
1469 if (op == BC_ISEQV || op == BC_ISNEV) { 1473 if (op == BC_ISEQV || op == BC_ISNEV) {
1470 dasm_put(Dst, 9313, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); 1474 dasm_put(Dst, 9309, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq);
1471 if (vk) { 1475 if (vk) {
1472 dasm_put(Dst, 9371); 1476 dasm_put(Dst, 9367);
1473 } else { 1477 } else {
1474 dasm_put(Dst, 9375); 1478 dasm_put(Dst, 9371);
1475 } 1479 }
1476 dasm_put(Dst, 9381); 1480 dasm_put(Dst, 9377);
1477 } 1481 }
1478 break; 1482 break;
1479 case BC_ISEQS: case BC_ISNES: 1483 case BC_ISEQS: case BC_ISNES:
1480 vk = op == BC_ISEQS; 1484 vk = op == BC_ISEQS;
1481 dasm_put(Dst, 9386, LJ_TSTR); 1485 dasm_put(Dst, 9382, LJ_TSTR);
1482 iseqne_test: 1486 iseqne_test:
1483 if (vk) { 1487 if (vk) {
1484 dasm_put(Dst, 9269); 1488 dasm_put(Dst, 9265);
1485 } else { 1489 } else {
1486 dasm_put(Dst, 2805); 1490 dasm_put(Dst, 2805);
1487 } 1491 }
1488 goto iseqne_end; 1492 goto iseqne_end;
1489 case BC_ISEQN: case BC_ISNEN: 1493 case BC_ISEQN: case BC_ISNEN:
1490 vk = op == BC_ISEQN; 1494 vk = op == BC_ISEQN;
1491 dasm_put(Dst, 9411, LJ_TISNUM); 1495 dasm_put(Dst, 9407, LJ_TISNUM);
1492 if (sse) { 1496 if (sse) {
1493 dasm_put(Dst, 9425); 1497 dasm_put(Dst, 9421);
1494 } else { 1498 } else {
1495 dasm_put(Dst, 9438); 1499 dasm_put(Dst, 9434);
1496 if (cmov) { 1500 if (cmov) {
1497 dasm_put(Dst, 9162); 1501 dasm_put(Dst, 9158);
1498 } else { 1502 } else {
1499 dasm_put(Dst, 9168); 1503 dasm_put(Dst, 9164);
1500 } 1504 }
1501 } 1505 }
1502 goto iseqne_fp; 1506 goto iseqne_fp;
1503 case BC_ISEQP: case BC_ISNEP: 1507 case BC_ISEQP: case BC_ISNEP:
1504 vk = op == BC_ISEQP; 1508 vk = op == BC_ISEQP;
1505 dasm_put(Dst, 9446); 1509 dasm_put(Dst, 9442);
1506 goto iseqne_test; 1510 goto iseqne_test;
1507 1511
1508 /* -- Unary test and copy ops ------------------------------------------- */ 1512 /* -- Unary test and copy ops ------------------------------------------- */
1509 1513
1510 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: 1514 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
1511 dasm_put(Dst, 9458, LJ_TISTRUECOND); 1515 dasm_put(Dst, 9454, LJ_TISTRUECOND);
1512 if (op == BC_IST || op == BC_ISTC) { 1516 if (op == BC_IST || op == BC_ISTC) {
1513 dasm_put(Dst, 9470); 1517 dasm_put(Dst, 9466);
1514 } else { 1518 } else {
1515 dasm_put(Dst, 9475); 1519 dasm_put(Dst, 9471);
1516 } 1520 }
1517 if (op == BC_ISTC || op == BC_ISFC) { 1521 if (op == BC_ISTC || op == BC_ISFC) {
1518 dasm_put(Dst, 9480); 1522 dasm_put(Dst, 9476);
1519 } 1523 }
1520 dasm_put(Dst, 9491, -BCBIAS_J*4); 1524 dasm_put(Dst, 9487, -BCBIAS_J*4);
1521 break; 1525 break;
1522 1526
1523 /* -- Unary ops --------------------------------------------------------- */ 1527 /* -- Unary ops --------------------------------------------------------- */
1524 1528
1525 case BC_MOV: 1529 case BC_MOV:
1526 dasm_put(Dst, 9524); 1530 dasm_put(Dst, 9520);
1527 break; 1531 break;
1528 case BC_NOT: 1532 case BC_NOT:
1529 dasm_put(Dst, 9559, LJ_TISTRUECOND, LJ_TTRUE); 1533 dasm_put(Dst, 9555, LJ_TISTRUECOND, LJ_TTRUE);
1530 break; 1534 break;
1531 case BC_UNM: 1535 case BC_UNM:
1532 dasm_put(Dst, 9596, LJ_TISNUM); 1536 dasm_put(Dst, 9592, LJ_TISNUM);
1533 if (sse) { 1537 if (sse) {
1534 dasm_put(Dst, 9607, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); 1538 dasm_put(Dst, 9603, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32));
1535 } else { 1539 } else {
1536 dasm_put(Dst, 9632); 1540 dasm_put(Dst, 9628);
1537 } 1541 }
1538 dasm_put(Dst, 7287); 1542 dasm_put(Dst, 7283);
1539 break; 1543 break;
1540 case BC_LEN: 1544 case BC_LEN:
1541 dasm_put(Dst, 9641, LJ_TSTR); 1545 dasm_put(Dst, 9637, LJ_TSTR);
1542 if (sse) { 1546 if (sse) {
1543 dasm_put(Dst, 9655, Dt5(->len)); 1547 dasm_put(Dst, 9651, Dt5(->len));
1544 } else { 1548 } else {
1545 dasm_put(Dst, 9673, Dt5(->len)); 1549 dasm_put(Dst, 9669, Dt5(->len));
1546 } 1550 }
1547 dasm_put(Dst, 9682, LJ_TTAB); 1551 dasm_put(Dst, 9678, LJ_TTAB);
1548 if (sse) { 1552 if (sse) {
1549 dasm_put(Dst, 9724); 1553 dasm_put(Dst, 9720);
1550 } else { 1554 } else {
1551 } 1555 }
1552 dasm_put(Dst, 9733); 1556 dasm_put(Dst, 9729);
1553 break; 1557 break;
1554 1558
1555 /* -- Binary ops -------------------------------------------------------- */ 1559 /* -- Binary ops -------------------------------------------------------- */
1556 1560
1557 1561
1558 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: 1562 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:
1559 dasm_put(Dst, 9743); 1563 dasm_put(Dst, 9739);
1560 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1564 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1561 switch (vk) { 1565 switch (vk) {
1562 case 0: 1566 case 0:
1563 dasm_put(Dst, 9751, LJ_TISNUM); 1567 dasm_put(Dst, 9747, LJ_TISNUM);
1564 if (sse) { 1568 if (sse) {
1565 dasm_put(Dst, 9763); 1569 dasm_put(Dst, 9759);
1566 } else { 1570 } else {
1567 dasm_put(Dst, 9778); 1571 dasm_put(Dst, 9774);
1568 } 1572 }
1569 break; 1573 break;
1570 case 1: 1574 case 1:
1571 dasm_put(Dst, 9787, LJ_TISNUM); 1575 dasm_put(Dst, 9783, LJ_TISNUM);
1572 if (sse) { 1576 if (sse) {
1573 dasm_put(Dst, 9799); 1577 dasm_put(Dst, 9795);
1574 } else { 1578 } else {
1575 dasm_put(Dst, 9814); 1579 dasm_put(Dst, 9810);
1576 } 1580 }
1577 break; 1581 break;
1578 default: 1582 default:
1579 dasm_put(Dst, 9823, LJ_TISNUM, LJ_TISNUM); 1583 dasm_put(Dst, 9819, LJ_TISNUM, LJ_TISNUM);
1580 if (sse) { 1584 if (sse) {
1581 dasm_put(Dst, 9845); 1585 dasm_put(Dst, 9841);
1582 } else { 1586 } else {
1583 dasm_put(Dst, 9859); 1587 dasm_put(Dst, 9855);
1584 } 1588 }
1585 break; 1589 break;
1586 } 1590 }
1587 if (sse) { 1591 if (sse) {
1588 dasm_put(Dst, 9625); 1592 dasm_put(Dst, 9621);
1589 } else { 1593 } else {
1590 dasm_put(Dst, 9637); 1594 dasm_put(Dst, 9633);
1591 } 1595 }
1592 dasm_put(Dst, 7287); 1596 dasm_put(Dst, 7283);
1593 break; 1597 break;
1594 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: 1598 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
1595 dasm_put(Dst, 9743); 1599 dasm_put(Dst, 9739);
1596 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1600 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1597 switch (vk) { 1601 switch (vk) {
1598 case 0: 1602 case 0:
1599 dasm_put(Dst, 9751, LJ_TISNUM); 1603 dasm_put(Dst, 9747, LJ_TISNUM);
1600 if (sse) { 1604 if (sse) {
1601 dasm_put(Dst, 9867); 1605 dasm_put(Dst, 9863);
1602 } else { 1606 } else {
1603 dasm_put(Dst, 9882); 1607 dasm_put(Dst, 9878);
1604 } 1608 }
1605 break; 1609 break;
1606 case 1: 1610 case 1:
1607 dasm_put(Dst, 9787, LJ_TISNUM); 1611 dasm_put(Dst, 9783, LJ_TISNUM);
1608 if (sse) { 1612 if (sse) {
1609 dasm_put(Dst, 9891); 1613 dasm_put(Dst, 9887);
1610 } else { 1614 } else {
1611 dasm_put(Dst, 9906); 1615 dasm_put(Dst, 9902);
1612 } 1616 }
1613 break; 1617 break;
1614 default: 1618 default:
1615 dasm_put(Dst, 9823, LJ_TISNUM, LJ_TISNUM); 1619 dasm_put(Dst, 9819, LJ_TISNUM, LJ_TISNUM);
1616 if (sse) { 1620 if (sse) {
1617 dasm_put(Dst, 9915); 1621 dasm_put(Dst, 9911);
1618 } else { 1622 } else {
1619 dasm_put(Dst, 9929); 1623 dasm_put(Dst, 9925);
1620 } 1624 }
1621 break; 1625 break;
1622 } 1626 }
1623 if (sse) { 1627 if (sse) {
1624 dasm_put(Dst, 9625); 1628 dasm_put(Dst, 9621);
1625 } else { 1629 } else {
1626 dasm_put(Dst, 9637); 1630 dasm_put(Dst, 9633);
1627 } 1631 }
1628 dasm_put(Dst, 7287); 1632 dasm_put(Dst, 7283);
1629 break; 1633 break;
1630 case BC_MULVN: case BC_MULNV: case BC_MULVV: 1634 case BC_MULVN: case BC_MULNV: case BC_MULVV:
1631 dasm_put(Dst, 9743); 1635 dasm_put(Dst, 9739);
1632 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1636 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1633 switch (vk) { 1637 switch (vk) {
1634 case 0: 1638 case 0:
1635 dasm_put(Dst, 9751, LJ_TISNUM); 1639 dasm_put(Dst, 9747, LJ_TISNUM);
1636 if (sse) { 1640 if (sse) {
1637 dasm_put(Dst, 9937); 1641 dasm_put(Dst, 9933);
1638 } else { 1642 } else {
1639 dasm_put(Dst, 9952); 1643 dasm_put(Dst, 9948);
1640 } 1644 }
1641 break; 1645 break;
1642 case 1: 1646 case 1:
1643 dasm_put(Dst, 9787, LJ_TISNUM); 1647 dasm_put(Dst, 9783, LJ_TISNUM);
1644 if (sse) { 1648 if (sse) {
1645 dasm_put(Dst, 9961); 1649 dasm_put(Dst, 9957);
1646 } else { 1650 } else {
1647 dasm_put(Dst, 9976); 1651 dasm_put(Dst, 9972);
1648 } 1652 }
1649 break; 1653 break;
1650 default: 1654 default:
1651 dasm_put(Dst, 9823, LJ_TISNUM, LJ_TISNUM); 1655 dasm_put(Dst, 9819, LJ_TISNUM, LJ_TISNUM);
1652 if (sse) { 1656 if (sse) {
1653 dasm_put(Dst, 9985); 1657 dasm_put(Dst, 9981);
1654 } else { 1658 } else {
1655 dasm_put(Dst, 9999); 1659 dasm_put(Dst, 9995);
1656 } 1660 }
1657 break; 1661 break;
1658 } 1662 }
1659 if (sse) { 1663 if (sse) {
1660 dasm_put(Dst, 9625); 1664 dasm_put(Dst, 9621);
1661 } else { 1665 } else {
1662 dasm_put(Dst, 9637); 1666 dasm_put(Dst, 9633);
1663 } 1667 }
1664 dasm_put(Dst, 7287); 1668 dasm_put(Dst, 7283);
1665 break; 1669 break;
1666 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: 1670 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
1667 dasm_put(Dst, 9743); 1671 dasm_put(Dst, 9739);
1668 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1672 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1669 switch (vk) { 1673 switch (vk) {
1670 case 0: 1674 case 0:
1671 dasm_put(Dst, 9751, LJ_TISNUM); 1675 dasm_put(Dst, 9747, LJ_TISNUM);
1672 if (sse) { 1676 if (sse) {
1673 dasm_put(Dst, 10007); 1677 dasm_put(Dst, 10003);
1674 } else { 1678 } else {
1675 dasm_put(Dst, 10022); 1679 dasm_put(Dst, 10018);
1676 } 1680 }
1677 break; 1681 break;
1678 case 1: 1682 case 1:
1679 dasm_put(Dst, 9787, LJ_TISNUM); 1683 dasm_put(Dst, 9783, LJ_TISNUM);
1680 if (sse) { 1684 if (sse) {
1681 dasm_put(Dst, 10031); 1685 dasm_put(Dst, 10027);
1682 } else { 1686 } else {
1683 dasm_put(Dst, 10046); 1687 dasm_put(Dst, 10042);
1684 } 1688 }
1685 break; 1689 break;
1686 default: 1690 default:
1687 dasm_put(Dst, 9823, LJ_TISNUM, LJ_TISNUM); 1691 dasm_put(Dst, 9819, LJ_TISNUM, LJ_TISNUM);
1688 if (sse) { 1692 if (sse) {
1689 dasm_put(Dst, 10055); 1693 dasm_put(Dst, 10051);
1690 } else { 1694 } else {
1691 dasm_put(Dst, 10069); 1695 dasm_put(Dst, 10065);
1692 } 1696 }
1693 break; 1697 break;
1694 } 1698 }
1695 if (sse) { 1699 if (sse) {
1696 dasm_put(Dst, 9625); 1700 dasm_put(Dst, 9621);
1697 } else { 1701 } else {
1698 dasm_put(Dst, 9637); 1702 dasm_put(Dst, 9633);
1699 } 1703 }
1700 dasm_put(Dst, 7287); 1704 dasm_put(Dst, 7283);
1701 break; 1705 break;
1702 case BC_MODVN: 1706 case BC_MODVN:
1703 dasm_put(Dst, 9743); 1707 dasm_put(Dst, 9739);
1704 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1708 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1705 switch (vk) { 1709 switch (vk) {
1706 case 0: 1710 case 0:
1707 dasm_put(Dst, 9751, LJ_TISNUM); 1711 dasm_put(Dst, 9747, LJ_TISNUM);
1708 if (sse) { 1712 if (sse) {
1709 dasm_put(Dst, 10077); 1713 dasm_put(Dst, 10073);
1710 } else { 1714 } else {
1711 dasm_put(Dst, 10092); 1715 dasm_put(Dst, 10088);
1712 } 1716 }
1713 break; 1717 break;
1714 case 1: 1718 case 1:
1715 dasm_put(Dst, 9787, LJ_TISNUM); 1719 dasm_put(Dst, 9783, LJ_TISNUM);
1716 if (sse) { 1720 if (sse) {
1717 dasm_put(Dst, 10101); 1721 dasm_put(Dst, 10097);
1718 } else { 1722 } else {
1719 dasm_put(Dst, 10116); 1723 dasm_put(Dst, 10112);
1720 } 1724 }
1721 break; 1725 break;
1722 default: 1726 default:
1723 dasm_put(Dst, 9823, LJ_TISNUM, LJ_TISNUM); 1727 dasm_put(Dst, 9819, LJ_TISNUM, LJ_TISNUM);
1724 if (sse) { 1728 if (sse) {
1725 dasm_put(Dst, 10125); 1729 dasm_put(Dst, 10121);
1726 } else { 1730 } else {
1727 dasm_put(Dst, 10139); 1731 dasm_put(Dst, 10135);
1728 } 1732 }
1729 break; 1733 break;
1730 } 1734 }
1731 dasm_put(Dst, 10147); 1735 dasm_put(Dst, 10143);
1732 if (sse) { 1736 if (sse) {
1733 dasm_put(Dst, 9625); 1737 dasm_put(Dst, 9621);
1734 } else { 1738 } else {
1735 dasm_put(Dst, 9637); 1739 dasm_put(Dst, 9633);
1736 } 1740 }
1737 dasm_put(Dst, 7287); 1741 dasm_put(Dst, 7283);
1738 break; 1742 break;
1739 case BC_MODNV: case BC_MODVV: 1743 case BC_MODNV: case BC_MODVV:
1740 dasm_put(Dst, 9743); 1744 dasm_put(Dst, 9739);
1741 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1745 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1742 switch (vk) { 1746 switch (vk) {
1743 case 0: 1747 case 0:
1744 dasm_put(Dst, 9751, LJ_TISNUM); 1748 dasm_put(Dst, 9747, LJ_TISNUM);
1745 if (sse) { 1749 if (sse) {
1746 dasm_put(Dst, 10077); 1750 dasm_put(Dst, 10073);
1747 } else { 1751 } else {
1748 dasm_put(Dst, 10092); 1752 dasm_put(Dst, 10088);
1749 } 1753 }
1750 break; 1754 break;
1751 case 1: 1755 case 1:
1752 dasm_put(Dst, 9787, LJ_TISNUM); 1756 dasm_put(Dst, 9783, LJ_TISNUM);
1753 if (sse) { 1757 if (sse) {
1754 dasm_put(Dst, 10101); 1758 dasm_put(Dst, 10097);
1755 } else { 1759 } else {
1756 dasm_put(Dst, 10116); 1760 dasm_put(Dst, 10112);
1757 } 1761 }
1758 break; 1762 break;
1759 default: 1763 default:
1760 dasm_put(Dst, 9823, LJ_TISNUM, LJ_TISNUM); 1764 dasm_put(Dst, 9819, LJ_TISNUM, LJ_TISNUM);
1761 if (sse) { 1765 if (sse) {
1762 dasm_put(Dst, 10125); 1766 dasm_put(Dst, 10121);
1763 } else { 1767 } else {
1764 dasm_put(Dst, 10139); 1768 dasm_put(Dst, 10135);
1765 } 1769 }
1766 break; 1770 break;
1767 } 1771 }
1768 dasm_put(Dst, 10153); 1772 dasm_put(Dst, 10149);
1769 break; 1773 break;
1770 case BC_POW: 1774 case BC_POW:
1771 dasm_put(Dst, 9743); 1775 dasm_put(Dst, 9739);
1772 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1776 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1773 switch (vk) { 1777 switch (vk) {
1774 case 0: 1778 case 0:
1775 dasm_put(Dst, 9751, LJ_TISNUM); 1779 dasm_put(Dst, 9747, LJ_TISNUM);
1776 if (sse) { 1780 if (sse) {
1777 dasm_put(Dst, 10077); 1781 dasm_put(Dst, 10073);
1778 } else { 1782 } else {
1779 dasm_put(Dst, 10092); 1783 dasm_put(Dst, 10088);
1780 } 1784 }
1781 break; 1785 break;
1782 case 1: 1786 case 1:
1783 dasm_put(Dst, 9787, LJ_TISNUM); 1787 dasm_put(Dst, 9783, LJ_TISNUM);
1784 if (sse) { 1788 if (sse) {
1785 dasm_put(Dst, 10101); 1789 dasm_put(Dst, 10097);
1786 } else { 1790 } else {
1787 dasm_put(Dst, 10116); 1791 dasm_put(Dst, 10112);
1788 } 1792 }
1789 break; 1793 break;
1790 default: 1794 default:
1791 dasm_put(Dst, 9823, LJ_TISNUM, LJ_TISNUM); 1795 dasm_put(Dst, 9819, LJ_TISNUM, LJ_TISNUM);
1792 if (sse) { 1796 if (sse) {
1793 dasm_put(Dst, 10125); 1797 dasm_put(Dst, 10121);
1794 } else { 1798 } else {
1795 dasm_put(Dst, 10139); 1799 dasm_put(Dst, 10135);
1796 } 1800 }
1797 break; 1801 break;
1798 } 1802 }
1799 dasm_put(Dst, 10158); 1803 dasm_put(Dst, 10154);
1800 if (sse) { 1804 if (sse) {
1801 dasm_put(Dst, 9625); 1805 dasm_put(Dst, 9621);
1802 } else { 1806 } else {
1803 dasm_put(Dst, 9637); 1807 dasm_put(Dst, 9633);
1804 } 1808 }
1805 dasm_put(Dst, 7287); 1809 dasm_put(Dst, 7283);
1806 break; 1810 break;
1807 1811
1808 case BC_CAT: 1812 case BC_CAT:
1809 dasm_put(Dst, 10162, Dt1(->base), Dt1(->base)); 1813 dasm_put(Dst, 10158, Dt1(->base), Dt1(->base));
1810 break; 1814 break;
1811 1815
1812 /* -- Constant ops ------------------------------------------------------ */ 1816 /* -- Constant ops ------------------------------------------------------ */
1813 1817
1814 case BC_KSTR: 1818 case BC_KSTR:
1815 dasm_put(Dst, 10253, LJ_TSTR); 1819 dasm_put(Dst, 10249, LJ_TSTR);
1816 break; 1820 break;
1817 case BC_KSHORT: 1821 case BC_KSHORT:
1818 if (sse) { 1822 if (sse) {
1819 dasm_put(Dst, 10290); 1823 dasm_put(Dst, 10286);
1820 } else { 1824 } else {
1821 dasm_put(Dst, 10305); 1825 dasm_put(Dst, 10301);
1822 } 1826 }
1823 dasm_put(Dst, 7287); 1827 dasm_put(Dst, 7283);
1824 break; 1828 break;
1825 case BC_KNUM: 1829 case BC_KNUM:
1826 if (sse) { 1830 if (sse) {
1827 dasm_put(Dst, 10313); 1831 dasm_put(Dst, 10309);
1828 } else { 1832 } else {
1829 dasm_put(Dst, 10327); 1833 dasm_put(Dst, 10323);
1830 } 1834 }
1831 dasm_put(Dst, 7287); 1835 dasm_put(Dst, 7283);
1832 break; 1836 break;
1833 case BC_KPRI: 1837 case BC_KPRI:
1834 dasm_put(Dst, 10335); 1838 dasm_put(Dst, 10331);
1835 break; 1839 break;
1836 case BC_KNIL: 1840 case BC_KNIL:
1837 dasm_put(Dst, 10364, LJ_TNIL); 1841 dasm_put(Dst, 10360, LJ_TNIL);
1838 break; 1842 break;
1839 1843
1840 /* -- Upvalue and function ops ------------------------------------------ */ 1844 /* -- Upvalue and function ops ------------------------------------------ */
1841 1845
1842 case BC_UGET: 1846 case BC_UGET:
1843 dasm_put(Dst, 10412, offsetof(GCfuncL, uvptr), DtA(->v)); 1847 dasm_put(Dst, 10408, offsetof(GCfuncL, uvptr), DtA(->v));
1844 break; 1848 break;
1845 case BC_USETV: 1849 case BC_USETV:
1846#define TV2MARKOFS \ 1850#define TV2MARKOFS \
1847 ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) 1851 ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv))
1848 dasm_put(Dst, 10458, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); 1852 dasm_put(Dst, 10454, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G);
1849 dasm_put(Dst, 10554); 1853 dasm_put(Dst, 10550);
1850 break; 1854 break;
1851#undef TV2MARKOFS 1855#undef TV2MARKOFS
1852 case BC_USETS: 1856 case BC_USETS:
1853 dasm_put(Dst, 10566, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); 1857 dasm_put(Dst, 10562, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G);
1854 break; 1858 break;
1855 case BC_USETN: 1859 case BC_USETN:
1856 dasm_put(Dst, 10662); 1860 dasm_put(Dst, 10658);
1857 if (sse) { 1861 if (sse) {
1858 dasm_put(Dst, 10667); 1862 dasm_put(Dst, 10663);
1859 } else { 1863 } else {
1860 dasm_put(Dst, 9441); 1864 dasm_put(Dst, 9437);
1861 } 1865 }
1862 dasm_put(Dst, 10675, offsetof(GCfuncL, uvptr), DtA(->v)); 1866 dasm_put(Dst, 10671, offsetof(GCfuncL, uvptr), DtA(->v));
1863 if (sse) { 1867 if (sse) {
1864 dasm_put(Dst, 10684); 1868 dasm_put(Dst, 10680);
1865 } else { 1869 } else {
1866 dasm_put(Dst, 10690); 1870 dasm_put(Dst, 10686);
1867 } 1871 }
1868 dasm_put(Dst, 7287); 1872 dasm_put(Dst, 7283);
1869 break; 1873 break;
1870 case BC_USETP: 1874 case BC_USETP:
1871 dasm_put(Dst, 10693, offsetof(GCfuncL, uvptr), DtA(->v)); 1875 dasm_put(Dst, 10689, offsetof(GCfuncL, uvptr), DtA(->v));
1872 break; 1876 break;
1873 case BC_UCLO: 1877 case BC_UCLO:
1874 dasm_put(Dst, 10733, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); 1878 dasm_put(Dst, 10729, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base));
1875 break; 1879 break;
1876 1880
1877 case BC_FNEW: 1881 case BC_FNEW:
1878 dasm_put(Dst, 10789, Dt1(->base), Dt1(->base), LJ_TFUNC); 1882 dasm_put(Dst, 10785, Dt1(->base), Dt1(->base), LJ_TFUNC);
1879 break; 1883 break;
1880 1884
1881 /* -- Table ops --------------------------------------------------------- */ 1885 /* -- Table ops --------------------------------------------------------- */
1882 1886
1883 case BC_TNEW: 1887 case BC_TNEW:
1884 dasm_put(Dst, 10856, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); 1888 dasm_put(Dst, 10852, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB);
1885 break; 1889 break;
1886 case BC_TDUP: 1890 case BC_TDUP:
1887 dasm_put(Dst, 10980, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); 1891 dasm_put(Dst, 10976, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB);
1888 break; 1892 break;
1889 1893
1890 case BC_GGET: 1894 case BC_GGET:
1891 dasm_put(Dst, 11079, Dt7(->env)); 1895 dasm_put(Dst, 11075, Dt7(->env));
1892 break; 1896 break;
1893 case BC_GSET: 1897 case BC_GSET:
1894 dasm_put(Dst, 11099, Dt7(->env)); 1898 dasm_put(Dst, 11095, Dt7(->env));
1895 break; 1899 break;
1896 1900
1897 case BC_TGETV: 1901 case BC_TGETV:
1898 dasm_put(Dst, 11119, LJ_TTAB, LJ_TISNUM); 1902 dasm_put(Dst, 11115, LJ_TTAB, LJ_TISNUM);
1899 if (sse) { 1903 if (sse) {
1900 dasm_put(Dst, 11152); 1904 dasm_put(Dst, 11148);
1901 } else { 1905 } else {
1902 } 1906 }
1903 dasm_put(Dst, 11173, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 1907 dasm_put(Dst, 11169, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
1904 dasm_put(Dst, 11267, LJ_TSTR); 1908 dasm_put(Dst, 11263, LJ_TSTR);
1905 break; 1909 break;
1906 case BC_TGETS: 1910 case BC_TGETS:
1907 dasm_put(Dst, 11285, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); 1911 dasm_put(Dst, 11281, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL);
1908 dasm_put(Dst, 11371, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 1912 dasm_put(Dst, 11367, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
1909 break; 1913 break;
1910 case BC_TGETB: 1914 case BC_TGETB:
1911 dasm_put(Dst, 11444, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 1915 dasm_put(Dst, 11440, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
1912 dasm_put(Dst, 9733); 1916 dasm_put(Dst, 9729);
1913 break; 1917 break;
1914 1918
1915 case BC_TSETV: 1919 case BC_TSETV:
1916 dasm_put(Dst, 11545, LJ_TTAB, LJ_TISNUM); 1920 dasm_put(Dst, 11541, LJ_TTAB, LJ_TISNUM);
1917 if (sse) { 1921 if (sse) {
1918 dasm_put(Dst, 11152); 1922 dasm_put(Dst, 11148);
1919 } else { 1923 } else {
1920 } 1924 }
1921 dasm_put(Dst, 11578, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); 1925 dasm_put(Dst, 11574, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable));
1922 dasm_put(Dst, 11663, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 1926 dasm_put(Dst, 11659, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1923 break; 1927 break;
1924 case BC_TSETS: 1928 case BC_TSETS:
1925 dasm_put(Dst, 11727, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); 1929 dasm_put(Dst, 11723, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL);
1926 dasm_put(Dst, 11804, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); 1930 dasm_put(Dst, 11800, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next));
1927 dasm_put(Dst, 11896, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 1931 dasm_put(Dst, 11892, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1928 break; 1932 break;
1929 case BC_TSETB: 1933 case BC_TSETB:
1930 dasm_put(Dst, 11988, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); 1934 dasm_put(Dst, 11984, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable));
1931 dasm_put(Dst, 12088, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 1935 dasm_put(Dst, 12084, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1932 break; 1936 break;
1933 1937
1934 case BC_TSETM: 1938 case BC_TSETM:
1935 dasm_put(Dst, 12136); 1939 dasm_put(Dst, 12132);
1936 if (sse) { 1940 if (sse) {
1937 dasm_put(Dst, 10667); 1941 dasm_put(Dst, 10663);
1938 } else { 1942 } else {
1939 } 1943 }
1940 dasm_put(Dst, 12141, Dt6(->marked), LJ_GC_BLACK); 1944 dasm_put(Dst, 12137, Dt6(->marked), LJ_GC_BLACK);
1941 if (sse) { 1945 if (sse) {
1942 dasm_put(Dst, 12166); 1946 dasm_put(Dst, 12162);
1943 } else { 1947 } else {
1944 } 1948 }
1945 dasm_put(Dst, 12174, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); 1949 dasm_put(Dst, 12170, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain));
1946 dasm_put(Dst, 12310, Dt6(->gclist)); 1950 dasm_put(Dst, 12306, Dt6(->gclist));
1947 break; 1951 break;
1948 1952
1949 /* -- Calls and vararg handling ----------------------------------------- */ 1953 /* -- Calls and vararg handling ----------------------------------------- */
1950 1954
1951 case BC_CALL: case BC_CALLM: 1955 case BC_CALL: case BC_CALLM:
1952 dasm_put(Dst, 9747); 1956 dasm_put(Dst, 9743);
1953 if (op == BC_CALLM) { 1957 if (op == BC_CALLM) {
1954 dasm_put(Dst, 12318); 1958 dasm_put(Dst, 12314);
1955 } 1959 }
1956 dasm_put(Dst, 12323, LJ_TFUNC, Dt7(->pc)); 1960 dasm_put(Dst, 12319, LJ_TFUNC, Dt7(->pc));
1957 break; 1961 break;
1958 1962
1959 case BC_CALLMT: 1963 case BC_CALLMT:
1960 dasm_put(Dst, 12318); 1964 dasm_put(Dst, 12314);
1961 break; 1965 break;
1962 case BC_CALLT: 1966 case BC_CALLT:
1963 dasm_put(Dst, 12366, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); 1967 dasm_put(Dst, 12362, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
1964 dasm_put(Dst, 12490, FRAME_TYPE, Dt7(->pc), PC2PROTO(k)); 1968 dasm_put(Dst, 12486, FRAME_TYPE, Dt7(->pc), PC2PROTO(k));
1965 break; 1969 break;
1966 1970
1967 case BC_ITERC: 1971 case BC_ITERC:
1968 dasm_put(Dst, 12551, LJ_TFUNC, 2+1, Dt7(->pc)); 1972 dasm_put(Dst, 12547, LJ_TFUNC, 2+1, Dt7(->pc));
1969 break; 1973 break;
1970 1974
1971 case BC_VARG: 1975 case BC_VARG:
1972 dasm_put(Dst, 12633, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); 1976 dasm_put(Dst, 12629, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
1973 dasm_put(Dst, 12787, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 1977 dasm_put(Dst, 12783, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
1974 break; 1978 break;
1975 1979
1976 /* -- Returns ----------------------------------------------------------- */ 1980 /* -- Returns ----------------------------------------------------------- */
1977 1981
1978 case BC_RETM: 1982 case BC_RETM:
1979 dasm_put(Dst, 12318); 1983 dasm_put(Dst, 12314);
1980 break; 1984 break;
1981 1985
1982 case BC_RET: case BC_RET0: case BC_RET1: 1986 case BC_RET: case BC_RET0: case BC_RET1:
1983 if (op != BC_RET0) { 1987 if (op != BC_RET0) {
1984 dasm_put(Dst, 12892); 1988 dasm_put(Dst, 12888);
1985 } 1989 }
1986 dasm_put(Dst, 12896, FRAME_TYPE); 1990 dasm_put(Dst, 12892, FRAME_TYPE);
1987 switch (op) { 1991 switch (op) {
1988 case BC_RET: 1992 case BC_RET:
1989 dasm_put(Dst, 12915); 1993 dasm_put(Dst, 12911);
1990 break; 1994 break;
1991 case BC_RET1: 1995 case BC_RET1:
1992 dasm_put(Dst, 12979); 1996 dasm_put(Dst, 12975);
1993 /* fallthrough */ 1997 /* fallthrough */
1994 case BC_RET0: 1998 case BC_RET0:
1995 dasm_put(Dst, 12995); 1999 dasm_put(Dst, 12991);
1996 default: 2000 default:
1997 break; 2001 break;
1998 } 2002 }
1999 dasm_put(Dst, 13006, Dt7(->pc), PC2PROTO(k)); 2003 dasm_put(Dst, 13002, Dt7(->pc), PC2PROTO(k));
2000 if (op == BC_RET) { 2004 if (op == BC_RET) {
2001 dasm_put(Dst, 13054, LJ_TNIL); 2005 dasm_put(Dst, 13050, LJ_TNIL);
2002 } else { 2006 } else {
2003 dasm_put(Dst, 13065, LJ_TNIL); 2007 dasm_put(Dst, 13061, LJ_TNIL);
2004 } 2008 }
2005 dasm_put(Dst, 13072); 2009 dasm_put(Dst, 13068);
2006 if (op != BC_RET0) { 2010 if (op != BC_RET0) {
2007 dasm_put(Dst, 13092); 2011 dasm_put(Dst, 13088);
2008 } 2012 }
2009 dasm_put(Dst, 4568); 2013 dasm_put(Dst, 4568);
2010 break; 2014 break;
@@ -2014,7 +2018,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2014 2018
2015 case BC_FORL: 2019 case BC_FORL:
2016#if LJ_HASJIT 2020#if LJ_HASJIT
2017 dasm_put(Dst, 13095, HOTCOUNT_PCMASK, GG_DISP2HOT); 2021 dasm_put(Dst, 13091, HOTCOUNT_PCMASK, GG_DISP2HOT);
2018#endif 2022#endif
2019 break; 2023 break;
2020 2024
@@ -2026,57 +2030,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2026 case BC_FORI: 2030 case BC_FORI:
2027 case BC_IFORL: 2031 case BC_IFORL:
2028 vk = (op == BC_IFORL || op == BC_JFORL); 2032 vk = (op == BC_IFORL || op == BC_JFORL);
2029 dasm_put(Dst, 13116); 2033 dasm_put(Dst, 13112);
2030 if (!vk) { 2034 if (!vk) {
2031 dasm_put(Dst, 13120, LJ_TISNUM, LJ_TISNUM); 2035 dasm_put(Dst, 13116, LJ_TISNUM, LJ_TISNUM);
2032 } 2036 }
2033 dasm_put(Dst, 13139); 2037 dasm_put(Dst, 13135);
2034 if (!vk) { 2038 if (!vk) {
2035 dasm_put(Dst, 13143, LJ_TISNUM); 2039 dasm_put(Dst, 13139, LJ_TISNUM);
2036 } 2040 }
2037 if (sse) { 2041 if (sse) {
2038 dasm_put(Dst, 13152); 2042 dasm_put(Dst, 13148);
2039 if (vk) { 2043 if (vk) {
2040 dasm_put(Dst, 13164); 2044 dasm_put(Dst, 13160);
2041 } else { 2045 } else {
2042 dasm_put(Dst, 13183); 2046 dasm_put(Dst, 13179);
2043 } 2047 }
2044 dasm_put(Dst, 13188); 2048 dasm_put(Dst, 13184);
2045 } else { 2049 } else {
2046 dasm_put(Dst, 13201); 2050 dasm_put(Dst, 13197);
2047 if (vk) { 2051 if (vk) {
2048 dasm_put(Dst, 13207); 2052 dasm_put(Dst, 13203);
2049 } else { 2053 } else {
2050 dasm_put(Dst, 13223); 2054 dasm_put(Dst, 13219);
2051 } 2055 }
2052 dasm_put(Dst, 13231); 2056 dasm_put(Dst, 13227);
2053 if (cmov) { 2057 if (cmov) {
2054 dasm_put(Dst, 9162); 2058 dasm_put(Dst, 9158);
2055 } else { 2059 } else {
2056 dasm_put(Dst, 9168); 2060 dasm_put(Dst, 9164);
2057 } 2061 }
2058 if (!cmov) { 2062 if (!cmov) {
2059 dasm_put(Dst, 13236); 2063 dasm_put(Dst, 13232);
2060 } 2064 }
2061 } 2065 }
2062 if (op == BC_FORI) { 2066 if (op == BC_FORI) {
2063 dasm_put(Dst, 13242, -BCBIAS_J*4); 2067 dasm_put(Dst, 13238, -BCBIAS_J*4);
2064 } else if (op == BC_JFORI) { 2068 } else if (op == BC_JFORI) {
2065 dasm_put(Dst, 13252, -BCBIAS_J*4, BC_JLOOP); 2069 dasm_put(Dst, 13248, -BCBIAS_J*4, BC_JLOOP);
2066 } else if (op == BC_IFORL) { 2070 } else if (op == BC_IFORL) {
2067 dasm_put(Dst, 13266, -BCBIAS_J*4); 2071 dasm_put(Dst, 13262, -BCBIAS_J*4);
2068 } else { 2072 } else {
2069 dasm_put(Dst, 13262, BC_JLOOP); 2073 dasm_put(Dst, 13258, BC_JLOOP);
2070 } 2074 }
2071 dasm_put(Dst, 9197); 2075 dasm_put(Dst, 9193);
2072 if (sse) { 2076 if (sse) {
2073 dasm_put(Dst, 13276); 2077 dasm_put(Dst, 13272);
2074 } 2078 }
2075 break; 2079 break;
2076 2080
2077 case BC_ITERL: 2081 case BC_ITERL:
2078#if LJ_HASJIT 2082#if LJ_HASJIT
2079 dasm_put(Dst, 13095, HOTCOUNT_PCMASK, GG_DISP2HOT); 2083 dasm_put(Dst, 13091, HOTCOUNT_PCMASK, GG_DISP2HOT);
2080#endif 2084#endif
2081 break; 2085 break;
2082 2086
@@ -2085,33 +2089,33 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2085 break; 2089 break;
2086#endif 2090#endif
2087 case BC_IITERL: 2091 case BC_IITERL:
2088 dasm_put(Dst, 13287, LJ_TNIL); 2092 dasm_put(Dst, 13283, LJ_TNIL);
2089 if (op == BC_JITERL) { 2093 if (op == BC_JITERL) {
2090 dasm_put(Dst, 13302, BC_JLOOP); 2094 dasm_put(Dst, 13298, BC_JLOOP);
2091 } else { 2095 } else {
2092 dasm_put(Dst, 13316, -BCBIAS_J*4); 2096 dasm_put(Dst, 13312, -BCBIAS_J*4);
2093 } 2097 }
2094 dasm_put(Dst, 9501); 2098 dasm_put(Dst, 9497);
2095 break; 2099 break;
2096 2100
2097 case BC_LOOP: 2101 case BC_LOOP:
2098#if LJ_HASJIT 2102#if LJ_HASJIT
2099 dasm_put(Dst, 13095, HOTCOUNT_PCMASK, GG_DISP2HOT); 2103 dasm_put(Dst, 13091, HOTCOUNT_PCMASK, GG_DISP2HOT);
2100#endif 2104#endif
2101 break; 2105 break;
2102 2106
2103 case BC_ILOOP: 2107 case BC_ILOOP:
2104 dasm_put(Dst, 7287); 2108 dasm_put(Dst, 7283);
2105 break; 2109 break;
2106 2110
2107 case BC_JLOOP: 2111 case BC_JLOOP:
2108#if LJ_HASJIT 2112#if LJ_HASJIT
2109 dasm_put(Dst, 13332, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); 2113 dasm_put(Dst, 13328, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
2110#endif 2114#endif
2111 break; 2115 break;
2112 2116
2113 case BC_JMP: 2117 case BC_JMP:
2114 dasm_put(Dst, 13359, -BCBIAS_J*4); 2118 dasm_put(Dst, 13355, -BCBIAS_J*4);
2115 break; 2119 break;
2116 2120
2117 /* -- Function headers -------------------------------------------------- */ 2121 /* -- Function headers -------------------------------------------------- */
@@ -2134,13 +2138,13 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2134 break; 2138 break;
2135#endif 2139#endif
2136 case BC_IFUNCF: 2140 case BC_IFUNCF:
2137 dasm_put(Dst, 13385, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); 2141 dasm_put(Dst, 13381, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
2138 if (op == BC_JFUNCF) { 2142 if (op == BC_JFUNCF) {
2139 dasm_put(Dst, 13416, BC_JLOOP); 2143 dasm_put(Dst, 13412, BC_JLOOP);
2140 } else { 2144 } else {
2141 dasm_put(Dst, 7287); 2145 dasm_put(Dst, 7283);
2142 } 2146 }
2143 dasm_put(Dst, 13425, LJ_TNIL); 2147 dasm_put(Dst, 13421, LJ_TNIL);
2144 break; 2148 break;
2145 2149
2146 case BC_JFUNCV: 2150 case BC_JFUNCV:
@@ -2151,30 +2155,30 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2151 break; /* NYI: compiled vararg functions. */ 2155 break; /* NYI: compiled vararg functions. */
2152 2156
2153 case BC_IFUNCV: 2157 case BC_IFUNCV:
2154 dasm_put(Dst, 13447, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); 2158 dasm_put(Dst, 13443, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
2155 if (op == BC_JFUNCV) { 2159 if (op == BC_JFUNCV) {
2156 dasm_put(Dst, 13416, BC_JLOOP); 2160 dasm_put(Dst, 13412, BC_JLOOP);
2157 } else { 2161 } else {
2158 dasm_put(Dst, 13544, -4+PC2PROTO(k)); 2162 dasm_put(Dst, 13540, -4+PC2PROTO(k));
2159 } 2163 }
2160 dasm_put(Dst, 13569, LJ_TNIL); 2164 dasm_put(Dst, 13565, LJ_TNIL);
2161 break; 2165 break;
2162 2166
2163 case BC_FUNCC: 2167 case BC_FUNCC:
2164 case BC_FUNCCW: 2168 case BC_FUNCCW:
2165 dasm_put(Dst, 13591, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); 2169 dasm_put(Dst, 13587, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
2166 if (op == BC_FUNCC) { 2170 if (op == BC_FUNCC) {
2167 dasm_put(Dst, 13621); 2171 dasm_put(Dst, 13617);
2168 } else { 2172 } else {
2169 dasm_put(Dst, 13625); 2173 dasm_put(Dst, 13621);
2170 } 2174 }
2171 dasm_put(Dst, 13633, DISPATCH_GL(vmstate), ~LJ_VMST_C); 2175 dasm_put(Dst, 13629, DISPATCH_GL(vmstate), ~LJ_VMST_C);
2172 if (op == BC_FUNCC) { 2176 if (op == BC_FUNCC) {
2173 dasm_put(Dst, 13643); 2177 dasm_put(Dst, 13639);
2174 } else { 2178 } else {
2175 dasm_put(Dst, 13648, DISPATCH_GL(wrapf)); 2179 dasm_put(Dst, 13644, DISPATCH_GL(wrapf));
2176 } 2180 }
2177 dasm_put(Dst, 13654, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); 2181 dasm_put(Dst, 13650, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
2178 break; 2182 break;
2179 2183
2180 /* ---------------------------------------------------------------------- */ 2184 /* ---------------------------------------------------------------------- */
@@ -2202,7 +2206,7 @@ static int build_backend(BuildCtx *ctx)
2202 2206
2203 build_subroutines(ctx, cmov, sse); 2207 build_subroutines(ctx, cmov, sse);
2204 2208
2205 dasm_put(Dst, 13680); 2209 dasm_put(Dst, 13676);
2206 for (op = 0; op < BC__MAX; op++) 2210 for (op = 0; op < BC__MAX; op++)
2207 build_ins(ctx, (BCOp)op, op, cmov, sse); 2211 build_ins(ctx, (BCOp)op, op, cmov, sse);
2208 2212
diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h
index 093b5fa0..742cf19b 100644
--- a/src/buildvm_x64win.h
+++ b/src/buildvm_x64win.h
@@ -12,7 +12,7 @@
12#define DASM_SECTION_CODE_OP 0 12#define DASM_SECTION_CODE_OP 0
13#define DASM_SECTION_CODE_SUB 1 13#define DASM_SECTION_CODE_SUB 1
14#define DASM_MAXSECTION 2 14#define DASM_MAXSECTION 2
15static const unsigned char build_actionlist[13494] = { 15static const unsigned char build_actionlist[13490] = {
16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,72, 16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,72,
17 141,76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68, 17 141,76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,
18 36,84,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10, 18 36,84,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10,
@@ -359,106 +359,106 @@ static const unsigned char build_actionlist[13494] = {
359 235,15,132,244,251,248,1,255,139,108,36,96,137,149,233,137,252,242,137,252, 359 235,15,132,244,251,248,1,255,139,108,36,96,137,149,233,137,252,242,137,252,
360 233,232,251,1,20,248,3,139,149,233,248,4,15,182,78,252,253,248,5,15,182,110, 360 233,232,251,1,20,248,3,139,149,233,248,4,15,182,78,252,253,248,5,15,182,110,
361 252,252,15,183,70,252,254,252,255,164,253,252,235,233,248,139,131,198,4,139, 361 252,252,15,183,70,252,254,252,255,164,253,252,235,233,248,139,131,198,4,139,
362 77,232,137,76,36,84,252,233,244,4,248,140,255,204,255,248,141,255,72,199, 362 77,232,137,76,36,84,252,233,244,4,248,140,255,204,255,248,141,137,116,36,
363 131,233,0,0,0,0,252,233,244,247,255,248,142,255,72,137,171,233,248,1,255, 363 100,255,248,142,255,137,116,36,100,131,206,1,248,1,255,141,68,194,252,248,
364 141,68,194,252,248,139,108,36,96,137,149,233,137,133,233,137,252,242,137, 364 139,108,36,96,137,149,233,137,133,233,137,252,242,137,252,233,232,251,1,21,
365 252,233,137,116,36,100,232,251,1,21,199,68,36,100,0,0,0,0,139,149,233,72, 365 199,68,36,100,0,0,0,0,255,131,230,252,254,255,139,149,233,72,137,193,139,
366 137,193,139,133,233,41,208,72,137,205,15,182,78,252,253,193,232,3,131,192, 366 133,233,41,208,72,137,205,15,182,78,252,253,193,232,3,131,192,1,252,255,229,
367 1,252,255,229,248,143,255,248,144,255,139,122,252,248,139,191,233,139,191, 367 248,143,255,248,144,255,139,122,252,248,139,191,233,139,191,233,199,131,233,
368 233,199,131,233,0,0,0,0,199,131,233,237,139,6,15,182,204,15,182,232,131,198, 368 0,0,0,0,199,131,233,237,139,6,15,182,204,15,182,232,131,198,4,193,232,16,
369 4,193,232,16,252,255,36,252,235,255,248,82,255,217,124,36,4,137,68,36,8,102, 369 252,255,36,252,235,255,248,82,255,217,124,36,4,137,68,36,8,102,184,0,4,102,
370 184,0,4,102,11,68,36,4,102,37,252,255,252,247,102,137,68,36,6,217,108,36, 370 11,68,36,4,102,37,252,255,252,247,102,137,68,36,6,217,108,36,6,217,252,252,
371 6,217,252,252,217,108,36,4,139,68,36,8,195,255,248,145,72,184,237,237,102, 371 217,108,36,4,139,68,36,8,195,255,248,145,72,184,237,237,102,72,15,110,208,
372 72,15,110,208,72,184,237,237,102,72,15,110,216,15,40,200,102,15,84,202,102, 372 72,184,237,237,102,72,15,110,216,15,40,200,102,15,84,202,102,15,46,217,15,
373 15,46,217,15,134,244,247,102,15,85,208,252,242,15,88,203,252,242,15,92,203, 373 134,244,247,102,15,85,208,252,242,15,88,203,252,242,15,92,203,102,15,86,202,
374 102,15,86,202,72,184,237,237,102,72,15,110,208,252,242,15,194,193,1,102,15, 374 72,184,237,237,102,72,15,110,208,252,242,15,194,193,1,102,15,84,194,252,242,
375 84,194,252,242,15,92,200,15,40,193,248,1,195,248,84,255,217,124,36,4,137, 375 15,92,200,15,40,193,248,1,195,248,84,255,217,124,36,4,137,68,36,8,102,184,
376 68,36,8,102,184,0,8,102,11,68,36,4,102,37,252,255,252,251,102,137,68,36,6, 376 0,8,102,11,68,36,4,102,37,252,255,252,251,102,137,68,36,6,217,108,36,6,217,
377 217,108,36,6,217,252,252,217,108,36,4,139,68,36,8,195,255,248,146,72,184, 377 252,252,217,108,36,4,139,68,36,8,195,255,248,146,72,184,237,237,102,72,15,
378 237,237,102,72,15,110,208,72,184,237,237,102,72,15,110,216,15,40,200,102, 378 110,208,72,184,237,237,102,72,15,110,216,15,40,200,102,15,84,202,102,15,46,
379 15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,252,242,15,88,203,252, 379 217,15,134,244,247,102,15,85,208,252,242,15,88,203,252,242,15,92,203,102,
380 242,15,92,203,102,15,86,202,72,184,237,237,102,72,15,110,208,252,242,15,194, 380 15,86,202,72,184,237,237,102,72,15,110,208,252,242,15,194,193,6,102,15,84,
381 193,6,102,15,84,194,252,242,15,92,200,15,40,193,248,1,195,248,104,255,217, 381 194,252,242,15,92,200,15,40,193,248,1,195,248,104,255,217,124,36,4,137,68,
382 124,36,4,137,68,36,8,102,184,0,12,102,11,68,36,4,102,137,68,36,6,217,108, 382 36,8,102,184,0,12,102,11,68,36,4,102,137,68,36,6,217,108,36,6,217,252,252,
383 36,6,217,252,252,217,108,36,4,139,68,36,8,195,255,248,147,72,184,237,237, 383 217,108,36,4,139,68,36,8,195,255,248,147,72,184,237,237,102,72,15,110,208,
384 102,72,15,110,208,72,184,237,237,102,72,15,110,216,15,40,200,102,15,84,202, 384 72,184,237,237,102,72,15,110,216,15,40,200,102,15,84,202,102,15,46,217,15,
385 102,15,46,217,15,134,244,247,102,15,85,208,15,40,193,252,242,15,88,203,252, 385 134,244,247,102,15,85,208,15,40,193,252,242,15,88,203,252,242,15,92,203,72,
386 242,15,92,203,72,184,237,237,102,72,15,110,216,252,242,15,194,193,1,102,15, 386 184,237,237,102,72,15,110,216,252,242,15,194,193,1,102,15,84,195,252,242,
387 84,195,252,242,15,92,200,102,15,86,202,15,40,193,248,1,195,248,148,255,15, 387 15,92,200,102,15,86,202,15,40,193,248,1,195,248,148,255,15,40,232,252,242,
388 40,232,252,242,15,94,193,72,184,237,237,102,72,15,110,208,72,184,237,237, 388 15,94,193,72,184,237,237,102,72,15,110,208,72,184,237,237,102,72,15,110,216,
389 102,72,15,110,216,15,40,224,102,15,84,226,102,15,46,220,15,134,244,247,102, 389 15,40,224,102,15,84,226,102,15,46,220,15,134,244,247,102,15,85,208,252,242,
390 15,85,208,252,242,15,88,227,252,242,15,92,227,102,15,86,226,72,184,237,237, 390 15,88,227,252,242,15,92,227,102,15,86,226,72,184,237,237,102,72,15,110,208,
391 102,72,15,110,208,252,242,15,194,196,1,102,15,84,194,252,242,15,92,224,15, 391 252,242,15,194,196,1,102,15,84,194,252,242,15,92,224,15,40,197,252,242,15,
392 40,197,252,242,15,89,204,252,242,15,92,193,195,248,1,252,242,15,89,200,15, 392 89,204,252,242,15,92,193,195,248,1,252,242,15,89,200,15,40,197,252,242,15,
393 40,197,252,242,15,92,193,195,255,217,193,216,252,241,217,124,36,4,102,184, 393 92,193,195,255,217,193,216,252,241,217,124,36,4,102,184,0,4,102,11,68,36,
394 0,4,102,11,68,36,4,102,37,252,255,252,247,102,137,68,36,6,217,108,36,6,217, 394 4,102,37,252,255,252,247,102,137,68,36,6,217,108,36,6,217,252,252,217,108,
395 252,252,217,108,36,4,222,201,222,252,233,195,255,248,88,217,252,234,222,201, 395 36,4,222,201,222,252,233,195,255,248,88,217,252,234,222,201,248,149,217,84,
396 248,149,217,84,36,8,129,124,36,8,0,0,128,127,15,132,244,247,129,124,36,8, 396 36,8,129,124,36,8,0,0,128,127,15,132,244,247,129,124,36,8,0,0,128,252,255,
397 0,0,128,252,255,15,132,244,248,248,150,217,192,217,252,252,220,252,233,217, 397 15,132,244,248,248,150,217,192,217,252,252,220,252,233,217,201,217,252,240,
398 201,217,252,240,217,232,222,193,217,252,253,221,217,248,1,195,248,2,221,216, 398 217,232,222,193,217,252,253,221,217,248,1,195,248,2,221,216,217,252,238,195,
399 217,252,238,195,255,248,107,255,248,151,252,242,15,45,193,252,242,15,42,208, 399 255,248,107,255,248,151,252,242,15,45,193,252,242,15,42,208,102,15,46,202,
400 102,15,46,202,15,133,244,254,15,138,244,255,248,152,131,252,248,1,15,142, 400 15,133,244,254,15,138,244,255,248,152,131,252,248,1,15,142,244,252,248,1,
401 244,252,248,1,169,1,0,0,0,15,133,244,248,252,242,15,89,192,209,232,252,233, 401 169,1,0,0,0,15,133,244,248,252,242,15,89,192,209,232,252,233,244,1,248,2,
402 244,1,248,2,209,232,15,132,244,251,15,40,200,248,3,252,242,15,89,192,209, 402 209,232,15,132,244,251,15,40,200,248,3,252,242,15,89,192,209,232,15,132,244,
403 232,15,132,244,250,15,131,244,3,255,252,242,15,89,200,252,233,244,3,248,4, 403 250,15,131,244,3,255,252,242,15,89,200,252,233,244,3,248,4,252,242,15,89,
404 252,242,15,89,193,248,5,195,248,6,15,132,244,5,15,130,244,253,80,72,184,237, 404 193,248,5,195,248,6,15,132,244,5,15,130,244,253,80,72,184,237,237,102,72,
405 237,102,72,15,110,200,252,242,15,94,200,88,15,40,193,252,247,216,131,252, 405 15,110,200,252,242,15,94,200,88,15,40,193,252,247,216,131,252,248,1,15,132,
406 248,1,15,132,244,5,252,233,244,1,248,7,72,184,237,237,102,72,15,110,192,195, 406 244,5,252,233,244,1,248,7,72,184,237,237,102,72,15,110,192,195,248,8,102,
407 248,8,102,72,15,126,200,72,209,224,72,193,192,12,72,61,252,254,15,0,0,15, 407 72,15,126,200,72,209,224,72,193,192,12,72,61,252,254,15,0,0,15,132,244,248,
408 132,244,248,255,102,72,15,126,192,72,209,224,15,132,244,250,72,193,192,12, 408 255,102,72,15,126,192,72,209,224,15,132,244,250,72,193,192,12,72,61,252,254,
409 72,61,252,254,15,0,0,15,132,244,251,252,242,15,17,76,36,16,252,242,15,17, 409 15,0,0,15,132,244,251,252,242,15,17,76,36,16,252,242,15,17,68,36,8,221,68,
410 68,36,8,221,68,36,16,221,68,36,8,217,252,241,217,192,217,252,252,220,252, 410 36,16,221,68,36,8,217,252,241,217,192,217,252,252,220,252,233,217,201,217,
411 233,217,201,217,252,240,217,232,222,193,217,252,253,221,217,221,92,36,8,252, 411 252,240,217,232,222,193,217,252,253,221,217,221,92,36,8,252,242,15,16,68,
412 242,15,16,68,36,8,195,248,9,72,184,237,237,102,72,15,110,208,102,15,46,194, 412 36,8,195,248,9,72,184,237,237,102,72,15,110,208,102,15,46,194,15,132,244,
413 15,132,244,247,15,40,193,248,1,195,248,2,72,184,237,237,102,72,15,110,208, 413 247,15,40,193,248,1,195,248,2,72,184,237,237,102,72,15,110,208,102,15,84,
414 102,15,84,194,72,184,237,237,102,72,15,110,208,102,15,46,194,15,132,244,1, 414 194,72,184,237,237,102,72,15,110,208,102,15,46,194,15,132,244,1,102,15,80,
415 102,15,80,193,15,87,192,136,196,15,146,208,48,224,15,133,244,1,248,3,72,184, 415 193,15,87,192,136,196,15,146,208,48,224,15,133,244,1,248,3,72,184,237,237,
416 237,237,255,102,72,15,110,192,195,248,4,102,15,80,193,133,192,15,133,244, 416 255,102,72,15,110,192,195,248,4,102,15,80,193,133,192,15,133,244,3,15,87,
417 3,15,87,192,195,248,5,102,15,80,193,133,192,15,132,244,3,15,87,192,195,248, 417 192,195,248,5,102,15,80,193,133,192,15,132,244,3,15,87,192,195,248,153,255,
418 153,255,131,252,250,1,15,130,244,82,15,132,244,84,131,252,250,3,15,130,244,
419 104,15,135,244,248,252,242,15,81,192,195,248,2,252,242,15,17,68,36,8,221,
420 68,36,8,131,252,250,5,15,135,244,248,88,15,132,244,247,232,244,88,80,252,
421 233,244,253,248,1,232,244,149,255,80,252,233,244,253,248,2,131,252,250,7,
422 15,132,244,247,15,135,244,248,217,252,237,217,201,217,252,241,252,233,244,
423 253,248,1,217,232,217,201,217,252,241,252,233,244,253,248,2,131,252,250,9,
424 15,132,244,247,15,135,244,248,217,252,236,217,201,217,252,241,252,233,244,
425 253,248,1,255,217,252,254,252,233,244,253,248,2,131,252,250,11,15,132,244,
426 247,15,135,244,255,217,252,255,252,233,244,253,248,1,217,252,242,221,216,
427 248,7,221,92,36,8,252,242,15,16,68,36,8,195,255,139,84,36,12,221,68,36,4,
428 131,252,250,1,15,130,244,82,15,132,244,84,131,252,250,3,15,130,244,104,15, 418 131,252,250,1,15,130,244,82,15,132,244,84,131,252,250,3,15,130,244,104,15,
429 135,244,248,217,252,250,195,248,2,131,252,250,5,15,130,244,88,15,132,244, 419 135,244,248,252,242,15,81,192,195,248,2,252,242,15,17,68,36,8,221,68,36,8,
430 149,131,252,250,7,15,132,244,247,15,135,244,248,217,252,237,217,201,217,252, 420 131,252,250,5,15,135,244,248,88,15,132,244,247,232,244,88,80,252,233,244,
431 241,195,248,1,217,232,217,201,217,252,241,195,248,2,131,252,250,9,15,132, 421 253,248,1,232,244,149,255,80,252,233,244,253,248,2,131,252,250,7,15,132,244,
432 244,247,255,15,135,244,248,217,252,236,217,201,217,252,241,195,248,1,217, 422 247,15,135,244,248,217,252,237,217,201,217,252,241,252,233,244,253,248,1,
433 252,254,195,248,2,131,252,250,11,15,132,244,247,15,135,244,255,217,252,255, 423 217,232,217,201,217,252,241,252,233,244,253,248,2,131,252,250,9,15,132,244,
434 195,248,1,217,252,242,221,216,195,255,248,9,204,248,154,255,65,131,252,248, 424 247,15,135,244,248,217,252,236,217,201,217,252,241,252,233,244,253,248,1,
435 1,15,132,244,247,15,135,244,248,252,242,15,88,193,195,248,1,252,242,15,92, 425 255,217,252,254,252,233,244,253,248,2,131,252,250,11,15,132,244,247,15,135,
436 193,195,248,2,65,131,252,248,3,15,132,244,247,15,135,244,248,252,242,15,89, 426 244,255,217,252,255,252,233,244,253,248,1,217,252,242,221,216,248,7,221,92,
437 193,195,248,1,252,242,15,94,193,195,248,2,65,131,252,248,5,15,130,244,148, 427 36,8,252,242,15,16,68,36,8,195,255,139,84,36,12,221,68,36,4,131,252,250,1,
438 15,132,244,107,65,131,252,248,7,15,132,244,247,15,135,244,248,72,184,237, 428 15,130,244,82,15,132,244,84,131,252,250,3,15,130,244,104,15,135,244,248,217,
439 237,255,102,72,15,110,200,15,87,193,195,248,1,72,184,237,237,102,72,15,110, 429 252,250,195,248,2,131,252,250,5,15,130,244,88,15,132,244,149,131,252,250,
440 200,15,84,193,195,248,2,65,131,252,248,9,15,135,244,248,252,242,15,17,68, 430 7,15,132,244,247,15,135,244,248,217,252,237,217,201,217,252,241,195,248,1,
441 36,8,252,242,15,17,76,36,16,221,68,36,8,221,68,36,16,15,132,244,247,217,252, 431 217,232,217,201,217,252,241,195,248,2,131,252,250,9,15,132,244,247,255,15,
442 243,248,7,221,92,36,8,252,242,15,16,68,36,8,195,248,1,217,201,217,252,253, 432 135,244,248,217,252,236,217,201,217,252,241,195,248,1,217,252,254,195,248,
443 221,217,252,233,244,7,248,2,65,131,252,248,11,15,132,244,247,15,135,244,255, 433 2,131,252,250,11,15,132,244,247,15,135,244,255,217,252,255,195,248,1,217,
444 252,242,15,93,193,195,248,1,252,242,15,95,193,195,248,9,204,255,139,68,36, 434 252,242,221,216,195,255,248,9,204,248,154,255,65,131,252,248,1,15,132,244,
445 20,221,68,36,4,221,68,36,12,131,252,248,1,15,132,244,247,15,135,244,248,222, 435 247,15,135,244,248,252,242,15,88,193,195,248,1,252,242,15,92,193,195,248,
446 193,195,248,1,222,252,233,195,248,2,131,252,248,3,15,132,244,247,15,135,244, 436 2,65,131,252,248,3,15,132,244,247,15,135,244,248,252,242,15,89,193,195,248,
447 248,222,201,195,248,1,222,252,249,195,248,2,131,252,248,5,15,130,244,148, 437 1,252,242,15,94,193,195,248,2,65,131,252,248,5,15,130,244,148,15,132,244,
448 15,132,244,107,131,252,248,7,15,132,244,247,15,135,244,248,255,221,216,217, 438 107,65,131,252,248,7,15,132,244,247,15,135,244,248,72,184,237,237,255,102,
449 224,195,248,1,221,216,217,225,195,248,2,131,252,248,9,15,132,244,247,15,135, 439 72,15,110,200,15,87,193,195,248,1,72,184,237,237,102,72,15,110,200,15,84,
450 244,248,217,252,243,195,248,1,217,201,217,252,253,221,217,195,248,2,131,252, 440 193,195,248,2,65,131,252,248,9,15,135,244,248,252,242,15,17,68,36,8,252,242,
451 248,11,15,132,244,247,15,135,244,255,255,219,252,233,219,209,221,217,195, 441 15,17,76,36,16,221,68,36,8,221,68,36,16,15,132,244,247,217,252,243,248,7,
452 248,1,219,252,233,218,209,221,217,195,255,221,225,223,224,252,246,196,1,15, 442 221,92,36,8,252,242,15,16,68,36,8,195,248,1,217,201,217,252,253,221,217,252,
453 132,244,248,217,201,248,2,221,216,195,248,1,221,225,223,224,252,246,196,1, 443 233,244,7,248,2,65,131,252,248,11,15,132,244,247,15,135,244,255,252,242,15,
454 15,133,244,248,217,201,248,2,221,216,195,255,248,155,137,200,86,72,137,214, 444 93,193,195,248,1,252,242,15,95,193,195,248,9,204,255,139,68,36,20,221,68,
455 83,15,162,137,6,137,94,4,137,78,8,137,86,12,91,94,195,255,249,255,129,124, 445 36,4,221,68,36,12,131,252,248,1,15,132,244,247,15,135,244,248,222,193,195,
456 253,202,4,239,15,135,244,41,129,124,253,194,4,239,15,135,244,41,255,252,242, 446 248,1,222,252,233,195,248,2,131,252,248,3,15,132,244,247,15,135,244,248,222,
457 15,16,4,194,131,198,4,102,15,46,4,202,255,221,4,202,221,4,194,131,198,4,255, 447 201,195,248,1,222,252,249,195,248,2,131,252,248,5,15,130,244,148,15,132,244,
458 223,252,233,221,216,255,218,252,233,223,224,158,255,15,134,244,248,255,15, 448 107,131,252,248,7,15,132,244,247,15,135,244,248,255,221,216,217,224,195,248,
459 131,244,248,255,248,1,15,183,70,252,254,141,180,253,134,233,248,2,139,6,15, 449 1,221,216,217,225,195,248,2,131,252,248,9,15,132,244,247,15,135,244,248,217,
460 182,204,15,182,232,131,198,4,193,232,16,252,255,36,252,235,255,139,108,194, 450 252,243,195,248,1,217,201,217,252,253,221,217,195,248,2,131,252,248,11,15,
461 4,131,198,4,129,252,253,239,15,135,244,251,129,124,253,202,4,239,15,135,244, 451 132,244,247,15,135,244,255,255,219,252,233,219,209,221,217,195,248,1,219,
452 252,233,218,209,221,217,195,255,221,225,223,224,252,246,196,1,15,132,244,
453 248,217,201,248,2,221,216,195,248,1,221,225,223,224,252,246,196,1,15,133,
454 244,248,217,201,248,2,221,216,195,255,248,155,137,200,86,72,137,214,83,15,
455 162,137,6,137,94,4,137,78,8,137,86,12,91,94,195,255,249,255,129,124,253,202,
456 4,239,15,135,244,41,129,124,253,194,4,239,15,135,244,41,255,252,242,15,16,
457 4,194,131,198,4,102,15,46,4,202,255,221,4,202,221,4,194,131,198,4,255,223,
458 252,233,221,216,255,218,252,233,223,224,158,255,15,134,244,248,255,15,131,
459 244,248,255,248,1,15,183,70,252,254,141,180,253,134,233,248,2,139,6,15,182,
460 204,15,182,232,131,198,4,193,232,16,252,255,36,252,235,255,139,108,194,4,
461 131,198,4,129,252,253,239,15,135,244,251,129,124,253,202,4,239,15,135,244,
462 251,255,252,242,15,16,4,194,102,15,46,4,202,255,221,4,202,221,4,194,255,15, 462 251,255,252,242,15,16,4,194,102,15,46,4,202,255,221,4,202,221,4,194,255,15,
463 138,244,248,15,133,244,248,255,15,138,244,248,15,132,244,247,255,248,1,15, 463 138,244,248,15,133,244,248,255,15,138,244,248,15,132,244,247,255,248,1,15,
464 183,70,252,254,141,180,253,134,233,248,2,255,248,2,15,183,70,252,254,141, 464 183,70,252,254,141,180,253,134,233,248,2,255,248,2,15,183,70,252,254,141,
@@ -1325,77 +1325,81 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
1325#endif 1325#endif
1326 dasm_put(Dst, 7119); 1326 dasm_put(Dst, 7119);
1327#if LJ_HASJIT 1327#if LJ_HASJIT
1328 dasm_put(Dst, 7122, DISPATCH_J(L)); 1328 dasm_put(Dst, 6994);
1329#endif 1329#endif
1330 dasm_put(Dst, 7135); 1330 dasm_put(Dst, 7126);
1331#if LJ_HASJIT 1331#if LJ_HASJIT
1332 dasm_put(Dst, 7138, DISPATCH_J(L)); 1332 dasm_put(Dst, 7129);
1333#endif 1333#endif
1334 dasm_put(Dst, 7145, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 1334 dasm_put(Dst, 7139, Dt1(->base), Dt1(->top));
1335#if LJ_HASJIT
1336 dasm_put(Dst, 7173);
1337#endif
1338 dasm_put(Dst, 7178, Dt1(->base), Dt1(->top));
1335#if LJ_HASJIT 1339#if LJ_HASJIT
1336 dasm_put(Dst, 7117); 1340 dasm_put(Dst, 7117);
1337#endif 1341#endif
1338 dasm_put(Dst, 7213); 1342 dasm_put(Dst, 7209);
1339#if LJ_HASJIT 1343#if LJ_HASJIT
1340 dasm_put(Dst, 7216, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP); 1344 dasm_put(Dst, 7212, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP);
1341#endif 1345#endif
1342 dasm_put(Dst, 7257); 1346 dasm_put(Dst, 7253);
1343 if (!sse) { 1347 if (!sse) {
1344 dasm_put(Dst, 7260); 1348 dasm_put(Dst, 7256);
1345 } 1349 }
1346 dasm_put(Dst, 7305, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1350 dasm_put(Dst, 7301, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1347 if (!sse) { 1351 if (!sse) {
1348 dasm_put(Dst, 7391); 1352 dasm_put(Dst, 7387);
1349 } 1353 }
1350 dasm_put(Dst, 7436, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32)); 1354 dasm_put(Dst, 7432, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(bff00000,00000000)), (unsigned int)((U64x(bff00000,00000000))>>32));
1351 if (!sse) { 1355 if (!sse) {
1352 dasm_put(Dst, 7522); 1356 dasm_put(Dst, 7518);
1353 } 1357 }
1354 dasm_put(Dst, 7561, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1358 dasm_put(Dst, 7557, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1355 if (sse) { 1359 if (sse) {
1356 dasm_put(Dst, 7650, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1360 dasm_put(Dst, 7646, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(43300000,00000000)), (unsigned int)((U64x(43300000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1357 } else { 1361 } else {
1358 dasm_put(Dst, 7764); 1362 dasm_put(Dst, 7760);
1359 } 1363 }
1360 dasm_put(Dst, 7811); 1364 dasm_put(Dst, 7807);
1361 if (!sse) { 1365 if (!sse) {
1362 } else { 1366 } else {
1363 dasm_put(Dst, 7885); 1367 dasm_put(Dst, 7881);
1364 } 1368 }
1365 dasm_put(Dst, 7888); 1369 dasm_put(Dst, 7884);
1366 dasm_put(Dst, 7973, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32)); 1370 dasm_put(Dst, 7969, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32));
1367 dasm_put(Dst, 8074, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32)); 1371 dasm_put(Dst, 8070, (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32), (unsigned int)(U64x(3ff00000,00000000)), (unsigned int)((U64x(3ff00000,00000000))>>32), (unsigned int)(U64x(7ff00000,00000000)), (unsigned int)((U64x(7ff00000,00000000))>>32));
1368 dasm_put(Dst, 8242); 1372 dasm_put(Dst, 8238);
1369 if (sse) { 1373 if (sse) {
1370 dasm_put(Dst, 8283); 1374 dasm_put(Dst, 8279);
1371 dasm_put(Dst, 8353); 1375 dasm_put(Dst, 8349);
1372 dasm_put(Dst, 8426); 1376 dasm_put(Dst, 8422);
1373 } else { 1377 } else {
1374 dasm_put(Dst, 8476); 1378 dasm_put(Dst, 8472);
1375 dasm_put(Dst, 8568); 1379 dasm_put(Dst, 8564);
1376 } 1380 }
1377 dasm_put(Dst, 8614); 1381 dasm_put(Dst, 8610);
1378 if (sse) { 1382 if (sse) {
1379 dasm_put(Dst, 8620, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); 1383 dasm_put(Dst, 8616, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32));
1380 dasm_put(Dst, 8709, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32)); 1384 dasm_put(Dst, 8705, (unsigned int)(U64x(7fffffff,ffffffff)), (unsigned int)((U64x(7fffffff,ffffffff))>>32));
1381 } else { 1385 } else {
1382 dasm_put(Dst, 8833); 1386 dasm_put(Dst, 8829);
1383 dasm_put(Dst, 8916); 1387 dasm_put(Dst, 8912);
1384 if (cmov) { 1388 if (cmov) {
1385 dasm_put(Dst, 8971); 1389 dasm_put(Dst, 8967);
1386 } else { 1390 } else {
1387 dasm_put(Dst, 8990); 1391 dasm_put(Dst, 8986);
1388 } 1392 }
1389 dasm_put(Dst, 8829); 1393 dasm_put(Dst, 8825);
1390 } 1394 }
1391 dasm_put(Dst, 9031); 1395 dasm_put(Dst, 9027);
1392} 1396}
1393 1397
1394/* Generate the code for a single instruction. */ 1398/* Generate the code for a single instruction. */
1395static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) 1399static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1396{ 1400{
1397 int vk = 0; 1401 int vk = 0;
1398 dasm_put(Dst, 9057, defop); 1402 dasm_put(Dst, 9053, defop);
1399 1403
1400 switch (op) { 1404 switch (op) {
1401 1405
@@ -1404,600 +1408,600 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1404 /* Remember: all ops branch for a true comparison, fall through otherwise. */ 1408 /* Remember: all ops branch for a true comparison, fall through otherwise. */
1405 1409
1406 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: 1410 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
1407 dasm_put(Dst, 9059, LJ_TISNUM, LJ_TISNUM); 1411 dasm_put(Dst, 9055, LJ_TISNUM, LJ_TISNUM);
1408 if (sse) { 1412 if (sse) {
1409 dasm_put(Dst, 9080); 1413 dasm_put(Dst, 9076);
1410 } else { 1414 } else {
1411 dasm_put(Dst, 9095); 1415 dasm_put(Dst, 9091);
1412 if (cmov) { 1416 if (cmov) {
1413 dasm_put(Dst, 9105); 1417 dasm_put(Dst, 9101);
1414 } else { 1418 } else {
1415 dasm_put(Dst, 9111); 1419 dasm_put(Dst, 9107);
1416 } 1420 }
1417 } 1421 }
1418 switch (op) { 1422 switch (op) {
1419 case BC_ISLT: 1423 case BC_ISLT:
1420 dasm_put(Dst, 9118); 1424 dasm_put(Dst, 9114);
1421 break; 1425 break;
1422 case BC_ISGE: 1426 case BC_ISGE:
1423 dasm_put(Dst, 8911); 1427 dasm_put(Dst, 8907);
1424 break; 1428 break;
1425 case BC_ISLE: 1429 case BC_ISLE:
1426 dasm_put(Dst, 5872); 1430 dasm_put(Dst, 5872);
1427 break; 1431 break;
1428 case BC_ISGT: 1432 case BC_ISGT:
1429 dasm_put(Dst, 9123); 1433 dasm_put(Dst, 9119);
1430 break; 1434 break;
1431 default: break; /* Shut up GCC. */ 1435 default: break; /* Shut up GCC. */
1432 } 1436 }
1433 dasm_put(Dst, 9128, -BCBIAS_J*4); 1437 dasm_put(Dst, 9124, -BCBIAS_J*4);
1434 break; 1438 break;
1435 1439
1436 case BC_ISEQV: case BC_ISNEV: 1440 case BC_ISEQV: case BC_ISNEV:
1437 vk = op == BC_ISEQV; 1441 vk = op == BC_ISEQV;
1438 dasm_put(Dst, 9162, LJ_TISNUM, LJ_TISNUM); 1442 dasm_put(Dst, 9158, LJ_TISNUM, LJ_TISNUM);
1439 if (sse) { 1443 if (sse) {
1440 dasm_put(Dst, 9188); 1444 dasm_put(Dst, 9184);
1441 } else { 1445 } else {
1442 dasm_put(Dst, 9200); 1446 dasm_put(Dst, 9196);
1443 if (cmov) { 1447 if (cmov) {
1444 dasm_put(Dst, 9105); 1448 dasm_put(Dst, 9101);
1445 } else { 1449 } else {
1446 dasm_put(Dst, 9111); 1450 dasm_put(Dst, 9107);
1447 } 1451 }
1448 } 1452 }
1449 iseqne_fp: 1453 iseqne_fp:
1450 if (vk) { 1454 if (vk) {
1451 dasm_put(Dst, 9207); 1455 dasm_put(Dst, 9203);
1452 } else { 1456 } else {
1453 dasm_put(Dst, 9216); 1457 dasm_put(Dst, 9212);
1454 } 1458 }
1455 iseqne_end: 1459 iseqne_end:
1456 if (vk) { 1460 if (vk) {
1457 dasm_put(Dst, 9225, -BCBIAS_J*4); 1461 dasm_put(Dst, 9221, -BCBIAS_J*4);
1458 } else { 1462 } else {
1459 dasm_put(Dst, 9240, -BCBIAS_J*4); 1463 dasm_put(Dst, 9236, -BCBIAS_J*4);
1460 } 1464 }
1461 dasm_put(Dst, 7237); 1465 dasm_put(Dst, 7233);
1462 if (op == BC_ISEQV || op == BC_ISNEV) { 1466 if (op == BC_ISEQV || op == BC_ISNEV) {
1463 dasm_put(Dst, 9255, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); 1467 dasm_put(Dst, 9251, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq);
1464 if (vk) { 1468 if (vk) {
1465 dasm_put(Dst, 9313); 1469 dasm_put(Dst, 9309);
1466 } else { 1470 } else {
1467 dasm_put(Dst, 9317); 1471 dasm_put(Dst, 9313);
1468 } 1472 }
1469 dasm_put(Dst, 9323); 1473 dasm_put(Dst, 9319);
1470 } 1474 }
1471 break; 1475 break;
1472 case BC_ISEQS: case BC_ISNES: 1476 case BC_ISEQS: case BC_ISNES:
1473 vk = op == BC_ISEQS; 1477 vk = op == BC_ISEQS;
1474 dasm_put(Dst, 9328, LJ_TSTR); 1478 dasm_put(Dst, 9324, LJ_TSTR);
1475 iseqne_test: 1479 iseqne_test:
1476 if (vk) { 1480 if (vk) {
1477 dasm_put(Dst, 9211); 1481 dasm_put(Dst, 9207);
1478 } else { 1482 } else {
1479 dasm_put(Dst, 2774); 1483 dasm_put(Dst, 2774);
1480 } 1484 }
1481 goto iseqne_end; 1485 goto iseqne_end;
1482 case BC_ISEQN: case BC_ISNEN: 1486 case BC_ISEQN: case BC_ISNEN:
1483 vk = op == BC_ISEQN; 1487 vk = op == BC_ISEQN;
1484 dasm_put(Dst, 9352, LJ_TISNUM); 1488 dasm_put(Dst, 9348, LJ_TISNUM);
1485 if (sse) { 1489 if (sse) {
1486 dasm_put(Dst, 9366); 1490 dasm_put(Dst, 9362);
1487 } else { 1491 } else {
1488 dasm_put(Dst, 9378); 1492 dasm_put(Dst, 9374);
1489 if (cmov) { 1493 if (cmov) {
1490 dasm_put(Dst, 9105); 1494 dasm_put(Dst, 9101);
1491 } else { 1495 } else {
1492 dasm_put(Dst, 9111); 1496 dasm_put(Dst, 9107);
1493 } 1497 }
1494 } 1498 }
1495 goto iseqne_fp; 1499 goto iseqne_fp;
1496 case BC_ISEQP: case BC_ISNEP: 1500 case BC_ISEQP: case BC_ISNEP:
1497 vk = op == BC_ISEQP; 1501 vk = op == BC_ISEQP;
1498 dasm_put(Dst, 9385); 1502 dasm_put(Dst, 9381);
1499 goto iseqne_test; 1503 goto iseqne_test;
1500 1504
1501 /* -- Unary test and copy ops ------------------------------------------- */ 1505 /* -- Unary test and copy ops ------------------------------------------- */
1502 1506
1503 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: 1507 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
1504 dasm_put(Dst, 9397, LJ_TISTRUECOND); 1508 dasm_put(Dst, 9393, LJ_TISTRUECOND);
1505 if (op == BC_IST || op == BC_ISTC) { 1509 if (op == BC_IST || op == BC_ISTC) {
1506 dasm_put(Dst, 9409); 1510 dasm_put(Dst, 9405);
1507 } else { 1511 } else {
1508 dasm_put(Dst, 9414); 1512 dasm_put(Dst, 9410);
1509 } 1513 }
1510 if (op == BC_ISTC || op == BC_ISFC) { 1514 if (op == BC_ISTC || op == BC_ISFC) {
1511 dasm_put(Dst, 9419); 1515 dasm_put(Dst, 9415);
1512 } 1516 }
1513 dasm_put(Dst, 9430, -BCBIAS_J*4); 1517 dasm_put(Dst, 9426, -BCBIAS_J*4);
1514 break; 1518 break;
1515 1519
1516 /* -- Unary ops --------------------------------------------------------- */ 1520 /* -- Unary ops --------------------------------------------------------- */
1517 1521
1518 case BC_MOV: 1522 case BC_MOV:
1519 dasm_put(Dst, 9462); 1523 dasm_put(Dst, 9458);
1520 break; 1524 break;
1521 case BC_NOT: 1525 case BC_NOT:
1522 dasm_put(Dst, 9496, LJ_TISTRUECOND, LJ_TTRUE); 1526 dasm_put(Dst, 9492, LJ_TISTRUECOND, LJ_TTRUE);
1523 break; 1527 break;
1524 case BC_UNM: 1528 case BC_UNM:
1525 dasm_put(Dst, 9532, LJ_TISNUM); 1529 dasm_put(Dst, 9528, LJ_TISNUM);
1526 if (sse) { 1530 if (sse) {
1527 dasm_put(Dst, 9543, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32)); 1531 dasm_put(Dst, 9539, (unsigned int)(U64x(80000000,00000000)), (unsigned int)((U64x(80000000,00000000))>>32));
1528 } else { 1532 } else {
1529 dasm_put(Dst, 9568); 1533 dasm_put(Dst, 9564);
1530 } 1534 }
1531 dasm_put(Dst, 7237); 1535 dasm_put(Dst, 7233);
1532 break; 1536 break;
1533 case BC_LEN: 1537 case BC_LEN:
1534 dasm_put(Dst, 9577, LJ_TSTR); 1538 dasm_put(Dst, 9573, LJ_TSTR);
1535 if (sse) { 1539 if (sse) {
1536 dasm_put(Dst, 9591, Dt5(->len)); 1540 dasm_put(Dst, 9587, Dt5(->len));
1537 } else { 1541 } else {
1538 dasm_put(Dst, 9609, Dt5(->len)); 1542 dasm_put(Dst, 9605, Dt5(->len));
1539 } 1543 }
1540 dasm_put(Dst, 9618, LJ_TTAB); 1544 dasm_put(Dst, 9614, LJ_TTAB);
1541 if (sse) { 1545 if (sse) {
1542 dasm_put(Dst, 9659); 1546 dasm_put(Dst, 9655);
1543 } else { 1547 } else {
1544 } 1548 }
1545 dasm_put(Dst, 9668); 1549 dasm_put(Dst, 9664);
1546 break; 1550 break;
1547 1551
1548 /* -- Binary ops -------------------------------------------------------- */ 1552 /* -- Binary ops -------------------------------------------------------- */
1549 1553
1550 1554
1551 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: 1555 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:
1552 dasm_put(Dst, 9678); 1556 dasm_put(Dst, 9674);
1553 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1557 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1554 switch (vk) { 1558 switch (vk) {
1555 case 0: 1559 case 0:
1556 dasm_put(Dst, 9686, LJ_TISNUM); 1560 dasm_put(Dst, 9682, LJ_TISNUM);
1557 if (sse) { 1561 if (sse) {
1558 dasm_put(Dst, 9698); 1562 dasm_put(Dst, 9694);
1559 } else { 1563 } else {
1560 dasm_put(Dst, 9712); 1564 dasm_put(Dst, 9708);
1561 } 1565 }
1562 break; 1566 break;
1563 case 1: 1567 case 1:
1564 dasm_put(Dst, 9720, LJ_TISNUM); 1568 dasm_put(Dst, 9716, LJ_TISNUM);
1565 if (sse) { 1569 if (sse) {
1566 dasm_put(Dst, 9732); 1570 dasm_put(Dst, 9728);
1567 } else { 1571 } else {
1568 dasm_put(Dst, 9746); 1572 dasm_put(Dst, 9742);
1569 } 1573 }
1570 break; 1574 break;
1571 default: 1575 default:
1572 dasm_put(Dst, 9754, LJ_TISNUM, LJ_TISNUM); 1576 dasm_put(Dst, 9750, LJ_TISNUM, LJ_TISNUM);
1573 if (sse) { 1577 if (sse) {
1574 dasm_put(Dst, 9776); 1578 dasm_put(Dst, 9772);
1575 } else { 1579 } else {
1576 dasm_put(Dst, 9790); 1580 dasm_put(Dst, 9786);
1577 } 1581 }
1578 break; 1582 break;
1579 } 1583 }
1580 if (sse) { 1584 if (sse) {
1581 dasm_put(Dst, 9561); 1585 dasm_put(Dst, 9557);
1582 } else { 1586 } else {
1583 dasm_put(Dst, 9573); 1587 dasm_put(Dst, 9569);
1584 } 1588 }
1585 dasm_put(Dst, 7237); 1589 dasm_put(Dst, 7233);
1586 break; 1590 break;
1587 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: 1591 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
1588 dasm_put(Dst, 9678); 1592 dasm_put(Dst, 9674);
1589 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1593 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1590 switch (vk) { 1594 switch (vk) {
1591 case 0: 1595 case 0:
1592 dasm_put(Dst, 9686, LJ_TISNUM); 1596 dasm_put(Dst, 9682, LJ_TISNUM);
1593 if (sse) { 1597 if (sse) {
1594 dasm_put(Dst, 9798); 1598 dasm_put(Dst, 9794);
1595 } else { 1599 } else {
1596 dasm_put(Dst, 9812); 1600 dasm_put(Dst, 9808);
1597 } 1601 }
1598 break; 1602 break;
1599 case 1: 1603 case 1:
1600 dasm_put(Dst, 9720, LJ_TISNUM); 1604 dasm_put(Dst, 9716, LJ_TISNUM);
1601 if (sse) { 1605 if (sse) {
1602 dasm_put(Dst, 9820); 1606 dasm_put(Dst, 9816);
1603 } else { 1607 } else {
1604 dasm_put(Dst, 9834); 1608 dasm_put(Dst, 9830);
1605 } 1609 }
1606 break; 1610 break;
1607 default: 1611 default:
1608 dasm_put(Dst, 9754, LJ_TISNUM, LJ_TISNUM); 1612 dasm_put(Dst, 9750, LJ_TISNUM, LJ_TISNUM);
1609 if (sse) { 1613 if (sse) {
1610 dasm_put(Dst, 9842); 1614 dasm_put(Dst, 9838);
1611 } else { 1615 } else {
1612 dasm_put(Dst, 9856); 1616 dasm_put(Dst, 9852);
1613 } 1617 }
1614 break; 1618 break;
1615 } 1619 }
1616 if (sse) { 1620 if (sse) {
1617 dasm_put(Dst, 9561); 1621 dasm_put(Dst, 9557);
1618 } else { 1622 } else {
1619 dasm_put(Dst, 9573); 1623 dasm_put(Dst, 9569);
1620 } 1624 }
1621 dasm_put(Dst, 7237); 1625 dasm_put(Dst, 7233);
1622 break; 1626 break;
1623 case BC_MULVN: case BC_MULNV: case BC_MULVV: 1627 case BC_MULVN: case BC_MULNV: case BC_MULVV:
1624 dasm_put(Dst, 9678); 1628 dasm_put(Dst, 9674);
1625 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1629 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1626 switch (vk) { 1630 switch (vk) {
1627 case 0: 1631 case 0:
1628 dasm_put(Dst, 9686, LJ_TISNUM); 1632 dasm_put(Dst, 9682, LJ_TISNUM);
1629 if (sse) { 1633 if (sse) {
1630 dasm_put(Dst, 9864); 1634 dasm_put(Dst, 9860);
1631 } else { 1635 } else {
1632 dasm_put(Dst, 9878); 1636 dasm_put(Dst, 9874);
1633 } 1637 }
1634 break; 1638 break;
1635 case 1: 1639 case 1:
1636 dasm_put(Dst, 9720, LJ_TISNUM); 1640 dasm_put(Dst, 9716, LJ_TISNUM);
1637 if (sse) { 1641 if (sse) {
1638 dasm_put(Dst, 9886); 1642 dasm_put(Dst, 9882);
1639 } else { 1643 } else {
1640 dasm_put(Dst, 9900); 1644 dasm_put(Dst, 9896);
1641 } 1645 }
1642 break; 1646 break;
1643 default: 1647 default:
1644 dasm_put(Dst, 9754, LJ_TISNUM, LJ_TISNUM); 1648 dasm_put(Dst, 9750, LJ_TISNUM, LJ_TISNUM);
1645 if (sse) { 1649 if (sse) {
1646 dasm_put(Dst, 9908); 1650 dasm_put(Dst, 9904);
1647 } else { 1651 } else {
1648 dasm_put(Dst, 9922); 1652 dasm_put(Dst, 9918);
1649 } 1653 }
1650 break; 1654 break;
1651 } 1655 }
1652 if (sse) { 1656 if (sse) {
1653 dasm_put(Dst, 9561); 1657 dasm_put(Dst, 9557);
1654 } else { 1658 } else {
1655 dasm_put(Dst, 9573); 1659 dasm_put(Dst, 9569);
1656 } 1660 }
1657 dasm_put(Dst, 7237); 1661 dasm_put(Dst, 7233);
1658 break; 1662 break;
1659 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: 1663 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
1660 dasm_put(Dst, 9678); 1664 dasm_put(Dst, 9674);
1661 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1665 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1662 switch (vk) { 1666 switch (vk) {
1663 case 0: 1667 case 0:
1664 dasm_put(Dst, 9686, LJ_TISNUM); 1668 dasm_put(Dst, 9682, LJ_TISNUM);
1665 if (sse) { 1669 if (sse) {
1666 dasm_put(Dst, 9930); 1670 dasm_put(Dst, 9926);
1667 } else { 1671 } else {
1668 dasm_put(Dst, 9944); 1672 dasm_put(Dst, 9940);
1669 } 1673 }
1670 break; 1674 break;
1671 case 1: 1675 case 1:
1672 dasm_put(Dst, 9720, LJ_TISNUM); 1676 dasm_put(Dst, 9716, LJ_TISNUM);
1673 if (sse) { 1677 if (sse) {
1674 dasm_put(Dst, 9952); 1678 dasm_put(Dst, 9948);
1675 } else { 1679 } else {
1676 dasm_put(Dst, 9966); 1680 dasm_put(Dst, 9962);
1677 } 1681 }
1678 break; 1682 break;
1679 default: 1683 default:
1680 dasm_put(Dst, 9754, LJ_TISNUM, LJ_TISNUM); 1684 dasm_put(Dst, 9750, LJ_TISNUM, LJ_TISNUM);
1681 if (sse) { 1685 if (sse) {
1682 dasm_put(Dst, 9974); 1686 dasm_put(Dst, 9970);
1683 } else { 1687 } else {
1684 dasm_put(Dst, 9988); 1688 dasm_put(Dst, 9984);
1685 } 1689 }
1686 break; 1690 break;
1687 } 1691 }
1688 if (sse) { 1692 if (sse) {
1689 dasm_put(Dst, 9561); 1693 dasm_put(Dst, 9557);
1690 } else { 1694 } else {
1691 dasm_put(Dst, 9573); 1695 dasm_put(Dst, 9569);
1692 } 1696 }
1693 dasm_put(Dst, 7237); 1697 dasm_put(Dst, 7233);
1694 break; 1698 break;
1695 case BC_MODVN: 1699 case BC_MODVN:
1696 dasm_put(Dst, 9678); 1700 dasm_put(Dst, 9674);
1697 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1701 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1698 switch (vk) { 1702 switch (vk) {
1699 case 0: 1703 case 0:
1700 dasm_put(Dst, 9686, LJ_TISNUM); 1704 dasm_put(Dst, 9682, LJ_TISNUM);
1701 if (sse) { 1705 if (sse) {
1702 dasm_put(Dst, 9996); 1706 dasm_put(Dst, 9992);
1703 } else { 1707 } else {
1704 dasm_put(Dst, 10010); 1708 dasm_put(Dst, 10006);
1705 } 1709 }
1706 break; 1710 break;
1707 case 1: 1711 case 1:
1708 dasm_put(Dst, 9720, LJ_TISNUM); 1712 dasm_put(Dst, 9716, LJ_TISNUM);
1709 if (sse) { 1713 if (sse) {
1710 dasm_put(Dst, 10018); 1714 dasm_put(Dst, 10014);
1711 } else { 1715 } else {
1712 dasm_put(Dst, 10032); 1716 dasm_put(Dst, 10028);
1713 } 1717 }
1714 break; 1718 break;
1715 default: 1719 default:
1716 dasm_put(Dst, 9754, LJ_TISNUM, LJ_TISNUM); 1720 dasm_put(Dst, 9750, LJ_TISNUM, LJ_TISNUM);
1717 if (sse) { 1721 if (sse) {
1718 dasm_put(Dst, 10040); 1722 dasm_put(Dst, 10036);
1719 } else { 1723 } else {
1720 dasm_put(Dst, 10054); 1724 dasm_put(Dst, 10050);
1721 } 1725 }
1722 break; 1726 break;
1723 } 1727 }
1724 dasm_put(Dst, 10062); 1728 dasm_put(Dst, 10058);
1725 if (sse) { 1729 if (sse) {
1726 dasm_put(Dst, 9561); 1730 dasm_put(Dst, 9557);
1727 } else { 1731 } else {
1728 dasm_put(Dst, 9573); 1732 dasm_put(Dst, 9569);
1729 } 1733 }
1730 dasm_put(Dst, 7237); 1734 dasm_put(Dst, 7233);
1731 break; 1735 break;
1732 case BC_MODNV: case BC_MODVV: 1736 case BC_MODNV: case BC_MODVV:
1733 dasm_put(Dst, 9678); 1737 dasm_put(Dst, 9674);
1734 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1738 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1735 switch (vk) { 1739 switch (vk) {
1736 case 0: 1740 case 0:
1737 dasm_put(Dst, 9686, LJ_TISNUM); 1741 dasm_put(Dst, 9682, LJ_TISNUM);
1738 if (sse) { 1742 if (sse) {
1739 dasm_put(Dst, 9996); 1743 dasm_put(Dst, 9992);
1740 } else { 1744 } else {
1741 dasm_put(Dst, 10010); 1745 dasm_put(Dst, 10006);
1742 } 1746 }
1743 break; 1747 break;
1744 case 1: 1748 case 1:
1745 dasm_put(Dst, 9720, LJ_TISNUM); 1749 dasm_put(Dst, 9716, LJ_TISNUM);
1746 if (sse) { 1750 if (sse) {
1747 dasm_put(Dst, 10018); 1751 dasm_put(Dst, 10014);
1748 } else { 1752 } else {
1749 dasm_put(Dst, 10032); 1753 dasm_put(Dst, 10028);
1750 } 1754 }
1751 break; 1755 break;
1752 default: 1756 default:
1753 dasm_put(Dst, 9754, LJ_TISNUM, LJ_TISNUM); 1757 dasm_put(Dst, 9750, LJ_TISNUM, LJ_TISNUM);
1754 if (sse) { 1758 if (sse) {
1755 dasm_put(Dst, 10040); 1759 dasm_put(Dst, 10036);
1756 } else { 1760 } else {
1757 dasm_put(Dst, 10054); 1761 dasm_put(Dst, 10050);
1758 } 1762 }
1759 break; 1763 break;
1760 } 1764 }
1761 dasm_put(Dst, 10068); 1765 dasm_put(Dst, 10064);
1762 break; 1766 break;
1763 case BC_POW: 1767 case BC_POW:
1764 dasm_put(Dst, 9678); 1768 dasm_put(Dst, 9674);
1765 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1769 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1766 switch (vk) { 1770 switch (vk) {
1767 case 0: 1771 case 0:
1768 dasm_put(Dst, 9686, LJ_TISNUM); 1772 dasm_put(Dst, 9682, LJ_TISNUM);
1769 if (sse) { 1773 if (sse) {
1770 dasm_put(Dst, 9996); 1774 dasm_put(Dst, 9992);
1771 } else { 1775 } else {
1772 dasm_put(Dst, 10010); 1776 dasm_put(Dst, 10006);
1773 } 1777 }
1774 break; 1778 break;
1775 case 1: 1779 case 1:
1776 dasm_put(Dst, 9720, LJ_TISNUM); 1780 dasm_put(Dst, 9716, LJ_TISNUM);
1777 if (sse) { 1781 if (sse) {
1778 dasm_put(Dst, 10018); 1782 dasm_put(Dst, 10014);
1779 } else { 1783 } else {
1780 dasm_put(Dst, 10032); 1784 dasm_put(Dst, 10028);
1781 } 1785 }
1782 break; 1786 break;
1783 default: 1787 default:
1784 dasm_put(Dst, 9754, LJ_TISNUM, LJ_TISNUM); 1788 dasm_put(Dst, 9750, LJ_TISNUM, LJ_TISNUM);
1785 if (sse) { 1789 if (sse) {
1786 dasm_put(Dst, 10040); 1790 dasm_put(Dst, 10036);
1787 } else { 1791 } else {
1788 dasm_put(Dst, 10054); 1792 dasm_put(Dst, 10050);
1789 } 1793 }
1790 break; 1794 break;
1791 } 1795 }
1792 dasm_put(Dst, 10073); 1796 dasm_put(Dst, 10069);
1793 if (sse) { 1797 if (sse) {
1794 dasm_put(Dst, 9561); 1798 dasm_put(Dst, 9557);
1795 } else { 1799 } else {
1796 dasm_put(Dst, 9573); 1800 dasm_put(Dst, 9569);
1797 } 1801 }
1798 dasm_put(Dst, 7237); 1802 dasm_put(Dst, 7233);
1799 break; 1803 break;
1800 1804
1801 case BC_CAT: 1805 case BC_CAT:
1802 dasm_put(Dst, 10077, Dt1(->base), Dt1(->base)); 1806 dasm_put(Dst, 10073, Dt1(->base), Dt1(->base));
1803 break; 1807 break;
1804 1808
1805 /* -- Constant ops ------------------------------------------------------ */ 1809 /* -- Constant ops ------------------------------------------------------ */
1806 1810
1807 case BC_KSTR: 1811 case BC_KSTR:
1808 dasm_put(Dst, 10167, LJ_TSTR); 1812 dasm_put(Dst, 10163, LJ_TSTR);
1809 break; 1813 break;
1810 case BC_KSHORT: 1814 case BC_KSHORT:
1811 if (sse) { 1815 if (sse) {
1812 dasm_put(Dst, 10202); 1816 dasm_put(Dst, 10198);
1813 } else { 1817 } else {
1814 dasm_put(Dst, 10217); 1818 dasm_put(Dst, 10213);
1815 } 1819 }
1816 dasm_put(Dst, 7237); 1820 dasm_put(Dst, 7233);
1817 break; 1821 break;
1818 case BC_KNUM: 1822 case BC_KNUM:
1819 if (sse) { 1823 if (sse) {
1820 dasm_put(Dst, 10225); 1824 dasm_put(Dst, 10221);
1821 } else { 1825 } else {
1822 dasm_put(Dst, 10238); 1826 dasm_put(Dst, 10234);
1823 } 1827 }
1824 dasm_put(Dst, 7237); 1828 dasm_put(Dst, 7233);
1825 break; 1829 break;
1826 case BC_KPRI: 1830 case BC_KPRI:
1827 dasm_put(Dst, 10245); 1831 dasm_put(Dst, 10241);
1828 break; 1832 break;
1829 case BC_KNIL: 1833 case BC_KNIL:
1830 dasm_put(Dst, 10273, LJ_TNIL); 1834 dasm_put(Dst, 10269, LJ_TNIL);
1831 break; 1835 break;
1832 1836
1833 /* -- Upvalue and function ops ------------------------------------------ */ 1837 /* -- Upvalue and function ops ------------------------------------------ */
1834 1838
1835 case BC_UGET: 1839 case BC_UGET:
1836 dasm_put(Dst, 10320, offsetof(GCfuncL, uvptr), DtA(->v)); 1840 dasm_put(Dst, 10316, offsetof(GCfuncL, uvptr), DtA(->v));
1837 break; 1841 break;
1838 case BC_USETV: 1842 case BC_USETV:
1839#define TV2MARKOFS \ 1843#define TV2MARKOFS \
1840 ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) 1844 ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv))
1841 dasm_put(Dst, 10365, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); 1845 dasm_put(Dst, 10361, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G);
1842 dasm_put(Dst, 10456); 1846 dasm_put(Dst, 10452);
1843 break; 1847 break;
1844#undef TV2MARKOFS 1848#undef TV2MARKOFS
1845 case BC_USETS: 1849 case BC_USETS:
1846 dasm_put(Dst, 10468, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); 1850 dasm_put(Dst, 10464, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G);
1847 break; 1851 break;
1848 case BC_USETN: 1852 case BC_USETN:
1849 dasm_put(Dst, 10561); 1853 dasm_put(Dst, 10557);
1850 if (sse) { 1854 if (sse) {
1851 dasm_put(Dst, 10566); 1855 dasm_put(Dst, 10562);
1852 } else { 1856 } else {
1853 dasm_put(Dst, 9381); 1857 dasm_put(Dst, 9377);
1854 } 1858 }
1855 dasm_put(Dst, 10573, offsetof(GCfuncL, uvptr), DtA(->v)); 1859 dasm_put(Dst, 10569, offsetof(GCfuncL, uvptr), DtA(->v));
1856 if (sse) { 1860 if (sse) {
1857 dasm_put(Dst, 10582); 1861 dasm_put(Dst, 10578);
1858 } else { 1862 } else {
1859 dasm_put(Dst, 10588); 1863 dasm_put(Dst, 10584);
1860 } 1864 }
1861 dasm_put(Dst, 7237); 1865 dasm_put(Dst, 7233);
1862 break; 1866 break;
1863 case BC_USETP: 1867 case BC_USETP:
1864 dasm_put(Dst, 10591, offsetof(GCfuncL, uvptr), DtA(->v)); 1868 dasm_put(Dst, 10587, offsetof(GCfuncL, uvptr), DtA(->v));
1865 break; 1869 break;
1866 case BC_UCLO: 1870 case BC_UCLO:
1867 dasm_put(Dst, 10630, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); 1871 dasm_put(Dst, 10626, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base));
1868 break; 1872 break;
1869 1873
1870 case BC_FNEW: 1874 case BC_FNEW:
1871 dasm_put(Dst, 10685, Dt1(->base), Dt1(->base), LJ_TFUNC); 1875 dasm_put(Dst, 10681, Dt1(->base), Dt1(->base), LJ_TFUNC);
1872 break; 1876 break;
1873 1877
1874 /* -- Table ops --------------------------------------------------------- */ 1878 /* -- Table ops --------------------------------------------------------- */
1875 1879
1876 case BC_TNEW: 1880 case BC_TNEW:
1877 dasm_put(Dst, 10751, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB); 1881 dasm_put(Dst, 10747, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), LJ_TTAB);
1878 break; 1882 break;
1879 case BC_TDUP: 1883 case BC_TDUP:
1880 dasm_put(Dst, 10872, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); 1884 dasm_put(Dst, 10868, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB);
1881 break; 1885 break;
1882 1886
1883 case BC_GGET: 1887 case BC_GGET:
1884 dasm_put(Dst, 10967, Dt7(->env)); 1888 dasm_put(Dst, 10963, Dt7(->env));
1885 break; 1889 break;
1886 case BC_GSET: 1890 case BC_GSET:
1887 dasm_put(Dst, 10986, Dt7(->env)); 1891 dasm_put(Dst, 10982, Dt7(->env));
1888 break; 1892 break;
1889 1893
1890 case BC_TGETV: 1894 case BC_TGETV:
1891 dasm_put(Dst, 11005, LJ_TTAB, LJ_TISNUM); 1895 dasm_put(Dst, 11001, LJ_TTAB, LJ_TISNUM);
1892 if (sse) { 1896 if (sse) {
1893 dasm_put(Dst, 11038); 1897 dasm_put(Dst, 11034);
1894 } else { 1898 } else {
1895 } 1899 }
1896 dasm_put(Dst, 11059, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 1900 dasm_put(Dst, 11055, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
1897 dasm_put(Dst, 11152, LJ_TSTR); 1901 dasm_put(Dst, 11148, LJ_TSTR);
1898 break; 1902 break;
1899 case BC_TGETS: 1903 case BC_TGETS:
1900 dasm_put(Dst, 11170, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); 1904 dasm_put(Dst, 11166, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL);
1901 dasm_put(Dst, 11255, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 1905 dasm_put(Dst, 11251, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
1902 break; 1906 break;
1903 case BC_TGETB: 1907 case BC_TGETB:
1904 dasm_put(Dst, 11327, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 1908 dasm_put(Dst, 11323, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
1905 dasm_put(Dst, 9668); 1909 dasm_put(Dst, 9664);
1906 break; 1910 break;
1907 1911
1908 case BC_TSETV: 1912 case BC_TSETV:
1909 dasm_put(Dst, 11427, LJ_TTAB, LJ_TISNUM); 1913 dasm_put(Dst, 11423, LJ_TTAB, LJ_TISNUM);
1910 if (sse) { 1914 if (sse) {
1911 dasm_put(Dst, 11038); 1915 dasm_put(Dst, 11034);
1912 } else { 1916 } else {
1913 } 1917 }
1914 dasm_put(Dst, 11460, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); 1918 dasm_put(Dst, 11456, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable));
1915 dasm_put(Dst, 11544, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 1919 dasm_put(Dst, 11540, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1916 break; 1920 break;
1917 case BC_TSETS: 1921 case BC_TSETS:
1918 dasm_put(Dst, 11606, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); 1922 dasm_put(Dst, 11602, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL);
1919 dasm_put(Dst, 11682, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); 1923 dasm_put(Dst, 11678, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next));
1920 dasm_put(Dst, 11775, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 1924 dasm_put(Dst, 11771, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1921 break; 1925 break;
1922 case BC_TSETB: 1926 case BC_TSETB:
1923 dasm_put(Dst, 11866, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); 1927 dasm_put(Dst, 11862, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable));
1924 dasm_put(Dst, 11965, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 1928 dasm_put(Dst, 11961, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1925 break; 1929 break;
1926 1930
1927 case BC_TSETM: 1931 case BC_TSETM:
1928 dasm_put(Dst, 12011); 1932 dasm_put(Dst, 12007);
1929 if (sse) { 1933 if (sse) {
1930 dasm_put(Dst, 10566); 1934 dasm_put(Dst, 10562);
1931 } else { 1935 } else {
1932 } 1936 }
1933 dasm_put(Dst, 12016, Dt6(->marked), LJ_GC_BLACK); 1937 dasm_put(Dst, 12012, Dt6(->marked), LJ_GC_BLACK);
1934 if (sse) { 1938 if (sse) {
1935 dasm_put(Dst, 12041); 1939 dasm_put(Dst, 12037);
1936 } else { 1940 } else {
1937 } 1941 }
1938 dasm_put(Dst, 12048, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); 1942 dasm_put(Dst, 12044, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain));
1939 dasm_put(Dst, 12174, Dt6(->gclist)); 1943 dasm_put(Dst, 12170, Dt6(->gclist));
1940 break; 1944 break;
1941 1945
1942 /* -- Calls and vararg handling ----------------------------------------- */ 1946 /* -- Calls and vararg handling ----------------------------------------- */
1943 1947
1944 case BC_CALL: case BC_CALLM: 1948 case BC_CALL: case BC_CALLM:
1945 dasm_put(Dst, 9682); 1949 dasm_put(Dst, 9678);
1946 if (op == BC_CALLM) { 1950 if (op == BC_CALLM) {
1947 dasm_put(Dst, 12182); 1951 dasm_put(Dst, 12178);
1948 } 1952 }
1949 dasm_put(Dst, 12187, LJ_TFUNC, Dt7(->pc)); 1953 dasm_put(Dst, 12183, LJ_TFUNC, Dt7(->pc));
1950 break; 1954 break;
1951 1955
1952 case BC_CALLMT: 1956 case BC_CALLMT:
1953 dasm_put(Dst, 12182); 1957 dasm_put(Dst, 12178);
1954 break; 1958 break;
1955 case BC_CALLT: 1959 case BC_CALLT:
1956 dasm_put(Dst, 12229, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); 1960 dasm_put(Dst, 12225, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
1957 dasm_put(Dst, 12348, FRAME_TYPE, Dt7(->pc), PC2PROTO(k)); 1961 dasm_put(Dst, 12344, FRAME_TYPE, Dt7(->pc), PC2PROTO(k));
1958 break; 1962 break;
1959 1963
1960 case BC_ITERC: 1964 case BC_ITERC:
1961 dasm_put(Dst, 12406, LJ_TFUNC, 2+1, Dt7(->pc)); 1965 dasm_put(Dst, 12402, LJ_TFUNC, 2+1, Dt7(->pc));
1962 break; 1966 break;
1963 1967
1964 case BC_VARG: 1968 case BC_VARG:
1965 dasm_put(Dst, 12487, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); 1969 dasm_put(Dst, 12483, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
1966 dasm_put(Dst, 12632, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 1970 dasm_put(Dst, 12628, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
1967 break; 1971 break;
1968 1972
1969 /* -- Returns ----------------------------------------------------------- */ 1973 /* -- Returns ----------------------------------------------------------- */
1970 1974
1971 case BC_RETM: 1975 case BC_RETM:
1972 dasm_put(Dst, 12182); 1976 dasm_put(Dst, 12178);
1973 break; 1977 break;
1974 1978
1975 case BC_RET: case BC_RET0: case BC_RET1: 1979 case BC_RET: case BC_RET0: case BC_RET1:
1976 if (op != BC_RET0) { 1980 if (op != BC_RET0) {
1977 dasm_put(Dst, 12731); 1981 dasm_put(Dst, 12727);
1978 } 1982 }
1979 dasm_put(Dst, 12735, FRAME_TYPE); 1983 dasm_put(Dst, 12731, FRAME_TYPE);
1980 switch (op) { 1984 switch (op) {
1981 case BC_RET: 1985 case BC_RET:
1982 dasm_put(Dst, 12754); 1986 dasm_put(Dst, 12750);
1983 break; 1987 break;
1984 case BC_RET1: 1988 case BC_RET1:
1985 dasm_put(Dst, 12812); 1989 dasm_put(Dst, 12808);
1986 /* fallthrough */ 1990 /* fallthrough */
1987 case BC_RET0: 1991 case BC_RET0:
1988 dasm_put(Dst, 12828); 1992 dasm_put(Dst, 12824);
1989 default: 1993 default:
1990 break; 1994 break;
1991 } 1995 }
1992 dasm_put(Dst, 12839, Dt7(->pc), PC2PROTO(k)); 1996 dasm_put(Dst, 12835, Dt7(->pc), PC2PROTO(k));
1993 if (op == BC_RET) { 1997 if (op == BC_RET) {
1994 dasm_put(Dst, 12883, LJ_TNIL); 1998 dasm_put(Dst, 12879, LJ_TNIL);
1995 } else { 1999 } else {
1996 dasm_put(Dst, 12892, LJ_TNIL); 2000 dasm_put(Dst, 12888, LJ_TNIL);
1997 } 2001 }
1998 dasm_put(Dst, 12899); 2002 dasm_put(Dst, 12895);
1999 if (op != BC_RET0) { 2003 if (op != BC_RET0) {
2000 dasm_put(Dst, 12920); 2004 dasm_put(Dst, 12916);
2001 } 2005 }
2002 dasm_put(Dst, 4542); 2006 dasm_put(Dst, 4542);
2003 break; 2007 break;
@@ -2007,7 +2011,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2007 2011
2008 case BC_FORL: 2012 case BC_FORL:
2009#if LJ_HASJIT 2013#if LJ_HASJIT
2010 dasm_put(Dst, 12924, HOTCOUNT_PCMASK, GG_DISP2HOT); 2014 dasm_put(Dst, 12920, HOTCOUNT_PCMASK, GG_DISP2HOT);
2011#endif 2015#endif
2012 break; 2016 break;
2013 2017
@@ -2019,57 +2023,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2019 case BC_FORI: 2023 case BC_FORI:
2020 case BC_IFORL: 2024 case BC_IFORL:
2021 vk = (op == BC_IFORL || op == BC_JFORL); 2025 vk = (op == BC_IFORL || op == BC_JFORL);
2022 dasm_put(Dst, 12945); 2026 dasm_put(Dst, 12941);
2023 if (!vk) { 2027 if (!vk) {
2024 dasm_put(Dst, 12949, LJ_TISNUM, LJ_TISNUM); 2028 dasm_put(Dst, 12945, LJ_TISNUM, LJ_TISNUM);
2025 } 2029 }
2026 dasm_put(Dst, 12968); 2030 dasm_put(Dst, 12964);
2027 if (!vk) { 2031 if (!vk) {
2028 dasm_put(Dst, 12972, LJ_TISNUM); 2032 dasm_put(Dst, 12968, LJ_TISNUM);
2029 } 2033 }
2030 if (sse) { 2034 if (sse) {
2031 dasm_put(Dst, 12981); 2035 dasm_put(Dst, 12977);
2032 if (vk) { 2036 if (vk) {
2033 dasm_put(Dst, 12993); 2037 dasm_put(Dst, 12989);
2034 } else { 2038 } else {
2035 dasm_put(Dst, 13012); 2039 dasm_put(Dst, 13008);
2036 } 2040 }
2037 dasm_put(Dst, 13017); 2041 dasm_put(Dst, 13013);
2038 } else { 2042 } else {
2039 dasm_put(Dst, 13030); 2043 dasm_put(Dst, 13026);
2040 if (vk) { 2044 if (vk) {
2041 dasm_put(Dst, 13036); 2045 dasm_put(Dst, 13032);
2042 } else { 2046 } else {
2043 dasm_put(Dst, 13052); 2047 dasm_put(Dst, 13048);
2044 } 2048 }
2045 dasm_put(Dst, 13060); 2049 dasm_put(Dst, 13056);
2046 if (cmov) { 2050 if (cmov) {
2047 dasm_put(Dst, 9105); 2051 dasm_put(Dst, 9101);
2048 } else { 2052 } else {
2049 dasm_put(Dst, 9111); 2053 dasm_put(Dst, 9107);
2050 } 2054 }
2051 if (!cmov) { 2055 if (!cmov) {
2052 dasm_put(Dst, 13065); 2056 dasm_put(Dst, 13061);
2053 } 2057 }
2054 } 2058 }
2055 if (op == BC_FORI) { 2059 if (op == BC_FORI) {
2056 dasm_put(Dst, 13071, -BCBIAS_J*4); 2060 dasm_put(Dst, 13067, -BCBIAS_J*4);
2057 } else if (op == BC_JFORI) { 2061 } else if (op == BC_JFORI) {
2058 dasm_put(Dst, 13081, -BCBIAS_J*4, BC_JLOOP); 2062 dasm_put(Dst, 13077, -BCBIAS_J*4, BC_JLOOP);
2059 } else if (op == BC_IFORL) { 2063 } else if (op == BC_IFORL) {
2060 dasm_put(Dst, 13095, -BCBIAS_J*4); 2064 dasm_put(Dst, 13091, -BCBIAS_J*4);
2061 } else { 2065 } else {
2062 dasm_put(Dst, 13091, BC_JLOOP); 2066 dasm_put(Dst, 13087, BC_JLOOP);
2063 } 2067 }
2064 dasm_put(Dst, 9140); 2068 dasm_put(Dst, 9136);
2065 if (sse) { 2069 if (sse) {
2066 dasm_put(Dst, 13105); 2070 dasm_put(Dst, 13101);
2067 } 2071 }
2068 break; 2072 break;
2069 2073
2070 case BC_ITERL: 2074 case BC_ITERL:
2071#if LJ_HASJIT 2075#if LJ_HASJIT
2072 dasm_put(Dst, 12924, HOTCOUNT_PCMASK, GG_DISP2HOT); 2076 dasm_put(Dst, 12920, HOTCOUNT_PCMASK, GG_DISP2HOT);
2073#endif 2077#endif
2074 break; 2078 break;
2075 2079
@@ -2078,33 +2082,33 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2078 break; 2082 break;
2079#endif 2083#endif
2080 case BC_IITERL: 2084 case BC_IITERL:
2081 dasm_put(Dst, 13116, LJ_TNIL); 2085 dasm_put(Dst, 13112, LJ_TNIL);
2082 if (op == BC_JITERL) { 2086 if (op == BC_JITERL) {
2083 dasm_put(Dst, 13131, BC_JLOOP); 2087 dasm_put(Dst, 13127, BC_JLOOP);
2084 } else { 2088 } else {
2085 dasm_put(Dst, 13145, -BCBIAS_J*4); 2089 dasm_put(Dst, 13141, -BCBIAS_J*4);
2086 } 2090 }
2087 dasm_put(Dst, 9440); 2091 dasm_put(Dst, 9436);
2088 break; 2092 break;
2089 2093
2090 case BC_LOOP: 2094 case BC_LOOP:
2091#if LJ_HASJIT 2095#if LJ_HASJIT
2092 dasm_put(Dst, 12924, HOTCOUNT_PCMASK, GG_DISP2HOT); 2096 dasm_put(Dst, 12920, HOTCOUNT_PCMASK, GG_DISP2HOT);
2093#endif 2097#endif
2094 break; 2098 break;
2095 2099
2096 case BC_ILOOP: 2100 case BC_ILOOP:
2097 dasm_put(Dst, 7237); 2101 dasm_put(Dst, 7233);
2098 break; 2102 break;
2099 2103
2100 case BC_JLOOP: 2104 case BC_JLOOP:
2101#if LJ_HASJIT 2105#if LJ_HASJIT
2102 dasm_put(Dst, 13161, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); 2106 dasm_put(Dst, 13157, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
2103#endif 2107#endif
2104 break; 2108 break;
2105 2109
2106 case BC_JMP: 2110 case BC_JMP:
2107 dasm_put(Dst, 13185, -BCBIAS_J*4); 2111 dasm_put(Dst, 13181, -BCBIAS_J*4);
2108 break; 2112 break;
2109 2113
2110 /* -- Function headers -------------------------------------------------- */ 2114 /* -- Function headers -------------------------------------------------- */
@@ -2127,13 +2131,13 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2127 break; 2131 break;
2128#endif 2132#endif
2129 case BC_IFUNCF: 2133 case BC_IFUNCF:
2130 dasm_put(Dst, 13210, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); 2134 dasm_put(Dst, 13206, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
2131 if (op == BC_JFUNCF) { 2135 if (op == BC_JFUNCF) {
2132 dasm_put(Dst, 13240, BC_JLOOP); 2136 dasm_put(Dst, 13236, BC_JLOOP);
2133 } else { 2137 } else {
2134 dasm_put(Dst, 7237); 2138 dasm_put(Dst, 7233);
2135 } 2139 }
2136 dasm_put(Dst, 13249, LJ_TNIL); 2140 dasm_put(Dst, 13245, LJ_TNIL);
2137 break; 2141 break;
2138 2142
2139 case BC_JFUNCV: 2143 case BC_JFUNCV:
@@ -2144,30 +2148,30 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2144 break; /* NYI: compiled vararg functions. */ 2148 break; /* NYI: compiled vararg functions. */
2145 2149
2146 case BC_IFUNCV: 2150 case BC_IFUNCV:
2147 dasm_put(Dst, 13271, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); 2151 dasm_put(Dst, 13267, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
2148 if (op == BC_JFUNCV) { 2152 if (op == BC_JFUNCV) {
2149 dasm_put(Dst, 13240, BC_JLOOP); 2153 dasm_put(Dst, 13236, BC_JLOOP);
2150 } else { 2154 } else {
2151 dasm_put(Dst, 13362, -4+PC2PROTO(k)); 2155 dasm_put(Dst, 13358, -4+PC2PROTO(k));
2152 } 2156 }
2153 dasm_put(Dst, 13385, LJ_TNIL); 2157 dasm_put(Dst, 13381, LJ_TNIL);
2154 break; 2158 break;
2155 2159
2156 case BC_FUNCC: 2160 case BC_FUNCC:
2157 case BC_FUNCCW: 2161 case BC_FUNCCW:
2158 dasm_put(Dst, 13407, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); 2162 dasm_put(Dst, 13403, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
2159 if (op == BC_FUNCC) { 2163 if (op == BC_FUNCC) {
2160 dasm_put(Dst, 13437); 2164 dasm_put(Dst, 13433);
2161 } else { 2165 } else {
2162 dasm_put(Dst, 13441); 2166 dasm_put(Dst, 13437);
2163 } 2167 }
2164 dasm_put(Dst, 13449, DISPATCH_GL(vmstate), ~LJ_VMST_C); 2168 dasm_put(Dst, 13445, DISPATCH_GL(vmstate), ~LJ_VMST_C);
2165 if (op == BC_FUNCC) { 2169 if (op == BC_FUNCC) {
2166 dasm_put(Dst, 13458); 2170 dasm_put(Dst, 13454);
2167 } else { 2171 } else {
2168 dasm_put(Dst, 13462, DISPATCH_GL(wrapf)); 2172 dasm_put(Dst, 13458, DISPATCH_GL(wrapf));
2169 } 2173 }
2170 dasm_put(Dst, 13467, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); 2174 dasm_put(Dst, 13463, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
2171 break; 2175 break;
2172 2176
2173 /* ---------------------------------------------------------------------- */ 2177 /* ---------------------------------------------------------------------- */
@@ -2195,7 +2199,7 @@ static int build_backend(BuildCtx *ctx)
2195 2199
2196 build_subroutines(ctx, cmov, sse); 2200 build_subroutines(ctx, cmov, sse);
2197 2201
2198 dasm_put(Dst, 13492); 2202 dasm_put(Dst, 13488);
2199 for (op = 0; op < BC__MAX; op++) 2203 for (op = 0; op < BC__MAX; op++)
2200 build_ins(ctx, (BCOp)op, op, cmov, sse); 2204 build_ins(ctx, (BCOp)op, op, cmov, sse);
2201 2205
diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc
index 9d201f91..5ec87aa8 100644
--- a/src/buildvm_x86.dasc
+++ b/src/buildvm_x86.dasc
@@ -2518,14 +2518,15 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
2518#endif 2518#endif
2519 | 2519 |
2520 |->vm_callhook: // Dispatch target for call hooks. 2520 |->vm_callhook: // Dispatch target for call hooks.
2521 | mov SAVE_PC, PC
2521#if LJ_HASJIT 2522#if LJ_HASJIT
2522 | mov aword [DISPATCH+DISPATCH_J(L)], 0 // Marker for call hook.
2523 | jmp >1 2523 | jmp >1
2524#endif 2524#endif
2525 | 2525 |
2526 |->vm_hotcall: // Hot call counter underflow. 2526 |->vm_hotcall: // Hot call counter underflow.
2527#if LJ_HASJIT 2527#if LJ_HASJIT
2528 | mov aword [DISPATCH+DISPATCH_J(L)], L:RBa 2528 | mov SAVE_PC, PC
2529 | or PC, 1 // Marker for hot call.
2529 |1: 2530 |1:
2530#endif 2531#endif
2531 | lea RD, [BASE+NARGS:RD*8-8] 2532 | lea RD, [BASE+NARGS:RD*8-8]
@@ -2534,10 +2535,12 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
2534 | mov L:RB->top, RD 2535 | mov L:RB->top, RD
2535 | mov FCARG2, PC 2536 | mov FCARG2, PC
2536 | mov FCARG1, L:RB 2537 | mov FCARG1, L:RB
2537 | mov SAVE_PC, PC
2538 | call extern lj_dispatch_call@8 // (lua_State *L, const BCIns *pc) 2538 | call extern lj_dispatch_call@8 // (lua_State *L, const BCIns *pc)
2539 | // ASMFunction returned in eax/rax (RDa). 2539 | // ASMFunction returned in eax/rax (RDa).
2540 | mov SAVE_PC, 0 // Invalidate for subsequent line hook. 2540 | mov SAVE_PC, 0 // Invalidate for subsequent line hook.
2541#if LJ_HASJIT
2542 | and PC, -2
2543#endif
2541 | mov BASE, L:RB->base 2544 | mov BASE, L:RB->base
2542 | mov RAa, RDa 2545 | mov RAa, RDa
2543 | mov RD, L:RB->top 2546 | mov RD, L:RB->top
diff --git a/src/buildvm_x86.h b/src/buildvm_x86.h
index cc1ac38d..ef160e61 100644
--- a/src/buildvm_x86.h
+++ b/src/buildvm_x86.h
@@ -12,7 +12,7 @@
12#define DASM_SECTION_CODE_OP 0 12#define DASM_SECTION_CODE_OP 0
13#define DASM_SECTION_CODE_SUB 1 13#define DASM_SECTION_CODE_SUB 1
14#define DASM_MAXSECTION 2 14#define DASM_MAXSECTION 2
15static const unsigned char build_actionlist[15167] = { 15static const unsigned char build_actionlist[15165] = {
16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,141, 16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,141,
17 76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36, 17 76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,
18 20,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10,199, 18 20,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10,199,
@@ -406,30 +406,30 @@ static const unsigned char build_actionlist[15167] = {
406 183,70,252,254,252,255,164,253,171,233,248,139,131,198,4,139,77,232,137,76, 406 183,70,252,254,252,255,164,253,171,233,248,139,131,198,4,139,77,232,137,76,
407 36,20,252,233,244,4,248,140,255,139,106,252,248,139,173,233,15,182,133,233, 407 36,20,252,233,244,4,248,140,255,139,106,252,248,139,173,233,15,182,133,233,
408 141,4,194,139,108,36,48,137,149,233,137,133,233,137,252,242,141,139,233,137, 408 141,4,194,139,108,36,48,137,149,233,137,133,233,137,252,242,141,139,233,137,
409 171,233,137,116,36,24,232,251,1,21,252,233,244,3,255,248,141,255,199,131, 409 171,233,137,116,36,24,232,251,1,21,252,233,244,3,255,248,141,137,116,36,24,
410 233,0,0,0,0,252,233,244,247,255,248,142,255,137,171,233,248,1,255,141,68, 410 255,248,142,255,137,116,36,24,131,206,1,248,1,255,141,68,194,252,248,139,
411 194,252,248,139,108,36,48,137,149,233,137,133,233,137,252,242,137,252,233, 411 108,36,48,137,149,233,137,133,233,137,252,242,137,252,233,232,251,1,22,199,
412 137,116,36,24,232,251,1,22,199,68,36,24,0,0,0,0,139,149,233,137,193,139,133, 412 68,36,24,0,0,0,0,255,131,230,252,254,255,139,149,233,137,193,139,133,233,
413 233,41,208,137,205,15,182,78,252,253,193,232,3,131,192,1,252,255,229,248, 413 41,208,137,205,15,182,78,252,253,193,232,3,131,192,1,252,255,229,248,143,
414 143,255,85,141,108,36,12,85,83,82,81,80,15,182,69,252,252,138,101,252,248, 414 255,85,141,108,36,12,85,83,82,81,80,15,182,69,252,252,138,101,252,248,137,
415 137,125,252,252,137,117,252,248,139,93,0,139,139,233,199,131,233,237,137, 415 125,252,252,137,117,252,248,139,93,0,139,139,233,199,131,233,237,137,131,
416 131,233,137,139,233,129,252,236,239,252,247,131,233,237,15,132,244,247,252, 416 233,137,139,233,129,252,236,239,252,247,131,233,237,15,132,244,247,252,242,
417 242,15,17,125,216,252,242,15,17,117,208,252,242,15,17,109,200,252,242,15, 417 15,17,125,216,252,242,15,17,117,208,252,242,15,17,109,200,252,242,15,17,101,
418 17,101,192,252,242,15,17,93,184,252,242,15,17,85,176,252,242,15,17,77,168, 418 192,252,242,15,17,93,184,252,242,15,17,85,176,252,242,15,17,77,168,252,242,
419 252,242,15,17,69,160,248,1,139,171,233,139,147,233,137,171,233,137,149,233, 419 15,17,69,160,248,1,139,171,233,139,147,233,137,171,233,137,149,233,141,84,
420 141,84,36,16,141,139,233,232,251,1,23,137,196,139,149,233,139,116,36,24,137, 420 36,16,141,139,233,232,251,1,23,137,196,139,149,233,139,116,36,24,137,108,
421 108,36,48,255,248,144,255,139,122,252,248,139,191,233,139,191,233,199,131, 421 36,48,255,248,144,255,139,122,252,248,139,191,233,139,191,233,199,131,233,
422 233,0,0,0,0,199,131,233,237,139,6,15,182,204,15,182,232,131,198,4,193,232, 422 0,0,0,0,199,131,233,237,139,6,15,182,204,15,182,232,131,198,4,193,232,16,
423 16,252,255,36,171,255,248,82,255,217,124,36,4,137,68,36,8,102,184,0,4,102, 423 252,255,36,171,255,248,82,255,217,124,36,4,137,68,36,8,102,184,0,4,102,11,
424 11,68,36,4,102,37,252,255,252,247,102,137,68,36,6,217,108,36,6,217,252,252, 424 68,36,4,102,37,252,255,252,247,102,137,68,36,6,217,108,36,6,217,252,252,217,
425 217,108,36,4,139,68,36,8,195,255,248,145,102,15,252,239,210,102,15,118,210, 425 108,36,4,139,68,36,8,195,255,248,145,102,15,252,239,210,102,15,118,210,102,
426 102,15,115,210,1,184,0,0,48,67,102,15,110,216,102,15,112,219,81,15,40,200, 426 15,115,210,1,184,0,0,48,67,102,15,110,216,102,15,112,219,81,15,40,200,102,
427 102,15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,252,242,15,88,203, 427 15,84,202,102,15,46,217,15,134,244,247,102,15,85,208,252,242,15,88,203,252,
428 252,242,15,92,203,102,15,86,202,184,0,0,252,240,63,102,15,110,208,102,15, 428 242,15,92,203,102,15,86,202,184,0,0,252,240,63,102,15,110,208,102,15,112,
429 112,210,81,252,242,15,194,193,1,102,15,84,194,252,242,15,92,200,15,40,193, 429 210,81,252,242,15,194,193,1,102,15,84,194,252,242,15,92,200,15,40,193,248,
430 248,1,195,248,84,255,217,124,36,4,137,68,36,8,102,184,0,8,102,11,68,36,4, 430 1,195,248,84,255,217,124,36,4,137,68,36,8,102,184,0,8,102,11,68,36,4,102,
431 102,37,252,255,252,251,102,137,68,36,6,217,108,36,6,217,252,252,217,108,36, 431 37,252,255,252,251,102,137,68,36,6,217,108,36,6,217,252,252,217,108,36,4,
432 4,139,68,36,8,195,255,248,146,102,15,252,239,210,102,15,118,210,102,15,115, 432 139,68,36,8,195,255,248,146,102,15,252,239,210,102,15,118,210,102,15,115,
433 210,1,184,0,0,48,67,102,15,110,216,102,15,112,219,81,15,40,200,102,15,84, 433 210,1,184,0,0,48,67,102,15,110,216,102,15,112,219,81,15,40,200,102,15,84,
434 202,102,15,46,217,15,134,244,247,102,15,85,208,252,242,15,88,203,252,242, 434 202,102,15,46,217,15,134,244,247,102,15,85,208,252,242,15,88,203,252,242,
435 15,92,203,102,15,86,202,184,0,0,252,240,191,102,15,110,208,102,15,112,210, 435 15,92,203,102,15,86,202,184,0,0,252,240,191,102,15,110,208,102,15,112,210,
@@ -1441,99 +1441,103 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
1441#endif 1441#endif
1442 dasm_put(Dst, 8157); 1442 dasm_put(Dst, 8157);
1443#if LJ_HASJIT 1443#if LJ_HASJIT
1444 dasm_put(Dst, 8160, DISPATCH_J(L)); 1444 dasm_put(Dst, 7989);
1445#endif 1445#endif
1446 dasm_put(Dst, 8172); 1446 dasm_put(Dst, 8164);
1447#if LJ_HASJIT 1447#if LJ_HASJIT
1448 dasm_put(Dst, 8175, DISPATCH_J(L)); 1448 dasm_put(Dst, 8167);
1449#endif 1449#endif
1450 dasm_put(Dst, 8181, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 1450 dasm_put(Dst, 8177, Dt1(->base), Dt1(->top));
1451#if LJ_HASJIT 1451#if LJ_HASJIT
1452 dasm_put(Dst, 8247, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 8*8+16, DISPATCH_J(flags), JIT_F_SSE2, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), Dt1(->base), GG_DISP2J, Dt1(->base)); 1452 dasm_put(Dst, 8211);
1453#endif 1453#endif
1454 dasm_put(Dst, 8390); 1454 dasm_put(Dst, 8216, Dt1(->base), Dt1(->top));
1455#if LJ_HASJIT 1455#if LJ_HASJIT
1456 dasm_put(Dst, 8393, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP); 1456 dasm_put(Dst, 8245, DISPATCH_GL(vmstate), DISPATCH_GL(vmstate), ~LJ_VMST_EXIT, DISPATCH_J(exitno), DISPATCH_J(parent), 8*8+16, DISPATCH_J(flags), JIT_F_SSE2, DISPATCH_GL(jit_L), DISPATCH_GL(jit_base), DISPATCH_J(L), Dt1(->base), GG_DISP2J, Dt1(->base));
1457#endif 1457#endif
1458 dasm_put(Dst, 8433); 1458 dasm_put(Dst, 8388);
1459#if LJ_HASJIT
1460 dasm_put(Dst, 8391, Dt7(->pc), PC2PROTO(k), DISPATCH_GL(jit_L), DISPATCH_GL(vmstate), ~LJ_VMST_INTERP);
1461#endif
1462 dasm_put(Dst, 8431);
1459 if (!sse) { 1463 if (!sse) {
1460 dasm_put(Dst, 8436); 1464 dasm_put(Dst, 8434);
1461 } 1465 }
1462 dasm_put(Dst, 8481); 1466 dasm_put(Dst, 8479);
1463 if (!sse) { 1467 if (!sse) {
1464 dasm_put(Dst, 8583); 1468 dasm_put(Dst, 8581);
1465 } 1469 }
1466 dasm_put(Dst, 8628); 1470 dasm_put(Dst, 8626);
1467 if (!sse) { 1471 if (!sse) {
1468 dasm_put(Dst, 8730); 1472 dasm_put(Dst, 8728);
1469 } 1473 }
1470 dasm_put(Dst, 8769); 1474 dasm_put(Dst, 8767);
1471 if (sse) { 1475 if (sse) {
1472 dasm_put(Dst, 8874); 1476 dasm_put(Dst, 8872);
1473 } else { 1477 } else {
1474 dasm_put(Dst, 9004); 1478 dasm_put(Dst, 9002);
1475 } 1479 }
1476 dasm_put(Dst, 9051); 1480 dasm_put(Dst, 9049);
1477 if (!sse) { 1481 if (!sse) {
1478 dasm_put(Dst, 9125); 1482 dasm_put(Dst, 9123);
1479 if (cmov) { 1483 if (cmov) {
1480 dasm_put(Dst, 9136); 1484 dasm_put(Dst, 9134);
1481 } else { 1485 } else {
1482 dasm_put(Dst, 9140); 1486 dasm_put(Dst, 9138);
1483 } 1487 }
1484 dasm_put(Dst, 9147); 1488 dasm_put(Dst, 9145);
1485 dasm_put(Dst, 9221); 1489 dasm_put(Dst, 9219);
1486 dasm_put(Dst, 9321); 1490 dasm_put(Dst, 9319);
1487 if (cmov) { 1491 if (cmov) {
1488 dasm_put(Dst, 9324); 1492 dasm_put(Dst, 9322);
1489 } else { 1493 } else {
1490 dasm_put(Dst, 9328); 1494 dasm_put(Dst, 9326);
1491 } 1495 }
1492 dasm_put(Dst, 9335); 1496 dasm_put(Dst, 9333);
1493 if (cmov) { 1497 if (cmov) {
1494 dasm_put(Dst, 9136); 1498 dasm_put(Dst, 9134);
1495 } else { 1499 } else {
1496 dasm_put(Dst, 9140); 1500 dasm_put(Dst, 9138);
1497 } 1501 }
1498 dasm_put(Dst, 9353); 1502 dasm_put(Dst, 9351);
1499 } else { 1503 } else {
1500 dasm_put(Dst, 9432); 1504 dasm_put(Dst, 9430);
1501 } 1505 }
1502 dasm_put(Dst, 9435); 1506 dasm_put(Dst, 9433);
1503 dasm_put(Dst, 9520); 1507 dasm_put(Dst, 9518);
1504 dasm_put(Dst, 9651); 1508 dasm_put(Dst, 9649);
1505 dasm_put(Dst, 9850); 1509 dasm_put(Dst, 9848);
1506 if (sse) { 1510 if (sse) {
1507 dasm_put(Dst, 9873); 1511 dasm_put(Dst, 9871);
1508 dasm_put(Dst, 9930); 1512 dasm_put(Dst, 9928);
1509 dasm_put(Dst, 10021); 1513 dasm_put(Dst, 10019);
1510 } else { 1514 } else {
1511 dasm_put(Dst, 10063); 1515 dasm_put(Dst, 10061);
1512 dasm_put(Dst, 10155); 1516 dasm_put(Dst, 10153);
1513 } 1517 }
1514 dasm_put(Dst, 10201); 1518 dasm_put(Dst, 10199);
1515 if (sse) { 1519 if (sse) {
1516 dasm_put(Dst, 10207); 1520 dasm_put(Dst, 10205);
1517 dasm_put(Dst, 10312); 1521 dasm_put(Dst, 10310);
1518 dasm_put(Dst, 10395); 1522 dasm_put(Dst, 10393);
1519 } else { 1523 } else {
1520 dasm_put(Dst, 10467); 1524 dasm_put(Dst, 10465);
1521 dasm_put(Dst, 10550); 1525 dasm_put(Dst, 10548);
1522 if (cmov) { 1526 if (cmov) {
1523 dasm_put(Dst, 10605); 1527 dasm_put(Dst, 10603);
1524 } else { 1528 } else {
1525 dasm_put(Dst, 10624); 1529 dasm_put(Dst, 10622);
1526 } 1530 }
1527 dasm_put(Dst, 10463); 1531 dasm_put(Dst, 10461);
1528 } 1532 }
1529 dasm_put(Dst, 10665); 1533 dasm_put(Dst, 10663);
1530} 1534}
1531 1535
1532/* Generate the code for a single instruction. */ 1536/* Generate the code for a single instruction. */
1533static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse) 1537static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1534{ 1538{
1535 int vk = 0; 1539 int vk = 0;
1536 dasm_put(Dst, 10719, defop); 1540 dasm_put(Dst, 10717, defop);
1537 1541
1538 switch (op) { 1542 switch (op) {
1539 1543
@@ -1542,617 +1546,617 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1542 /* Remember: all ops branch for a true comparison, fall through otherwise. */ 1546 /* Remember: all ops branch for a true comparison, fall through otherwise. */
1543 1547
1544 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: 1548 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
1545 dasm_put(Dst, 10721, LJ_TISNUM, LJ_TISNUM); 1549 dasm_put(Dst, 10719, LJ_TISNUM, LJ_TISNUM);
1546 if (sse) { 1550 if (sse) {
1547 dasm_put(Dst, 10742); 1551 dasm_put(Dst, 10740);
1548 } else { 1552 } else {
1549 dasm_put(Dst, 10757); 1553 dasm_put(Dst, 10755);
1550 if (cmov) { 1554 if (cmov) {
1551 dasm_put(Dst, 10767); 1555 dasm_put(Dst, 10765);
1552 } else { 1556 } else {
1553 dasm_put(Dst, 10773); 1557 dasm_put(Dst, 10771);
1554 } 1558 }
1555 } 1559 }
1556 switch (op) { 1560 switch (op) {
1557 case BC_ISLT: 1561 case BC_ISLT:
1558 dasm_put(Dst, 10780); 1562 dasm_put(Dst, 10778);
1559 break; 1563 break;
1560 case BC_ISGE: 1564 case BC_ISGE:
1561 dasm_put(Dst, 10016); 1565 dasm_put(Dst, 10014);
1562 break; 1566 break;
1563 case BC_ISLE: 1567 case BC_ISLE:
1564 dasm_put(Dst, 6179); 1568 dasm_put(Dst, 6179);
1565 break; 1569 break;
1566 case BC_ISGT: 1570 case BC_ISGT:
1567 dasm_put(Dst, 10785); 1571 dasm_put(Dst, 10783);
1568 break; 1572 break;
1569 default: break; /* Shut up GCC. */ 1573 default: break; /* Shut up GCC. */
1570 } 1574 }
1571 dasm_put(Dst, 10790, -BCBIAS_J*4); 1575 dasm_put(Dst, 10788, -BCBIAS_J*4);
1572 break; 1576 break;
1573 1577
1574 case BC_ISEQV: case BC_ISNEV: 1578 case BC_ISEQV: case BC_ISNEV:
1575 vk = op == BC_ISEQV; 1579 vk = op == BC_ISEQV;
1576 dasm_put(Dst, 10823, LJ_TISNUM, LJ_TISNUM); 1580 dasm_put(Dst, 10821, LJ_TISNUM, LJ_TISNUM);
1577 if (sse) { 1581 if (sse) {
1578 dasm_put(Dst, 10849); 1582 dasm_put(Dst, 10847);
1579 } else { 1583 } else {
1580 dasm_put(Dst, 10861); 1584 dasm_put(Dst, 10859);
1581 if (cmov) { 1585 if (cmov) {
1582 dasm_put(Dst, 10767); 1586 dasm_put(Dst, 10765);
1583 } else { 1587 } else {
1584 dasm_put(Dst, 10773); 1588 dasm_put(Dst, 10771);
1585 } 1589 }
1586 } 1590 }
1587 iseqne_fp: 1591 iseqne_fp:
1588 if (vk) { 1592 if (vk) {
1589 dasm_put(Dst, 10868); 1593 dasm_put(Dst, 10866);
1590 } else { 1594 } else {
1591 dasm_put(Dst, 10877); 1595 dasm_put(Dst, 10875);
1592 } 1596 }
1593 iseqne_end: 1597 iseqne_end:
1594 if (vk) { 1598 if (vk) {
1595 dasm_put(Dst, 10886, -BCBIAS_J*4); 1599 dasm_put(Dst, 10884, -BCBIAS_J*4);
1596 } else { 1600 } else {
1597 dasm_put(Dst, 10901, -BCBIAS_J*4); 1601 dasm_put(Dst, 10899, -BCBIAS_J*4);
1598 } 1602 }
1599 dasm_put(Dst, 8414); 1603 dasm_put(Dst, 8412);
1600 if (op == BC_ISEQV || op == BC_ISNEV) { 1604 if (op == BC_ISEQV || op == BC_ISNEV) {
1601 dasm_put(Dst, 10916, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq); 1605 dasm_put(Dst, 10914, LJ_TISPRI, LJ_TISTABUD, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq);
1602 if (vk) { 1606 if (vk) {
1603 dasm_put(Dst, 10974); 1607 dasm_put(Dst, 10972);
1604 } else { 1608 } else {
1605 dasm_put(Dst, 10978); 1609 dasm_put(Dst, 10976);
1606 } 1610 }
1607 dasm_put(Dst, 10984); 1611 dasm_put(Dst, 10982);
1608 } 1612 }
1609 break; 1613 break;
1610 case BC_ISEQS: case BC_ISNES: 1614 case BC_ISEQS: case BC_ISNES:
1611 vk = op == BC_ISEQS; 1615 vk = op == BC_ISEQS;
1612 dasm_put(Dst, 10989, LJ_TSTR); 1616 dasm_put(Dst, 10987, LJ_TSTR);
1613 iseqne_test: 1617 iseqne_test:
1614 if (vk) { 1618 if (vk) {
1615 dasm_put(Dst, 10872); 1619 dasm_put(Dst, 10870);
1616 } else { 1620 } else {
1617 dasm_put(Dst, 2809); 1621 dasm_put(Dst, 2809);
1618 } 1622 }
1619 goto iseqne_end; 1623 goto iseqne_end;
1620 case BC_ISEQN: case BC_ISNEN: 1624 case BC_ISEQN: case BC_ISNEN:
1621 vk = op == BC_ISEQN; 1625 vk = op == BC_ISEQN;
1622 dasm_put(Dst, 11012, LJ_TISNUM); 1626 dasm_put(Dst, 11010, LJ_TISNUM);
1623 if (sse) { 1627 if (sse) {
1624 dasm_put(Dst, 11026); 1628 dasm_put(Dst, 11024);
1625 } else { 1629 } else {
1626 dasm_put(Dst, 11038); 1630 dasm_put(Dst, 11036);
1627 if (cmov) { 1631 if (cmov) {
1628 dasm_put(Dst, 10767); 1632 dasm_put(Dst, 10765);
1629 } else { 1633 } else {
1630 dasm_put(Dst, 10773); 1634 dasm_put(Dst, 10771);
1631 } 1635 }
1632 } 1636 }
1633 goto iseqne_fp; 1637 goto iseqne_fp;
1634 case BC_ISEQP: case BC_ISNEP: 1638 case BC_ISEQP: case BC_ISNEP:
1635 vk = op == BC_ISEQP; 1639 vk = op == BC_ISEQP;
1636 dasm_put(Dst, 11045); 1640 dasm_put(Dst, 11043);
1637 goto iseqne_test; 1641 goto iseqne_test;
1638 1642
1639 /* -- Unary test and copy ops ------------------------------------------- */ 1643 /* -- Unary test and copy ops ------------------------------------------- */
1640 1644
1641 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: 1645 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
1642 dasm_put(Dst, 11056, LJ_TISTRUECOND); 1646 dasm_put(Dst, 11054, LJ_TISTRUECOND);
1643 if (op == BC_IST || op == BC_ISTC) { 1647 if (op == BC_IST || op == BC_ISTC) {
1644 dasm_put(Dst, 11068); 1648 dasm_put(Dst, 11066);
1645 } else { 1649 } else {
1646 dasm_put(Dst, 11073); 1650 dasm_put(Dst, 11071);
1647 } 1651 }
1648 if (op == BC_ISTC || op == BC_ISFC) { 1652 if (op == BC_ISTC || op == BC_ISFC) {
1649 dasm_put(Dst, 11078); 1653 dasm_put(Dst, 11076);
1650 } 1654 }
1651 dasm_put(Dst, 11089, -BCBIAS_J*4); 1655 dasm_put(Dst, 11087, -BCBIAS_J*4);
1652 break; 1656 break;
1653 1657
1654 /* -- Unary ops --------------------------------------------------------- */ 1658 /* -- Unary ops --------------------------------------------------------- */
1655 1659
1656 case BC_MOV: 1660 case BC_MOV:
1657 dasm_put(Dst, 11120); 1661 dasm_put(Dst, 11118);
1658 break; 1662 break;
1659 case BC_NOT: 1663 case BC_NOT:
1660 dasm_put(Dst, 11153, LJ_TISTRUECOND, LJ_TTRUE); 1664 dasm_put(Dst, 11151, LJ_TISTRUECOND, LJ_TTRUE);
1661 break; 1665 break;
1662 case BC_UNM: 1666 case BC_UNM:
1663 dasm_put(Dst, 11188, LJ_TISNUM); 1667 dasm_put(Dst, 11186, LJ_TISNUM);
1664 if (sse) { 1668 if (sse) {
1665 dasm_put(Dst, 11199); 1669 dasm_put(Dst, 11197);
1666 } else { 1670 } else {
1667 dasm_put(Dst, 11229); 1671 dasm_put(Dst, 11227);
1668 } 1672 }
1669 dasm_put(Dst, 8414); 1673 dasm_put(Dst, 8412);
1670 break; 1674 break;
1671 case BC_LEN: 1675 case BC_LEN:
1672 dasm_put(Dst, 11238, LJ_TSTR); 1676 dasm_put(Dst, 11236, LJ_TSTR);
1673 if (sse) { 1677 if (sse) {
1674 dasm_put(Dst, 11252, Dt5(->len)); 1678 dasm_put(Dst, 11250, Dt5(->len));
1675 } else { 1679 } else {
1676 dasm_put(Dst, 11270, Dt5(->len)); 1680 dasm_put(Dst, 11268, Dt5(->len));
1677 } 1681 }
1678 dasm_put(Dst, 11279, LJ_TTAB); 1682 dasm_put(Dst, 11277, LJ_TTAB);
1679 if (sse) { 1683 if (sse) {
1680 dasm_put(Dst, 11319); 1684 dasm_put(Dst, 11317);
1681 } else { 1685 } else {
1682 dasm_put(Dst, 11328); 1686 dasm_put(Dst, 11326);
1683 } 1687 }
1684 dasm_put(Dst, 11338); 1688 dasm_put(Dst, 11336);
1685 break; 1689 break;
1686 1690
1687 /* -- Binary ops -------------------------------------------------------- */ 1691 /* -- Binary ops -------------------------------------------------------- */
1688 1692
1689 1693
1690 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV: 1694 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:
1691 dasm_put(Dst, 11348); 1695 dasm_put(Dst, 11346);
1692 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1696 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1693 switch (vk) { 1697 switch (vk) {
1694 case 0: 1698 case 0:
1695 dasm_put(Dst, 11356, LJ_TISNUM); 1699 dasm_put(Dst, 11354, LJ_TISNUM);
1696 if (sse) { 1700 if (sse) {
1697 dasm_put(Dst, 11368); 1701 dasm_put(Dst, 11366);
1698 } else { 1702 } else {
1699 dasm_put(Dst, 11382); 1703 dasm_put(Dst, 11380);
1700 } 1704 }
1701 break; 1705 break;
1702 case 1: 1706 case 1:
1703 dasm_put(Dst, 11390, LJ_TISNUM); 1707 dasm_put(Dst, 11388, LJ_TISNUM);
1704 if (sse) { 1708 if (sse) {
1705 dasm_put(Dst, 11402); 1709 dasm_put(Dst, 11400);
1706 } else { 1710 } else {
1707 dasm_put(Dst, 11416); 1711 dasm_put(Dst, 11414);
1708 } 1712 }
1709 break; 1713 break;
1710 default: 1714 default:
1711 dasm_put(Dst, 11424, LJ_TISNUM, LJ_TISNUM); 1715 dasm_put(Dst, 11422, LJ_TISNUM, LJ_TISNUM);
1712 if (sse) { 1716 if (sse) {
1713 dasm_put(Dst, 11446); 1717 dasm_put(Dst, 11444);
1714 } else { 1718 } else {
1715 dasm_put(Dst, 11460); 1719 dasm_put(Dst, 11458);
1716 } 1720 }
1717 break; 1721 break;
1718 } 1722 }
1719 if (sse) { 1723 if (sse) {
1720 dasm_put(Dst, 11222); 1724 dasm_put(Dst, 11220);
1721 } else { 1725 } else {
1722 dasm_put(Dst, 11234); 1726 dasm_put(Dst, 11232);
1723 } 1727 }
1724 dasm_put(Dst, 8414); 1728 dasm_put(Dst, 8412);
1725 break; 1729 break;
1726 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: 1730 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
1727 dasm_put(Dst, 11348); 1731 dasm_put(Dst, 11346);
1728 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1732 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1729 switch (vk) { 1733 switch (vk) {
1730 case 0: 1734 case 0:
1731 dasm_put(Dst, 11356, LJ_TISNUM); 1735 dasm_put(Dst, 11354, LJ_TISNUM);
1732 if (sse) { 1736 if (sse) {
1733 dasm_put(Dst, 11468); 1737 dasm_put(Dst, 11466);
1734 } else { 1738 } else {
1735 dasm_put(Dst, 11482); 1739 dasm_put(Dst, 11480);
1736 } 1740 }
1737 break; 1741 break;
1738 case 1: 1742 case 1:
1739 dasm_put(Dst, 11390, LJ_TISNUM); 1743 dasm_put(Dst, 11388, LJ_TISNUM);
1740 if (sse) { 1744 if (sse) {
1741 dasm_put(Dst, 11490); 1745 dasm_put(Dst, 11488);
1742 } else { 1746 } else {
1743 dasm_put(Dst, 11504); 1747 dasm_put(Dst, 11502);
1744 } 1748 }
1745 break; 1749 break;
1746 default: 1750 default:
1747 dasm_put(Dst, 11424, LJ_TISNUM, LJ_TISNUM); 1751 dasm_put(Dst, 11422, LJ_TISNUM, LJ_TISNUM);
1748 if (sse) { 1752 if (sse) {
1749 dasm_put(Dst, 11512); 1753 dasm_put(Dst, 11510);
1750 } else { 1754 } else {
1751 dasm_put(Dst, 11526); 1755 dasm_put(Dst, 11524);
1752 } 1756 }
1753 break; 1757 break;
1754 } 1758 }
1755 if (sse) { 1759 if (sse) {
1756 dasm_put(Dst, 11222); 1760 dasm_put(Dst, 11220);
1757 } else { 1761 } else {
1758 dasm_put(Dst, 11234); 1762 dasm_put(Dst, 11232);
1759 } 1763 }
1760 dasm_put(Dst, 8414); 1764 dasm_put(Dst, 8412);
1761 break; 1765 break;
1762 case BC_MULVN: case BC_MULNV: case BC_MULVV: 1766 case BC_MULVN: case BC_MULNV: case BC_MULVV:
1763 dasm_put(Dst, 11348); 1767 dasm_put(Dst, 11346);
1764 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1768 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1765 switch (vk) { 1769 switch (vk) {
1766 case 0: 1770 case 0:
1767 dasm_put(Dst, 11356, LJ_TISNUM); 1771 dasm_put(Dst, 11354, LJ_TISNUM);
1768 if (sse) { 1772 if (sse) {
1769 dasm_put(Dst, 11534); 1773 dasm_put(Dst, 11532);
1770 } else { 1774 } else {
1771 dasm_put(Dst, 11548); 1775 dasm_put(Dst, 11546);
1772 } 1776 }
1773 break; 1777 break;
1774 case 1: 1778 case 1:
1775 dasm_put(Dst, 11390, LJ_TISNUM); 1779 dasm_put(Dst, 11388, LJ_TISNUM);
1776 if (sse) { 1780 if (sse) {
1777 dasm_put(Dst, 11556); 1781 dasm_put(Dst, 11554);
1778 } else { 1782 } else {
1779 dasm_put(Dst, 11570); 1783 dasm_put(Dst, 11568);
1780 } 1784 }
1781 break; 1785 break;
1782 default: 1786 default:
1783 dasm_put(Dst, 11424, LJ_TISNUM, LJ_TISNUM); 1787 dasm_put(Dst, 11422, LJ_TISNUM, LJ_TISNUM);
1784 if (sse) { 1788 if (sse) {
1785 dasm_put(Dst, 11578); 1789 dasm_put(Dst, 11576);
1786 } else { 1790 } else {
1787 dasm_put(Dst, 11592); 1791 dasm_put(Dst, 11590);
1788 } 1792 }
1789 break; 1793 break;
1790 } 1794 }
1791 if (sse) { 1795 if (sse) {
1792 dasm_put(Dst, 11222); 1796 dasm_put(Dst, 11220);
1793 } else { 1797 } else {
1794 dasm_put(Dst, 11234); 1798 dasm_put(Dst, 11232);
1795 } 1799 }
1796 dasm_put(Dst, 8414); 1800 dasm_put(Dst, 8412);
1797 break; 1801 break;
1798 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: 1802 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
1799 dasm_put(Dst, 11348); 1803 dasm_put(Dst, 11346);
1800 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1804 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1801 switch (vk) { 1805 switch (vk) {
1802 case 0: 1806 case 0:
1803 dasm_put(Dst, 11356, LJ_TISNUM); 1807 dasm_put(Dst, 11354, LJ_TISNUM);
1804 if (sse) { 1808 if (sse) {
1805 dasm_put(Dst, 11600); 1809 dasm_put(Dst, 11598);
1806 } else { 1810 } else {
1807 dasm_put(Dst, 11614); 1811 dasm_put(Dst, 11612);
1808 } 1812 }
1809 break; 1813 break;
1810 case 1: 1814 case 1:
1811 dasm_put(Dst, 11390, LJ_TISNUM); 1815 dasm_put(Dst, 11388, LJ_TISNUM);
1812 if (sse) { 1816 if (sse) {
1813 dasm_put(Dst, 11622); 1817 dasm_put(Dst, 11620);
1814 } else { 1818 } else {
1815 dasm_put(Dst, 11636); 1819 dasm_put(Dst, 11634);
1816 } 1820 }
1817 break; 1821 break;
1818 default: 1822 default:
1819 dasm_put(Dst, 11424, LJ_TISNUM, LJ_TISNUM); 1823 dasm_put(Dst, 11422, LJ_TISNUM, LJ_TISNUM);
1820 if (sse) { 1824 if (sse) {
1821 dasm_put(Dst, 11644); 1825 dasm_put(Dst, 11642);
1822 } else { 1826 } else {
1823 dasm_put(Dst, 11658); 1827 dasm_put(Dst, 11656);
1824 } 1828 }
1825 break; 1829 break;
1826 } 1830 }
1827 if (sse) { 1831 if (sse) {
1828 dasm_put(Dst, 11222); 1832 dasm_put(Dst, 11220);
1829 } else { 1833 } else {
1830 dasm_put(Dst, 11234); 1834 dasm_put(Dst, 11232);
1831 } 1835 }
1832 dasm_put(Dst, 8414); 1836 dasm_put(Dst, 8412);
1833 break; 1837 break;
1834 case BC_MODVN: 1838 case BC_MODVN:
1835 dasm_put(Dst, 11348); 1839 dasm_put(Dst, 11346);
1836 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1840 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1837 switch (vk) { 1841 switch (vk) {
1838 case 0: 1842 case 0:
1839 dasm_put(Dst, 11356, LJ_TISNUM); 1843 dasm_put(Dst, 11354, LJ_TISNUM);
1840 if (sse) { 1844 if (sse) {
1841 dasm_put(Dst, 11666); 1845 dasm_put(Dst, 11664);
1842 } else { 1846 } else {
1843 dasm_put(Dst, 11680); 1847 dasm_put(Dst, 11678);
1844 } 1848 }
1845 break; 1849 break;
1846 case 1: 1850 case 1:
1847 dasm_put(Dst, 11390, LJ_TISNUM); 1851 dasm_put(Dst, 11388, LJ_TISNUM);
1848 if (sse) { 1852 if (sse) {
1849 dasm_put(Dst, 11688); 1853 dasm_put(Dst, 11686);
1850 } else { 1854 } else {
1851 dasm_put(Dst, 11702); 1855 dasm_put(Dst, 11700);
1852 } 1856 }
1853 break; 1857 break;
1854 default: 1858 default:
1855 dasm_put(Dst, 11424, LJ_TISNUM, LJ_TISNUM); 1859 dasm_put(Dst, 11422, LJ_TISNUM, LJ_TISNUM);
1856 if (sse) { 1860 if (sse) {
1857 dasm_put(Dst, 11710); 1861 dasm_put(Dst, 11708);
1858 } else { 1862 } else {
1859 dasm_put(Dst, 11724); 1863 dasm_put(Dst, 11722);
1860 } 1864 }
1861 break; 1865 break;
1862 } 1866 }
1863 dasm_put(Dst, 11732); 1867 dasm_put(Dst, 11730);
1864 if (sse) { 1868 if (sse) {
1865 dasm_put(Dst, 11222); 1869 dasm_put(Dst, 11220);
1866 } else { 1870 } else {
1867 dasm_put(Dst, 11234); 1871 dasm_put(Dst, 11232);
1868 } 1872 }
1869 dasm_put(Dst, 8414); 1873 dasm_put(Dst, 8412);
1870 break; 1874 break;
1871 case BC_MODNV: case BC_MODVV: 1875 case BC_MODNV: case BC_MODVV:
1872 dasm_put(Dst, 11348); 1876 dasm_put(Dst, 11346);
1873 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1877 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1874 switch (vk) { 1878 switch (vk) {
1875 case 0: 1879 case 0:
1876 dasm_put(Dst, 11356, LJ_TISNUM); 1880 dasm_put(Dst, 11354, LJ_TISNUM);
1877 if (sse) { 1881 if (sse) {
1878 dasm_put(Dst, 11666); 1882 dasm_put(Dst, 11664);
1879 } else { 1883 } else {
1880 dasm_put(Dst, 11680); 1884 dasm_put(Dst, 11678);
1881 } 1885 }
1882 break; 1886 break;
1883 case 1: 1887 case 1:
1884 dasm_put(Dst, 11390, LJ_TISNUM); 1888 dasm_put(Dst, 11388, LJ_TISNUM);
1885 if (sse) { 1889 if (sse) {
1886 dasm_put(Dst, 11688); 1890 dasm_put(Dst, 11686);
1887 } else { 1891 } else {
1888 dasm_put(Dst, 11702); 1892 dasm_put(Dst, 11700);
1889 } 1893 }
1890 break; 1894 break;
1891 default: 1895 default:
1892 dasm_put(Dst, 11424, LJ_TISNUM, LJ_TISNUM); 1896 dasm_put(Dst, 11422, LJ_TISNUM, LJ_TISNUM);
1893 if (sse) { 1897 if (sse) {
1894 dasm_put(Dst, 11710); 1898 dasm_put(Dst, 11708);
1895 } else { 1899 } else {
1896 dasm_put(Dst, 11724); 1900 dasm_put(Dst, 11722);
1897 } 1901 }
1898 break; 1902 break;
1899 } 1903 }
1900 dasm_put(Dst, 11738); 1904 dasm_put(Dst, 11736);
1901 break; 1905 break;
1902 case BC_POW: 1906 case BC_POW:
1903 dasm_put(Dst, 11348); 1907 dasm_put(Dst, 11346);
1904 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 1908 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
1905 switch (vk) { 1909 switch (vk) {
1906 case 0: 1910 case 0:
1907 dasm_put(Dst, 11356, LJ_TISNUM); 1911 dasm_put(Dst, 11354, LJ_TISNUM);
1908 if (sse) { 1912 if (sse) {
1909 dasm_put(Dst, 11666); 1913 dasm_put(Dst, 11664);
1910 } else { 1914 } else {
1911 dasm_put(Dst, 11680); 1915 dasm_put(Dst, 11678);
1912 } 1916 }
1913 break; 1917 break;
1914 case 1: 1918 case 1:
1915 dasm_put(Dst, 11390, LJ_TISNUM); 1919 dasm_put(Dst, 11388, LJ_TISNUM);
1916 if (sse) { 1920 if (sse) {
1917 dasm_put(Dst, 11688); 1921 dasm_put(Dst, 11686);
1918 } else { 1922 } else {
1919 dasm_put(Dst, 11702); 1923 dasm_put(Dst, 11700);
1920 } 1924 }
1921 break; 1925 break;
1922 default: 1926 default:
1923 dasm_put(Dst, 11424, LJ_TISNUM, LJ_TISNUM); 1927 dasm_put(Dst, 11422, LJ_TISNUM, LJ_TISNUM);
1924 if (sse) { 1928 if (sse) {
1925 dasm_put(Dst, 11710); 1929 dasm_put(Dst, 11708);
1926 } else { 1930 } else {
1927 dasm_put(Dst, 11724); 1931 dasm_put(Dst, 11722);
1928 } 1932 }
1929 break; 1933 break;
1930 } 1934 }
1931 dasm_put(Dst, 11743); 1935 dasm_put(Dst, 11741);
1932 if (sse) { 1936 if (sse) {
1933 dasm_put(Dst, 11222); 1937 dasm_put(Dst, 11220);
1934 } else { 1938 } else {
1935 dasm_put(Dst, 11234); 1939 dasm_put(Dst, 11232);
1936 } 1940 }
1937 dasm_put(Dst, 8414); 1941 dasm_put(Dst, 8412);
1938 break; 1942 break;
1939 1943
1940 case BC_CAT: 1944 case BC_CAT:
1941 dasm_put(Dst, 11747, Dt1(->base), Dt1(->base)); 1945 dasm_put(Dst, 11745, Dt1(->base), Dt1(->base));
1942 break; 1946 break;
1943 1947
1944 /* -- Constant ops ------------------------------------------------------ */ 1948 /* -- Constant ops ------------------------------------------------------ */
1945 1949
1946 case BC_KSTR: 1950 case BC_KSTR:
1947 dasm_put(Dst, 11841, LJ_TSTR); 1951 dasm_put(Dst, 11839, LJ_TSTR);
1948 break; 1952 break;
1949 case BC_KSHORT: 1953 case BC_KSHORT:
1950 if (sse) { 1954 if (sse) {
1951 dasm_put(Dst, 11874); 1955 dasm_put(Dst, 11872);
1952 } else { 1956 } else {
1953 dasm_put(Dst, 11889); 1957 dasm_put(Dst, 11887);
1954 } 1958 }
1955 dasm_put(Dst, 8414); 1959 dasm_put(Dst, 8412);
1956 break; 1960 break;
1957 case BC_KNUM: 1961 case BC_KNUM:
1958 if (sse) { 1962 if (sse) {
1959 dasm_put(Dst, 11897); 1963 dasm_put(Dst, 11895);
1960 } else { 1964 } else {
1961 dasm_put(Dst, 11910); 1965 dasm_put(Dst, 11908);
1962 } 1966 }
1963 dasm_put(Dst, 8414); 1967 dasm_put(Dst, 8412);
1964 break; 1968 break;
1965 case BC_KPRI: 1969 case BC_KPRI:
1966 dasm_put(Dst, 11917); 1970 dasm_put(Dst, 11915);
1967 break; 1971 break;
1968 case BC_KNIL: 1972 case BC_KNIL:
1969 dasm_put(Dst, 11943, LJ_TNIL); 1973 dasm_put(Dst, 11941, LJ_TNIL);
1970 break; 1974 break;
1971 1975
1972 /* -- Upvalue and function ops ------------------------------------------ */ 1976 /* -- Upvalue and function ops ------------------------------------------ */
1973 1977
1974 case BC_UGET: 1978 case BC_UGET:
1975 dasm_put(Dst, 11989, offsetof(GCfuncL, uvptr), DtA(->v)); 1979 dasm_put(Dst, 11987, offsetof(GCfuncL, uvptr), DtA(->v));
1976 break; 1980 break;
1977 case BC_USETV: 1981 case BC_USETV:
1978#define TV2MARKOFS \ 1982#define TV2MARKOFS \
1979 ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv)) 1983 ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv))
1980 dasm_put(Dst, 12033, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); 1984 dasm_put(Dst, 12031, offsetof(GCfuncL, uvptr), DtA(->closed), DtA(->v), TV2MARKOFS, LJ_GC_BLACK, LJ_TISGCV, LJ_TISNUM - LJ_TISGCV, Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G);
1981 dasm_put(Dst, 12123); 1985 dasm_put(Dst, 12121);
1982 break; 1986 break;
1983#undef TV2MARKOFS 1987#undef TV2MARKOFS
1984 case BC_USETS: 1988 case BC_USETS:
1985 dasm_put(Dst, 12135, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G); 1989 dasm_put(Dst, 12133, offsetof(GCfuncL, uvptr), DtA(->v), LJ_TSTR, DtA(->marked), LJ_GC_BLACK, Dt4(->gch.marked), LJ_GC_WHITES, DtA(->closed), GG_DISP2G);
1986 break; 1990 break;
1987 case BC_USETN: 1991 case BC_USETN:
1988 dasm_put(Dst, 12226); 1992 dasm_put(Dst, 12224);
1989 if (sse) { 1993 if (sse) {
1990 dasm_put(Dst, 12231); 1994 dasm_put(Dst, 12229);
1991 } else { 1995 } else {
1992 dasm_put(Dst, 11041); 1996 dasm_put(Dst, 11039);
1993 } 1997 }
1994 dasm_put(Dst, 12238, offsetof(GCfuncL, uvptr), DtA(->v)); 1998 dasm_put(Dst, 12236, offsetof(GCfuncL, uvptr), DtA(->v));
1995 if (sse) { 1999 if (sse) {
1996 dasm_put(Dst, 12247); 2000 dasm_put(Dst, 12245);
1997 } else { 2001 } else {
1998 dasm_put(Dst, 12253); 2002 dasm_put(Dst, 12251);
1999 } 2003 }
2000 dasm_put(Dst, 8414); 2004 dasm_put(Dst, 8412);
2001 break; 2005 break;
2002 case BC_USETP: 2006 case BC_USETP:
2003 dasm_put(Dst, 12256, offsetof(GCfuncL, uvptr), DtA(->v)); 2007 dasm_put(Dst, 12254, offsetof(GCfuncL, uvptr), DtA(->v));
2004 break; 2008 break;
2005 case BC_UCLO: 2009 case BC_UCLO:
2006 dasm_put(Dst, 12293, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base)); 2010 dasm_put(Dst, 12291, -BCBIAS_J*4, Dt1(->openupval), Dt1(->base), Dt1(->base));
2007 break; 2011 break;
2008 2012
2009 case BC_FNEW: 2013 case BC_FNEW:
2010 dasm_put(Dst, 12347, Dt1(->base), Dt1(->base), LJ_TFUNC); 2014 dasm_put(Dst, 12345, Dt1(->base), Dt1(->base), LJ_TFUNC);
2011 break; 2015 break;
2012 2016
2013 /* -- Table ops --------------------------------------------------------- */ 2017 /* -- Table ops --------------------------------------------------------- */
2014 2018
2015 case BC_TNEW: 2019 case BC_TNEW:
2016 dasm_put(Dst, 12418, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); 2020 dasm_put(Dst, 12416, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB);
2017 break; 2021 break;
2018 case BC_TDUP: 2022 case BC_TDUP:
2019 dasm_put(Dst, 12539, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB); 2023 dasm_put(Dst, 12537, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base), Dt1(->base), LJ_TTAB);
2020 break; 2024 break;
2021 2025
2022 case BC_GGET: 2026 case BC_GGET:
2023 dasm_put(Dst, 12631, Dt7(->env)); 2027 dasm_put(Dst, 12629, Dt7(->env));
2024 break; 2028 break;
2025 case BC_GSET: 2029 case BC_GSET:
2026 dasm_put(Dst, 12649, Dt7(->env)); 2030 dasm_put(Dst, 12647, Dt7(->env));
2027 break; 2031 break;
2028 2032
2029 case BC_TGETV: 2033 case BC_TGETV:
2030 dasm_put(Dst, 12667, LJ_TTAB, LJ_TISNUM); 2034 dasm_put(Dst, 12665, LJ_TTAB, LJ_TISNUM);
2031 if (sse) { 2035 if (sse) {
2032 dasm_put(Dst, 12700); 2036 dasm_put(Dst, 12698);
2033 } else { 2037 } else {
2034 dasm_put(Dst, 12721); 2038 dasm_put(Dst, 12719);
2035 if (cmov) { 2039 if (cmov) {
2036 dasm_put(Dst, 10767); 2040 dasm_put(Dst, 10765);
2037 } else { 2041 } else {
2038 dasm_put(Dst, 10773); 2042 dasm_put(Dst, 10771);
2039 } 2043 }
2040 dasm_put(Dst, 2522); 2044 dasm_put(Dst, 2522);
2041 } 2045 }
2042 dasm_put(Dst, 12731, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 2046 dasm_put(Dst, 12729, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
2043 dasm_put(Dst, 12823, LJ_TSTR); 2047 dasm_put(Dst, 12821, LJ_TSTR);
2044 break; 2048 break;
2045 case BC_TGETS: 2049 case BC_TGETS:
2046 dasm_put(Dst, 12841, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); 2050 dasm_put(Dst, 12839, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL);
2047 dasm_put(Dst, 12925, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 2051 dasm_put(Dst, 12923, LJ_TNIL, DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
2048 break; 2052 break;
2049 case BC_TGETB: 2053 case BC_TGETB:
2050 dasm_put(Dst, 12996, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 2054 dasm_put(Dst, 12994, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
2051 dasm_put(Dst, 11338); 2055 dasm_put(Dst, 11336);
2052 break; 2056 break;
2053 2057
2054 case BC_TSETV: 2058 case BC_TSETV:
2055 dasm_put(Dst, 13095, LJ_TTAB, LJ_TISNUM); 2059 dasm_put(Dst, 13093, LJ_TTAB, LJ_TISNUM);
2056 if (sse) { 2060 if (sse) {
2057 dasm_put(Dst, 12700); 2061 dasm_put(Dst, 12698);
2058 } else { 2062 } else {
2059 dasm_put(Dst, 12721); 2063 dasm_put(Dst, 12719);
2060 if (cmov) { 2064 if (cmov) {
2061 dasm_put(Dst, 10767); 2065 dasm_put(Dst, 10765);
2062 } else { 2066 } else {
2063 dasm_put(Dst, 10773); 2067 dasm_put(Dst, 10771);
2064 } 2068 }
2065 dasm_put(Dst, 2522); 2069 dasm_put(Dst, 2522);
2066 } 2070 }
2067 dasm_put(Dst, 13128, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable)); 2071 dasm_put(Dst, 13126, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable));
2068 dasm_put(Dst, 13211, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 2072 dasm_put(Dst, 13209, Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
2069 break; 2073 break;
2070 case BC_TSETS: 2074 case BC_TSETS:
2071 dasm_put(Dst, 13273, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL); 2075 dasm_put(Dst, 13271, LJ_TTAB, Dt6(->hmask), Dt5(->hash), sizeof(Node), Dt6(->nomm), Dt6(->node), DtB(->key.it), LJ_TSTR, DtB(->key.gcr), LJ_TNIL);
2072 dasm_put(Dst, 13348, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next)); 2076 dasm_put(Dst, 13346, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next));
2073 dasm_put(Dst, 13440, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 2077 dasm_put(Dst, 13438, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
2074 break; 2078 break;
2075 case BC_TSETB: 2079 case BC_TSETB:
2076 dasm_put(Dst, 13536, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable)); 2080 dasm_put(Dst, 13534, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable));
2077 dasm_put(Dst, 13634, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist)); 2081 dasm_put(Dst, 13632, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
2078 break; 2082 break;
2079 2083
2080 case BC_TSETM: 2084 case BC_TSETM:
2081 dasm_put(Dst, 13680); 2085 dasm_put(Dst, 13678);
2082 if (sse) { 2086 if (sse) {
2083 dasm_put(Dst, 12231); 2087 dasm_put(Dst, 12229);
2084 } else { 2088 } else {
2085 dasm_put(Dst, 13685); 2089 dasm_put(Dst, 13683);
2086 } 2090 }
2087 dasm_put(Dst, 13693, Dt6(->marked), LJ_GC_BLACK); 2091 dasm_put(Dst, 13691, Dt6(->marked), LJ_GC_BLACK);
2088 if (sse) { 2092 if (sse) {
2089 dasm_put(Dst, 13718); 2093 dasm_put(Dst, 13716);
2090 } else { 2094 } else {
2091 dasm_put(Dst, 13725); 2095 dasm_put(Dst, 13723);
2092 } 2096 }
2093 dasm_put(Dst, 13730, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); 2097 dasm_put(Dst, 13728, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain));
2094 dasm_put(Dst, 13858, Dt6(->gclist)); 2098 dasm_put(Dst, 13856, Dt6(->gclist));
2095 break; 2099 break;
2096 2100
2097 /* -- Calls and vararg handling ----------------------------------------- */ 2101 /* -- Calls and vararg handling ----------------------------------------- */
2098 2102
2099 case BC_CALL: case BC_CALLM: 2103 case BC_CALL: case BC_CALLM:
2100 dasm_put(Dst, 11352); 2104 dasm_put(Dst, 11350);
2101 if (op == BC_CALLM) { 2105 if (op == BC_CALLM) {
2102 dasm_put(Dst, 13866); 2106 dasm_put(Dst, 13864);
2103 } 2107 }
2104 dasm_put(Dst, 13871, LJ_TFUNC, Dt7(->pc)); 2108 dasm_put(Dst, 13869, LJ_TFUNC, Dt7(->pc));
2105 break; 2109 break;
2106 2110
2107 case BC_CALLMT: 2111 case BC_CALLMT:
2108 dasm_put(Dst, 13866); 2112 dasm_put(Dst, 13864);
2109 break; 2113 break;
2110 case BC_CALLT: 2114 case BC_CALLT:
2111 dasm_put(Dst, 13912, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); 2115 dasm_put(Dst, 13910, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
2112 dasm_put(Dst, 14030, FRAME_TYPE, Dt7(->pc), PC2PROTO(k)); 2116 dasm_put(Dst, 14028, FRAME_TYPE, Dt7(->pc), PC2PROTO(k));
2113 break; 2117 break;
2114 2118
2115 case BC_ITERC: 2119 case BC_ITERC:
2116 dasm_put(Dst, 14087, LJ_TFUNC, 2+1, Dt7(->pc)); 2120 dasm_put(Dst, 14085, LJ_TFUNC, 2+1, Dt7(->pc));
2117 break; 2121 break;
2118 2122
2119 case BC_VARG: 2123 case BC_VARG:
2120 dasm_put(Dst, 14167, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); 2124 dasm_put(Dst, 14165, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
2121 dasm_put(Dst, 14311, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 2125 dasm_put(Dst, 14309, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
2122 break; 2126 break;
2123 2127
2124 /* -- Returns ----------------------------------------------------------- */ 2128 /* -- Returns ----------------------------------------------------------- */
2125 2129
2126 case BC_RETM: 2130 case BC_RETM:
2127 dasm_put(Dst, 13866); 2131 dasm_put(Dst, 13864);
2128 break; 2132 break;
2129 2133
2130 case BC_RET: case BC_RET0: case BC_RET1: 2134 case BC_RET: case BC_RET0: case BC_RET1:
2131 if (op != BC_RET0) { 2135 if (op != BC_RET0) {
2132 dasm_put(Dst, 14410); 2136 dasm_put(Dst, 14408);
2133 } 2137 }
2134 dasm_put(Dst, 14414, FRAME_TYPE); 2138 dasm_put(Dst, 14412, FRAME_TYPE);
2135 switch (op) { 2139 switch (op) {
2136 case BC_RET: 2140 case BC_RET:
2137 dasm_put(Dst, 14433); 2141 dasm_put(Dst, 14431);
2138 break; 2142 break;
2139 case BC_RET1: 2143 case BC_RET1:
2140 dasm_put(Dst, 14491); 2144 dasm_put(Dst, 14489);
2141 /* fallthrough */ 2145 /* fallthrough */
2142 case BC_RET0: 2146 case BC_RET0:
2143 dasm_put(Dst, 14507); 2147 dasm_put(Dst, 14505);
2144 default: 2148 default:
2145 break; 2149 break;
2146 } 2150 }
2147 dasm_put(Dst, 14518, Dt7(->pc), PC2PROTO(k)); 2151 dasm_put(Dst, 14516, Dt7(->pc), PC2PROTO(k));
2148 if (op == BC_RET) { 2152 if (op == BC_RET) {
2149 dasm_put(Dst, 14560, LJ_TNIL); 2153 dasm_put(Dst, 14558, LJ_TNIL);
2150 } else { 2154 } else {
2151 dasm_put(Dst, 14569, LJ_TNIL); 2155 dasm_put(Dst, 14567, LJ_TNIL);
2152 } 2156 }
2153 dasm_put(Dst, 14576); 2157 dasm_put(Dst, 14574);
2154 if (op != BC_RET0) { 2158 if (op != BC_RET0) {
2155 dasm_put(Dst, 14597); 2159 dasm_put(Dst, 14595);
2156 } 2160 }
2157 dasm_put(Dst, 4678); 2161 dasm_put(Dst, 4678);
2158 break; 2162 break;
@@ -2162,7 +2166,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2162 2166
2163 case BC_FORL: 2167 case BC_FORL:
2164#if LJ_HASJIT 2168#if LJ_HASJIT
2165 dasm_put(Dst, 14601, HOTCOUNT_PCMASK, GG_DISP2HOT); 2169 dasm_put(Dst, 14599, HOTCOUNT_PCMASK, GG_DISP2HOT);
2166#endif 2170#endif
2167 break; 2171 break;
2168 2172
@@ -2174,57 +2178,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2174 case BC_FORI: 2178 case BC_FORI:
2175 case BC_IFORL: 2179 case BC_IFORL:
2176 vk = (op == BC_IFORL || op == BC_JFORL); 2180 vk = (op == BC_IFORL || op == BC_JFORL);
2177 dasm_put(Dst, 14622); 2181 dasm_put(Dst, 14620);
2178 if (!vk) { 2182 if (!vk) {
2179 dasm_put(Dst, 14626, LJ_TISNUM, LJ_TISNUM); 2183 dasm_put(Dst, 14624, LJ_TISNUM, LJ_TISNUM);
2180 } 2184 }
2181 dasm_put(Dst, 14645); 2185 dasm_put(Dst, 14643);
2182 if (!vk) { 2186 if (!vk) {
2183 dasm_put(Dst, 14649, LJ_TISNUM); 2187 dasm_put(Dst, 14647, LJ_TISNUM);
2184 } 2188 }
2185 if (sse) { 2189 if (sse) {
2186 dasm_put(Dst, 14658); 2190 dasm_put(Dst, 14656);
2187 if (vk) { 2191 if (vk) {
2188 dasm_put(Dst, 14670); 2192 dasm_put(Dst, 14668);
2189 } else { 2193 } else {
2190 dasm_put(Dst, 14689); 2194 dasm_put(Dst, 14687);
2191 } 2195 }
2192 dasm_put(Dst, 14694); 2196 dasm_put(Dst, 14692);
2193 } else { 2197 } else {
2194 dasm_put(Dst, 14707); 2198 dasm_put(Dst, 14705);
2195 if (vk) { 2199 if (vk) {
2196 dasm_put(Dst, 14713); 2200 dasm_put(Dst, 14711);
2197 } else { 2201 } else {
2198 dasm_put(Dst, 14729); 2202 dasm_put(Dst, 14727);
2199 } 2203 }
2200 dasm_put(Dst, 14737); 2204 dasm_put(Dst, 14735);
2201 if (cmov) { 2205 if (cmov) {
2202 dasm_put(Dst, 10767); 2206 dasm_put(Dst, 10765);
2203 } else { 2207 } else {
2204 dasm_put(Dst, 10773); 2208 dasm_put(Dst, 10771);
2205 } 2209 }
2206 if (!cmov) { 2210 if (!cmov) {
2207 dasm_put(Dst, 14742); 2211 dasm_put(Dst, 14740);
2208 } 2212 }
2209 } 2213 }
2210 if (op == BC_FORI) { 2214 if (op == BC_FORI) {
2211 dasm_put(Dst, 14748, -BCBIAS_J*4); 2215 dasm_put(Dst, 14746, -BCBIAS_J*4);
2212 } else if (op == BC_JFORI) { 2216 } else if (op == BC_JFORI) {
2213 dasm_put(Dst, 14758, -BCBIAS_J*4, BC_JLOOP); 2217 dasm_put(Dst, 14756, -BCBIAS_J*4, BC_JLOOP);
2214 } else if (op == BC_IFORL) { 2218 } else if (op == BC_IFORL) {
2215 dasm_put(Dst, 14772, -BCBIAS_J*4); 2219 dasm_put(Dst, 14770, -BCBIAS_J*4);
2216 } else { 2220 } else {
2217 dasm_put(Dst, 14768, BC_JLOOP); 2221 dasm_put(Dst, 14766, BC_JLOOP);
2218 } 2222 }
2219 dasm_put(Dst, 10802); 2223 dasm_put(Dst, 10800);
2220 if (sse) { 2224 if (sse) {
2221 dasm_put(Dst, 14782); 2225 dasm_put(Dst, 14780);
2222 } 2226 }
2223 break; 2227 break;
2224 2228
2225 case BC_ITERL: 2229 case BC_ITERL:
2226#if LJ_HASJIT 2230#if LJ_HASJIT
2227 dasm_put(Dst, 14601, HOTCOUNT_PCMASK, GG_DISP2HOT); 2231 dasm_put(Dst, 14599, HOTCOUNT_PCMASK, GG_DISP2HOT);
2228#endif 2232#endif
2229 break; 2233 break;
2230 2234
@@ -2233,33 +2237,33 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2233 break; 2237 break;
2234#endif 2238#endif
2235 case BC_IITERL: 2239 case BC_IITERL:
2236 dasm_put(Dst, 14793, LJ_TNIL); 2240 dasm_put(Dst, 14791, LJ_TNIL);
2237 if (op == BC_JITERL) { 2241 if (op == BC_JITERL) {
2238 dasm_put(Dst, 14808, BC_JLOOP); 2242 dasm_put(Dst, 14806, BC_JLOOP);
2239 } else { 2243 } else {
2240 dasm_put(Dst, 14822, -BCBIAS_J*4); 2244 dasm_put(Dst, 14820, -BCBIAS_J*4);
2241 } 2245 }
2242 dasm_put(Dst, 11099); 2246 dasm_put(Dst, 11097);
2243 break; 2247 break;
2244 2248
2245 case BC_LOOP: 2249 case BC_LOOP:
2246#if LJ_HASJIT 2250#if LJ_HASJIT
2247 dasm_put(Dst, 14601, HOTCOUNT_PCMASK, GG_DISP2HOT); 2251 dasm_put(Dst, 14599, HOTCOUNT_PCMASK, GG_DISP2HOT);
2248#endif 2252#endif
2249 break; 2253 break;
2250 2254
2251 case BC_ILOOP: 2255 case BC_ILOOP:
2252 dasm_put(Dst, 8414); 2256 dasm_put(Dst, 8412);
2253 break; 2257 break;
2254 2258
2255 case BC_JLOOP: 2259 case BC_JLOOP:
2256#if LJ_HASJIT 2260#if LJ_HASJIT
2257 dasm_put(Dst, 14838, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); 2261 dasm_put(Dst, 14836, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
2258#endif 2262#endif
2259 break; 2263 break;
2260 2264
2261 case BC_JMP: 2265 case BC_JMP:
2262 dasm_put(Dst, 14861, -BCBIAS_J*4); 2266 dasm_put(Dst, 14859, -BCBIAS_J*4);
2263 break; 2267 break;
2264 2268
2265 /* -- Function headers -------------------------------------------------- */ 2269 /* -- Function headers -------------------------------------------------- */
@@ -2282,47 +2286,47 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2282 break; 2286 break;
2283#endif 2287#endif
2284 case BC_IFUNCF: 2288 case BC_IFUNCF:
2285 dasm_put(Dst, 14885, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); 2289 dasm_put(Dst, 14883, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
2286 if (op == BC_JFUNCF) { 2290 if (op == BC_JFUNCF) {
2287 dasm_put(Dst, 14915, BC_JLOOP); 2291 dasm_put(Dst, 14913, BC_JLOOP);
2288 } else { 2292 } else {
2289 dasm_put(Dst, 8414); 2293 dasm_put(Dst, 8412);
2290 } 2294 }
2291 dasm_put(Dst, 14924, LJ_TNIL); 2295 dasm_put(Dst, 14922, LJ_TNIL);
2292 break; 2296 break;
2293 2297
2294 case BC_JFUNCV: 2298 case BC_JFUNCV:
2295#if !LJ_HASJIT 2299#if !LJ_HASJIT
2296 break; 2300 break;
2297#endif 2301#endif
2298 dasm_put(Dst, 10465); 2302 dasm_put(Dst, 10463);
2299 break; /* NYI: compiled vararg functions. */ 2303 break; /* NYI: compiled vararg functions. */
2300 2304
2301 case BC_IFUNCV: 2305 case BC_IFUNCV:
2302 dasm_put(Dst, 14946, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); 2306 dasm_put(Dst, 14944, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
2303 if (op == BC_JFUNCV) { 2307 if (op == BC_JFUNCV) {
2304 dasm_put(Dst, 14915, BC_JLOOP); 2308 dasm_put(Dst, 14913, BC_JLOOP);
2305 } else { 2309 } else {
2306 dasm_put(Dst, 15037, -4+PC2PROTO(k)); 2310 dasm_put(Dst, 15035, -4+PC2PROTO(k));
2307 } 2311 }
2308 dasm_put(Dst, 15059, LJ_TNIL); 2312 dasm_put(Dst, 15057, LJ_TNIL);
2309 break; 2313 break;
2310 2314
2311 case BC_FUNCC: 2315 case BC_FUNCC:
2312 case BC_FUNCCW: 2316 case BC_FUNCCW:
2313 dasm_put(Dst, 15081, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); 2317 dasm_put(Dst, 15079, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
2314 if (op == BC_FUNCC) { 2318 if (op == BC_FUNCC) {
2315 dasm_put(Dst, 15110); 2319 dasm_put(Dst, 15108);
2316 } else { 2320 } else {
2317 dasm_put(Dst, 15114); 2321 dasm_put(Dst, 15112);
2318 } 2322 }
2319 dasm_put(Dst, 15122, DISPATCH_GL(vmstate), ~LJ_VMST_C); 2323 dasm_put(Dst, 15120, DISPATCH_GL(vmstate), ~LJ_VMST_C);
2320 if (op == BC_FUNCC) { 2324 if (op == BC_FUNCC) {
2321 dasm_put(Dst, 15131); 2325 dasm_put(Dst, 15129);
2322 } else { 2326 } else {
2323 dasm_put(Dst, 15135, DISPATCH_GL(wrapf)); 2327 dasm_put(Dst, 15133, DISPATCH_GL(wrapf));
2324 } 2328 }
2325 dasm_put(Dst, 15140, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); 2329 dasm_put(Dst, 15138, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
2326 break; 2330 break;
2327 2331
2328 /* ---------------------------------------------------------------------- */ 2332 /* ---------------------------------------------------------------------- */
@@ -2350,7 +2354,7 @@ static int build_backend(BuildCtx *ctx)
2350 2354
2351 build_subroutines(ctx, cmov, sse); 2355 build_subroutines(ctx, cmov, sse);
2352 2356
2353 dasm_put(Dst, 15165); 2357 dasm_put(Dst, 15163);
2354 for (op = 0; op < BC__MAX; op++) 2358 for (op = 0; op < BC__MAX; op++)
2355 build_ins(ctx, (BCOp)op, op, cmov, sse); 2359 build_ins(ctx, (BCOp)op, op, cmov, sse);
2356 2360
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c
index f1579c8d..29b06438 100644
--- a/src/lj_dispatch.c
+++ b/src/lj_dispatch.c
@@ -409,8 +409,9 @@ ASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns *pc)
409#endif 409#endif
410 call_init(L, fn); 410 call_init(L, fn);
411#if LJ_HASJIT 411#if LJ_HASJIT
412 if (J->L) { /* Marker for hot call. */ 412 if ((uintptr_t)pc & 1) { /* Marker for hot call. */
413 lj_trace_hot(J, pc); 413 J->L = L;
414 lj_trace_hot(J, (const BCIns *)((uintptr_t)pc & ~(uintptr_t)1));
414 goto out; 415 goto out;
415 } 416 }
416#endif 417#endif