diff options
author | Mike Pall <mike> | 2011-09-05 18:32:53 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-09-05 18:34:11 +0200 |
commit | bab2f0efaec441599837e82a9311b63831673faf (patch) | |
tree | b2a1b66c0cdc4a44187b3e4a164bf83bfa06c0db /src | |
parent | 690ff909f58d9a554d6e728933adbcc1bae73e7c (diff) | |
download | luajit-bab2f0efaec441599837e82a9311b63831673faf.tar.gz luajit-bab2f0efaec441599837e82a9311b63831673faf.tar.bz2 luajit-bab2f0efaec441599837e82a9311b63831673faf.zip |
PPC: Fix or remove assembler helper functions.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildvm_ppc.dasc | 18 | ||||
-rw-r--r-- | src/buildvm_ppcspe.dasc | 10 | ||||
-rw-r--r-- | src/buildvm_ppcspe.h | 354 | ||||
-rw-r--r-- | src/lj_vmmath.c | 4 |
4 files changed, 176 insertions, 210 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc index cf748f59..bbe5c741 100644 --- a/src/buildvm_ppc.dasc +++ b/src/buildvm_ppc.dasc | |||
@@ -2316,7 +2316,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
2316 | | | 2316 | | |
2317 | |->vm_modi: | 2317 | |->vm_modi: |
2318 | | divwo. TMP0, CARG1, CARG2 | 2318 | | divwo. TMP0, CARG1, CARG2 |
2319 | | bsolr | 2319 | | bso >1 |
2320 | | xor. CARG3, CARG1, CARG2 | 2320 | | xor. CARG3, CARG1, CARG2 |
2321 | | mullw TMP0, TMP0, CARG2 | 2321 | | mullw TMP0, TMP0, CARG2 |
2322 | | sub CARG1, CARG1, TMP0 | 2322 | | sub CARG1, CARG1, TMP0 |
@@ -2324,16 +2324,12 @@ static void build_subroutines(BuildCtx *ctx) | |||
2324 | | cmpwi CARG1, 0; beqlr | 2324 | | cmpwi CARG1, 0; beqlr |
2325 | | add CARG1, CARG1, CARG2 | 2325 | | add CARG1, CARG1, CARG2 |
2326 | | blr | 2326 | | blr |
2327 | | | 2327 | |1: |
2328 | |->vm_powi: | 2328 | | cmpwi CARG2, 0 |
2329 | #if LJ_HASJIT | 2329 | | li CARG1, 0 |
2330 | | NYI | 2330 | | beqlr |
2331 | #endif | 2331 | | mcrxr cr0 // Clear SO for -2147483648 % -1 and return 0. |
2332 | | | 2332 | | blr |
2333 | |->vm_foldfpm: | ||
2334 | #if LJ_HASJIT | ||
2335 | | NYI | ||
2336 | #endif | ||
2337 | | | 2333 | | |
2338 | |// Callable from C: double lj_vm_foldarith(double x, double y, int op) | 2334 | |// Callable from C: double lj_vm_foldarith(double x, double y, int op) |
2339 | |// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -) | 2335 | |// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -) |
diff --git a/src/buildvm_ppcspe.dasc b/src/buildvm_ppcspe.dasc index 92914f98..49d1b07b 100644 --- a/src/buildvm_ppcspe.dasc +++ b/src/buildvm_ppcspe.dasc | |||
@@ -2037,16 +2037,6 @@ static void build_subroutines(BuildCtx *ctx) | |||
2037 | |->vm_trunc_hilo: | 2037 | |->vm_trunc_hilo: |
2038 | #endif | 2038 | #endif |
2039 | | | 2039 | | |
2040 | |->vm_powi: | ||
2041 | #if LJ_HASJIT | ||
2042 | | NYI | ||
2043 | #endif | ||
2044 | | | ||
2045 | |->vm_foldfpm: | ||
2046 | #if LJ_HASJIT | ||
2047 | | NYI | ||
2048 | #endif | ||
2049 | | | ||
2050 | |// Callable from C: double lj_vm_foldarith(double x, double y, int op) | 2040 | |// Callable from C: double lj_vm_foldarith(double x, double y, int op) |
2051 | |// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -) | 2041 | |// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -) |
2052 | |// and basic math functions. ORDER ARITH | 2042 | |// and basic math functions. ORDER ARITH |
diff --git a/src/buildvm_ppcspe.h b/src/buildvm_ppcspe.h index a3eedd6e..fc3a15d3 100644 --- a/src/buildvm_ppcspe.h +++ b/src/buildvm_ppcspe.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 |
15 | static const unsigned int build_actionlist[5003] = { | 15 | static const unsigned int build_actionlist[4995] = { |
16 | 0x00010001, | 16 | 0x00010001, |
17 | 0x00060014, | 17 | 0x00060014, |
18 | 0x72000000, | 18 | 0x72000000, |
@@ -2770,14 +2770,6 @@ static const unsigned int build_actionlist[5003] = { | |||
2770 | 0x00060097, | 2770 | 0x00060097, |
2771 | 0x00000000, | 2771 | 0x00000000, |
2772 | 0x00060098, | 2772 | 0x00060098, |
2773 | 0x00000000, | ||
2774 | 0x7c810808, | ||
2775 | 0x00000000, | ||
2776 | 0x00060099, | ||
2777 | 0x00000000, | ||
2778 | 0x7c810808, | ||
2779 | 0x00000000, | ||
2780 | 0x0006009a, | ||
2781 | 0x1083222d, | 2773 | 0x1083222d, |
2782 | 0x28070001, | 2774 | 0x28070001, |
2783 | 0x10c5322d, | 2775 | 0x10c5322d, |
@@ -2838,7 +2830,7 @@ static const unsigned int build_actionlist[5003] = { | |||
2838 | 0x4e800020, | 2830 | 0x4e800020, |
2839 | 0x0006000c, | 2831 | 0x0006000c, |
2840 | 0x7c810808, | 2832 | 0x7c810808, |
2841 | 0x0006009b, | 2833 | 0x00060099, |
2842 | 0x00000000, | 2834 | 0x00000000, |
2843 | 0x7c810808, | 2835 | 0x7c810808, |
2844 | 0x00000000, | 2836 | 0x00000000, |
@@ -3319,7 +3311,7 @@ static const unsigned int build_actionlist[5003] = { | |||
3319 | 0x40830000, | 3311 | 0x40830000, |
3320 | 0x0005083d, | 3312 | 0x0005083d, |
3321 | 0x00000000, | 3313 | 0x00000000, |
3322 | 0x0006009c, | 3314 | 0x0006009a, |
3323 | 0x108caae9, | 3315 | 0x108caae9, |
3324 | 0x48000001, | 3316 | 0x48000001, |
3325 | 0x00050094, | 3317 | 0x00050094, |
@@ -3357,7 +3349,7 @@ static const unsigned int build_actionlist[5003] = { | |||
3357 | 0x0005083d, | 3349 | 0x0005083d, |
3358 | 0x00000000, | 3350 | 0x00000000, |
3359 | 0x48000000, | 3351 | 0x48000000, |
3360 | 0x0005009c, | 3352 | 0x0005009a, |
3361 | 0x00000000, | 3353 | 0x00000000, |
3362 | 0x108e5300, | 3354 | 0x108e5300, |
3363 | 0x10ce5b00, | 3355 | 0x10ce5b00, |
@@ -3792,10 +3784,10 @@ static const unsigned int build_actionlist[5003] = { | |||
3792 | 0x7d6f402e, | 3784 | 0x7d6f402e, |
3793 | 0x00000000, | 3785 | 0x00000000, |
3794 | 0x48000000, | 3786 | 0x48000000, |
3795 | 0x0005009d, | 3787 | 0x0005009b, |
3796 | 0x00000000, | 3788 | 0x00000000, |
3797 | 0x48000000, | 3789 | 0x48000000, |
3798 | 0x0005009e, | 3790 | 0x0005009c, |
3799 | 0x00000000, | 3791 | 0x00000000, |
3800 | 0x114e5300, | 3792 | 0x114e5300, |
3801 | 0x116e5b00, | 3793 | 0x116e5b00, |
@@ -3851,7 +3843,7 @@ static const unsigned int build_actionlist[5003] = { | |||
3851 | 0x0006000f, | 3843 | 0x0006000f, |
3852 | 0x100bba34, | 3844 | 0x100bba34, |
3853 | 0x41800000, | 3845 | 0x41800000, |
3854 | 0x0005089d, | 3846 | 0x0005089b, |
3855 | 0x48000000, | 3847 | 0x48000000, |
3856 | 0x0005002f, | 3848 | 0x0005002f, |
3857 | 0x00000000, | 3849 | 0x00000000, |
@@ -3863,7 +3855,7 @@ static const unsigned int build_actionlist[5003] = { | |||
3863 | 0x7d6f402e, | 3855 | 0x7d6f402e, |
3864 | 0x40800000, | 3856 | 0x40800000, |
3865 | 0x0005082c, | 3857 | 0x0005082c, |
3866 | 0x0006009d, | 3858 | 0x0006009b, |
3867 | 0x800a0000, | 3859 | 0x800a0000, |
3868 | 0x00098200, | 3860 | 0x00098200, |
3869 | 0x810b0000, | 3861 | 0x810b0000, |
@@ -4030,7 +4022,7 @@ static const unsigned int build_actionlist[5003] = { | |||
4030 | 0x0006000f, | 4022 | 0x0006000f, |
4031 | 0x100bba34, | 4023 | 0x100bba34, |
4032 | 0x41800000, | 4024 | 0x41800000, |
4033 | 0x0005089e, | 4025 | 0x0005089c, |
4034 | 0x48000000, | 4026 | 0x48000000, |
4035 | 0x00050033, | 4027 | 0x00050033, |
4036 | 0x00060011, | 4028 | 0x00060011, |
@@ -4055,7 +4047,7 @@ static const unsigned int build_actionlist[5003] = { | |||
4055 | 0x7d6f402e, | 4047 | 0x7d6f402e, |
4056 | 0x40800000, | 4048 | 0x40800000, |
4057 | 0x00050830, | 4049 | 0x00050830, |
4058 | 0x0006009e, | 4050 | 0x0006009c, |
4059 | 0x800a0000, | 4051 | 0x800a0000, |
4060 | 0x00098200, | 4052 | 0x00098200, |
4061 | 0x810b0000, | 4053 | 0x810b0000, |
@@ -4656,7 +4648,7 @@ static const unsigned int build_actionlist[5003] = { | |||
4656 | 0x6a080000, | 4648 | 0x6a080000, |
4657 | 0x00090200, | 4649 | 0x00090200, |
4658 | 0x40820000, | 4650 | 0x40820000, |
4659 | 0x0005089f, | 4651 | 0x0005089d, |
4660 | 0x00060017, | 4652 | 0x00060017, |
4661 | 0x80f0fffc, | 4653 | 0x80f0fffc, |
4662 | 0x2c0c0008, | 4654 | 0x2c0c0008, |
@@ -4707,7 +4699,7 @@ static const unsigned int build_actionlist[5003] = { | |||
4707 | 0x13494320, | 4699 | 0x13494320, |
4708 | 0x48000000, | 4700 | 0x48000000, |
4709 | 0x0005000f, | 4701 | 0x0005000f, |
4710 | 0x0006009f, | 4702 | 0x0006009d, |
4711 | 0x71090000, | 4703 | 0x71090000, |
4712 | 0x00090200, | 4704 | 0x00090200, |
4713 | 0x40820000, | 4705 | 0x40820000, |
@@ -4725,7 +4717,7 @@ static const unsigned int build_actionlist[5003] = { | |||
4725 | 0x6a080000, | 4717 | 0x6a080000, |
4726 | 0x00090200, | 4718 | 0x00090200, |
4727 | 0x40820000, | 4719 | 0x40820000, |
4728 | 0x0005089f, | 4720 | 0x0005089d, |
4729 | 0x80f0fffc, | 4721 | 0x80f0fffc, |
4730 | 0x392efff8, | 4722 | 0x392efff8, |
4731 | 0x54ea5d78, | 4723 | 0x54ea5d78, |
@@ -5151,8 +5143,6 @@ enum { | |||
5151 | GLOB_vm_ceil_efd, | 5143 | GLOB_vm_ceil_efd, |
5152 | GLOB_vm_trunc_efd, | 5144 | GLOB_vm_trunc_efd, |
5153 | GLOB_vm_trunc_hilo, | 5145 | GLOB_vm_trunc_hilo, |
5154 | GLOB_vm_powi, | ||
5155 | GLOB_vm_foldfpm, | ||
5156 | GLOB_vm_foldarith, | 5146 | GLOB_vm_foldarith, |
5157 | GLOB_vm_ffi_call, | 5147 | GLOB_vm_ffi_call, |
5158 | GLOB_BC_MODVN_Z, | 5148 | GLOB_BC_MODVN_Z, |
@@ -5294,8 +5284,6 @@ static const char *const globnames[] = { | |||
5294 | "vm_ceil_efd", | 5284 | "vm_ceil_efd", |
5295 | "vm_trunc_efd", | 5285 | "vm_trunc_efd", |
5296 | "vm_trunc_hilo", | 5286 | "vm_trunc_hilo", |
5297 | "vm_powi", | ||
5298 | "vm_foldfpm", | ||
5299 | "vm_foldarith", | 5287 | "vm_foldarith", |
5300 | "vm_ffi_call", | 5288 | "vm_ffi_call", |
5301 | "BC_MODVN_Z", | 5289 | "BC_MODVN_Z", |
@@ -5475,16 +5463,8 @@ static void build_subroutines(BuildCtx *ctx) | |||
5475 | dasm_put(Dst, 2753); | 5463 | dasm_put(Dst, 2753); |
5476 | #endif | 5464 | #endif |
5477 | dasm_put(Dst, 2756); | 5465 | dasm_put(Dst, 2756); |
5478 | #if LJ_HASJIT | ||
5479 | dasm_put(Dst, 2758); | ||
5480 | #endif | ||
5481 | dasm_put(Dst, 2760); | ||
5482 | #if LJ_HASJIT | ||
5483 | dasm_put(Dst, 2762); | ||
5484 | #endif | ||
5485 | dasm_put(Dst, 2764); | ||
5486 | #if LJ_HASFFI | 5466 | #if LJ_HASFFI |
5487 | dasm_put(Dst, 2827); | 5467 | dasm_put(Dst, 2819); |
5488 | #endif | 5468 | #endif |
5489 | } | 5469 | } |
5490 | 5470 | ||
@@ -5492,7 +5472,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
5492 | static void build_ins(BuildCtx *ctx, BCOp op, int defop) | 5472 | static void build_ins(BuildCtx *ctx, BCOp op, int defop) |
5493 | { | 5473 | { |
5494 | int vk = 0; | 5474 | int vk = 0; |
5495 | dasm_put(Dst, 2829, defop); | 5475 | dasm_put(Dst, 2821, defop); |
5496 | 5476 | ||
5497 | switch (op) { | 5477 | switch (op) { |
5498 | 5478 | ||
@@ -5501,118 +5481,118 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5501 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ | 5481 | /* Remember: all ops branch for a true comparison, fall through otherwise. */ |
5502 | 5482 | ||
5503 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: | 5483 | case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: |
5504 | dasm_put(Dst, 2831, -(BCBIAS_J*4 >> 16)); | 5484 | dasm_put(Dst, 2823, -(BCBIAS_J*4 >> 16)); |
5505 | if (op == BC_ISLE || op == BC_ISGT) { | 5485 | if (op == BC_ISLE || op == BC_ISGT) { |
5506 | dasm_put(Dst, 2845); | 5486 | dasm_put(Dst, 2837); |
5507 | } | 5487 | } |
5508 | if (op == BC_ISLT || op == BC_ISLE) { | 5488 | if (op == BC_ISLT || op == BC_ISLE) { |
5509 | dasm_put(Dst, 2848); | 5489 | dasm_put(Dst, 2840); |
5510 | } else { | 5490 | } else { |
5511 | dasm_put(Dst, 2850); | 5491 | dasm_put(Dst, 2842); |
5512 | } | 5492 | } |
5513 | dasm_put(Dst, 2852); | 5493 | dasm_put(Dst, 2844); |
5514 | break; | 5494 | break; |
5515 | 5495 | ||
5516 | case BC_ISEQV: case BC_ISNEV: | 5496 | case BC_ISEQV: case BC_ISNEV: |
5517 | vk = op == BC_ISEQV; | 5497 | vk = op == BC_ISEQV; |
5518 | dasm_put(Dst, 2863, -(BCBIAS_J*4 >> 16)); | 5498 | dasm_put(Dst, 2855, -(BCBIAS_J*4 >> 16)); |
5519 | if (vk) { | 5499 | if (vk) { |
5520 | dasm_put(Dst, 2877); | 5500 | dasm_put(Dst, 2869); |
5521 | } else { | 5501 | } else { |
5522 | dasm_put(Dst, 2879); | 5502 | dasm_put(Dst, 2871); |
5523 | } | 5503 | } |
5524 | dasm_put(Dst, 2881, ~LJ_TISPRI, ~LJ_TISTABUD); | 5504 | dasm_put(Dst, 2873, ~LJ_TISPRI, ~LJ_TISTABUD); |
5525 | if (vk) { | 5505 | if (vk) { |
5526 | dasm_put(Dst, 2903); | 5506 | dasm_put(Dst, 2895); |
5527 | } else { | 5507 | } else { |
5528 | dasm_put(Dst, 2905); | 5508 | dasm_put(Dst, 2897); |
5529 | } | 5509 | } |
5530 | dasm_put(Dst, 2907); | 5510 | dasm_put(Dst, 2899); |
5531 | if (vk) { | 5511 | if (vk) { |
5532 | dasm_put(Dst, 2909); | 5512 | dasm_put(Dst, 2901); |
5533 | } else { | 5513 | } else { |
5534 | dasm_put(Dst, 2911); | 5514 | dasm_put(Dst, 2903); |
5535 | } | 5515 | } |
5536 | dasm_put(Dst, 2913, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq); | 5516 | dasm_put(Dst, 2905, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq); |
5537 | break; | 5517 | break; |
5538 | 5518 | ||
5539 | case BC_ISEQS: case BC_ISNES: | 5519 | case BC_ISEQS: case BC_ISNES: |
5540 | vk = op == BC_ISEQS; | 5520 | vk = op == BC_ISEQS; |
5541 | dasm_put(Dst, 2934, 32-1, -(BCBIAS_J*4 >> 16)); | 5521 | dasm_put(Dst, 2926, 32-1, -(BCBIAS_J*4 >> 16)); |
5542 | if (vk) { | 5522 | if (vk) { |
5543 | dasm_put(Dst, 2948); | 5523 | dasm_put(Dst, 2940); |
5544 | } else { | 5524 | } else { |
5545 | dasm_put(Dst, 2950); | 5525 | dasm_put(Dst, 2942); |
5546 | } | 5526 | } |
5547 | dasm_put(Dst, 2952); | 5527 | dasm_put(Dst, 2944); |
5548 | break; | 5528 | break; |
5549 | 5529 | ||
5550 | case BC_ISEQN: case BC_ISNEN: | 5530 | case BC_ISEQN: case BC_ISNEN: |
5551 | vk = op == BC_ISEQN; | 5531 | vk = op == BC_ISEQN; |
5552 | dasm_put(Dst, 2963, -(BCBIAS_J*4 >> 16)); | 5532 | dasm_put(Dst, 2955, -(BCBIAS_J*4 >> 16)); |
5553 | if (vk) { | 5533 | if (vk) { |
5554 | dasm_put(Dst, 2977); | 5534 | dasm_put(Dst, 2969); |
5555 | } else { | 5535 | } else { |
5556 | dasm_put(Dst, 2980); | 5536 | dasm_put(Dst, 2972); |
5557 | } | 5537 | } |
5558 | dasm_put(Dst, 2982); | 5538 | dasm_put(Dst, 2974); |
5559 | if (!vk) { | 5539 | if (!vk) { |
5560 | dasm_put(Dst, 2994); | 5540 | dasm_put(Dst, 2986); |
5561 | } | 5541 | } |
5562 | break; | 5542 | break; |
5563 | 5543 | ||
5564 | case BC_ISEQP: case BC_ISNEP: | 5544 | case BC_ISEQP: case BC_ISNEP: |
5565 | vk = op == BC_ISEQP; | 5545 | vk = op == BC_ISEQP; |
5566 | dasm_put(Dst, 3000, 32-3, -(BCBIAS_J*4 >> 16)); | 5546 | dasm_put(Dst, 2992, 32-3, -(BCBIAS_J*4 >> 16)); |
5567 | if (vk) { | 5547 | if (vk) { |
5568 | dasm_put(Dst, 3012); | 5548 | dasm_put(Dst, 3004); |
5569 | } else { | 5549 | } else { |
5570 | dasm_put(Dst, 3014); | 5550 | dasm_put(Dst, 3006); |
5571 | } | 5551 | } |
5572 | dasm_put(Dst, 3016); | 5552 | dasm_put(Dst, 3008); |
5573 | break; | 5553 | break; |
5574 | 5554 | ||
5575 | /* -- Unary test and copy ops ------------------------------------------- */ | 5555 | /* -- Unary test and copy ops ------------------------------------------- */ |
5576 | 5556 | ||
5577 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: | 5557 | case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: |
5578 | dasm_put(Dst, 3027); | 5558 | dasm_put(Dst, 3019); |
5579 | if (op == BC_IST || op == BC_ISF) { | 5559 | if (op == BC_IST || op == BC_ISF) { |
5580 | dasm_put(Dst, 3033, -(BCBIAS_J*4 >> 16)); | 5560 | dasm_put(Dst, 3025, -(BCBIAS_J*4 >> 16)); |
5581 | if (op == BC_IST) { | 5561 | if (op == BC_IST) { |
5582 | dasm_put(Dst, 3038); | 5562 | dasm_put(Dst, 3030); |
5583 | } else { | 5563 | } else { |
5584 | dasm_put(Dst, 3040); | 5564 | dasm_put(Dst, 3032); |
5585 | } | 5565 | } |
5586 | } else { | 5566 | } else { |
5587 | if (op == BC_ISTC) { | 5567 | if (op == BC_ISTC) { |
5588 | dasm_put(Dst, 3042); | 5568 | dasm_put(Dst, 3034); |
5589 | } else { | 5569 | } else { |
5590 | dasm_put(Dst, 3045); | 5570 | dasm_put(Dst, 3037); |
5591 | } | 5571 | } |
5592 | dasm_put(Dst, 3048, -(BCBIAS_J*4 >> 16)); | 5572 | dasm_put(Dst, 3040, -(BCBIAS_J*4 >> 16)); |
5593 | } | 5573 | } |
5594 | dasm_put(Dst, 3055); | 5574 | dasm_put(Dst, 3047); |
5595 | break; | 5575 | break; |
5596 | 5576 | ||
5597 | /* -- Unary ops --------------------------------------------------------- */ | 5577 | /* -- Unary ops --------------------------------------------------------- */ |
5598 | 5578 | ||
5599 | case BC_MOV: | 5579 | case BC_MOV: |
5600 | dasm_put(Dst, 3066); | 5580 | dasm_put(Dst, 3058); |
5601 | break; | 5581 | break; |
5602 | case BC_NOT: | 5582 | case BC_NOT: |
5603 | dasm_put(Dst, 3079, LJ_TTRUE); | 5583 | dasm_put(Dst, 3071, LJ_TTRUE); |
5604 | break; | 5584 | break; |
5605 | case BC_UNM: | 5585 | case BC_UNM: |
5606 | dasm_put(Dst, 3095); | 5586 | dasm_put(Dst, 3087); |
5607 | break; | 5587 | break; |
5608 | case BC_LEN: | 5588 | case BC_LEN: |
5609 | dasm_put(Dst, 3112, Dt5(->len)); | 5589 | dasm_put(Dst, 3104, Dt5(->len)); |
5610 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5590 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5611 | dasm_put(Dst, 3136, Dt6(->metatable)); | 5591 | dasm_put(Dst, 3128, Dt6(->metatable)); |
5612 | #endif | 5592 | #endif |
5613 | dasm_put(Dst, 3143); | 5593 | dasm_put(Dst, 3135); |
5614 | #ifdef LUAJIT_ENABLE_LUA52COMPAT | 5594 | #ifdef LUAJIT_ENABLE_LUA52COMPAT |
5615 | dasm_put(Dst, 3149, Dt6(->nomm), 1<<MM_len); | 5595 | dasm_put(Dst, 3141, Dt6(->nomm), 1<<MM_len); |
5616 | #endif | 5596 | #endif |
5617 | break; | 5597 | break; |
5618 | 5598 | ||
@@ -5623,262 +5603,262 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5623 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5603 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5624 | switch (vk) { | 5604 | switch (vk) { |
5625 | case 0: | 5605 | case 0: |
5626 | dasm_put(Dst, 3159); | 5606 | dasm_put(Dst, 3151); |
5627 | break; | 5607 | break; |
5628 | case 1: | 5608 | case 1: |
5629 | dasm_put(Dst, 3165); | 5609 | dasm_put(Dst, 3157); |
5630 | break; | 5610 | break; |
5631 | default: | 5611 | default: |
5632 | dasm_put(Dst, 3171); | 5612 | dasm_put(Dst, 3163); |
5633 | break; | 5613 | break; |
5634 | } | 5614 | } |
5635 | dasm_put(Dst, 3178); | 5615 | dasm_put(Dst, 3170); |
5636 | break; | 5616 | break; |
5637 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: | 5617 | case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: |
5638 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5618 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5639 | switch (vk) { | 5619 | switch (vk) { |
5640 | case 0: | 5620 | case 0: |
5641 | dasm_put(Dst, 3191); | 5621 | dasm_put(Dst, 3183); |
5642 | break; | 5622 | break; |
5643 | case 1: | 5623 | case 1: |
5644 | dasm_put(Dst, 3197); | 5624 | dasm_put(Dst, 3189); |
5645 | break; | 5625 | break; |
5646 | default: | 5626 | default: |
5647 | dasm_put(Dst, 3203); | 5627 | dasm_put(Dst, 3195); |
5648 | break; | 5628 | break; |
5649 | } | 5629 | } |
5650 | dasm_put(Dst, 3210); | 5630 | dasm_put(Dst, 3202); |
5651 | break; | 5631 | break; |
5652 | case BC_MULVN: case BC_MULNV: case BC_MULVV: | 5632 | case BC_MULVN: case BC_MULNV: case BC_MULVV: |
5653 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5633 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5654 | switch (vk) { | 5634 | switch (vk) { |
5655 | case 0: | 5635 | case 0: |
5656 | dasm_put(Dst, 3223); | 5636 | dasm_put(Dst, 3215); |
5657 | break; | 5637 | break; |
5658 | case 1: | 5638 | case 1: |
5659 | dasm_put(Dst, 3229); | 5639 | dasm_put(Dst, 3221); |
5660 | break; | 5640 | break; |
5661 | default: | 5641 | default: |
5662 | dasm_put(Dst, 3235); | 5642 | dasm_put(Dst, 3227); |
5663 | break; | 5643 | break; |
5664 | } | 5644 | } |
5665 | dasm_put(Dst, 3242); | 5645 | dasm_put(Dst, 3234); |
5666 | break; | 5646 | break; |
5667 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: | 5647 | case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: |
5668 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5648 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5669 | switch (vk) { | 5649 | switch (vk) { |
5670 | case 0: | 5650 | case 0: |
5671 | dasm_put(Dst, 3255); | 5651 | dasm_put(Dst, 3247); |
5672 | break; | 5652 | break; |
5673 | case 1: | 5653 | case 1: |
5674 | dasm_put(Dst, 3261); | 5654 | dasm_put(Dst, 3253); |
5675 | break; | 5655 | break; |
5676 | default: | 5656 | default: |
5677 | dasm_put(Dst, 3267); | 5657 | dasm_put(Dst, 3259); |
5678 | break; | 5658 | break; |
5679 | } | 5659 | } |
5680 | dasm_put(Dst, 3274); | 5660 | dasm_put(Dst, 3266); |
5681 | break; | 5661 | break; |
5682 | case BC_MODVN: | 5662 | case BC_MODVN: |
5683 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5663 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5684 | switch (vk) { | 5664 | switch (vk) { |
5685 | case 0: | 5665 | case 0: |
5686 | dasm_put(Dst, 3287); | 5666 | dasm_put(Dst, 3279); |
5687 | break; | 5667 | break; |
5688 | case 1: | 5668 | case 1: |
5689 | dasm_put(Dst, 3293); | 5669 | dasm_put(Dst, 3285); |
5690 | break; | 5670 | break; |
5691 | default: | 5671 | default: |
5692 | dasm_put(Dst, 3299); | 5672 | dasm_put(Dst, 3291); |
5693 | break; | 5673 | break; |
5694 | } | 5674 | } |
5695 | dasm_put(Dst, 3306); | 5675 | dasm_put(Dst, 3298); |
5696 | break; | 5676 | break; |
5697 | case BC_MODNV: case BC_MODVV: | 5677 | case BC_MODNV: case BC_MODVV: |
5698 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); | 5678 | vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); |
5699 | switch (vk) { | 5679 | switch (vk) { |
5700 | case 0: | 5680 | case 0: |
5701 | dasm_put(Dst, 3324); | 5681 | dasm_put(Dst, 3316); |
5702 | break; | 5682 | break; |
5703 | case 1: | 5683 | case 1: |
5704 | dasm_put(Dst, 3330); | 5684 | dasm_put(Dst, 3322); |
5705 | break; | 5685 | break; |
5706 | default: | 5686 | default: |
5707 | dasm_put(Dst, 3336); | 5687 | dasm_put(Dst, 3328); |
5708 | break; | 5688 | break; |
5709 | } | 5689 | } |
5710 | dasm_put(Dst, 3343); | 5690 | dasm_put(Dst, 3335); |
5711 | break; | 5691 | break; |
5712 | case BC_POW: | 5692 | case BC_POW: |
5713 | dasm_put(Dst, 3346); | 5693 | dasm_put(Dst, 3338); |
5714 | break; | 5694 | break; |
5715 | 5695 | ||
5716 | case BC_CAT: | 5696 | case BC_CAT: |
5717 | dasm_put(Dst, 3368, Dt1(->base), 32-3, Dt1(->base)); | 5697 | dasm_put(Dst, 3360, Dt1(->base), 32-3, Dt1(->base)); |
5718 | break; | 5698 | break; |
5719 | 5699 | ||
5720 | /* -- Constant ops ------------------------------------------------------ */ | 5700 | /* -- Constant ops ------------------------------------------------------ */ |
5721 | 5701 | ||
5722 | case BC_KSTR: | 5702 | case BC_KSTR: |
5723 | dasm_put(Dst, 3398, 32-1); | 5703 | dasm_put(Dst, 3390, 32-1); |
5724 | break; | 5704 | break; |
5725 | case BC_KCDATA: | 5705 | case BC_KCDATA: |
5726 | #if LJ_HASFFI | 5706 | #if LJ_HASFFI |
5727 | dasm_put(Dst, 3415, 32-1, LJ_TCDATA); | 5707 | dasm_put(Dst, 3407, 32-1, LJ_TCDATA); |
5728 | #endif | 5708 | #endif |
5729 | break; | 5709 | break; |
5730 | case BC_KSHORT: | 5710 | case BC_KSHORT: |
5731 | dasm_put(Dst, 3434, 32-3); | 5711 | dasm_put(Dst, 3426, 32-3); |
5732 | break; | 5712 | break; |
5733 | case BC_KNUM: | 5713 | case BC_KNUM: |
5734 | dasm_put(Dst, 3450); | 5714 | dasm_put(Dst, 3442); |
5735 | break; | 5715 | break; |
5736 | case BC_KPRI: | 5716 | case BC_KPRI: |
5737 | dasm_put(Dst, 3463, 32-3); | 5717 | dasm_put(Dst, 3455, 32-3); |
5738 | break; | 5718 | break; |
5739 | case BC_KNIL: | 5719 | case BC_KNIL: |
5740 | dasm_put(Dst, 3478); | 5720 | dasm_put(Dst, 3470); |
5741 | break; | 5721 | break; |
5742 | 5722 | ||
5743 | /* -- Upvalue and function ops ------------------------------------------ */ | 5723 | /* -- Upvalue and function ops ------------------------------------------ */ |
5744 | 5724 | ||
5745 | case BC_UGET: | 5725 | case BC_UGET: |
5746 | dasm_put(Dst, 3497, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); | 5726 | dasm_put(Dst, 3489, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); |
5747 | break; | 5727 | break; |
5748 | case BC_USETV: | 5728 | case BC_USETV: |
5749 | dasm_put(Dst, 3518, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -(LJ_TISNUM+1), LJ_TISGCV - (LJ_TISNUM+1), Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); | 5729 | dasm_put(Dst, 3510, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -(LJ_TISNUM+1), LJ_TISGCV - (LJ_TISNUM+1), Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); |
5750 | break; | 5730 | break; |
5751 | case BC_USETS: | 5731 | case BC_USETS: |
5752 | dasm_put(Dst, 3570, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G); | 5732 | dasm_put(Dst, 3562, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_GC_WHITES, GG_DISP2G); |
5753 | break; | 5733 | break; |
5754 | case BC_USETN: | 5734 | case BC_USETN: |
5755 | dasm_put(Dst, 3619, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); | 5735 | dasm_put(Dst, 3611, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); |
5756 | break; | 5736 | break; |
5757 | case BC_USETP: | 5737 | case BC_USETP: |
5758 | dasm_put(Dst, 3640, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v)); | 5738 | dasm_put(Dst, 3632, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v)); |
5759 | break; | 5739 | break; |
5760 | 5740 | ||
5761 | case BC_UCLO: | 5741 | case BC_UCLO: |
5762 | dasm_put(Dst, 3663, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base)); | 5742 | dasm_put(Dst, 3655, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base)); |
5763 | break; | 5743 | break; |
5764 | 5744 | ||
5765 | case BC_FNEW: | 5745 | case BC_FNEW: |
5766 | dasm_put(Dst, 3693, 32-1, Dt1(->base), Dt1(->base)); | 5746 | dasm_put(Dst, 3685, 32-1, Dt1(->base), Dt1(->base)); |
5767 | break; | 5747 | break; |
5768 | 5748 | ||
5769 | /* -- Table ops --------------------------------------------------------- */ | 5749 | /* -- Table ops --------------------------------------------------------- */ |
5770 | 5750 | ||
5771 | case BC_TNEW: | 5751 | case BC_TNEW: |
5772 | case BC_TDUP: | 5752 | case BC_TDUP: |
5773 | dasm_put(Dst, 3719, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); | 5753 | dasm_put(Dst, 3711, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); |
5774 | if (op == BC_TNEW) { | 5754 | if (op == BC_TNEW) { |
5775 | dasm_put(Dst, 3732); | 5755 | dasm_put(Dst, 3724); |
5776 | } else { | 5756 | } else { |
5777 | dasm_put(Dst, 3740, 32-1); | 5757 | dasm_put(Dst, 3732, 32-1); |
5778 | } | 5758 | } |
5779 | dasm_put(Dst, 3747, Dt1(->base)); | 5759 | dasm_put(Dst, 3739, Dt1(->base)); |
5780 | break; | 5760 | break; |
5781 | 5761 | ||
5782 | case BC_GGET: | 5762 | case BC_GGET: |
5783 | case BC_GSET: | 5763 | case BC_GSET: |
5784 | dasm_put(Dst, 3770, 32-1, Dt7(->env)); | 5764 | dasm_put(Dst, 3762, 32-1, Dt7(->env)); |
5785 | if (op == BC_GGET) { | 5765 | if (op == BC_GGET) { |
5786 | dasm_put(Dst, 3778); | 5766 | dasm_put(Dst, 3770); |
5787 | } else { | 5767 | } else { |
5788 | dasm_put(Dst, 3781); | 5768 | dasm_put(Dst, 3773); |
5789 | } | 5769 | } |
5790 | break; | 5770 | break; |
5791 | 5771 | ||
5792 | case BC_TGETV: | 5772 | case BC_TGETV: |
5793 | dasm_put(Dst, 3784, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 5773 | dasm_put(Dst, 3776, Dt6(->asize), Dt6(->array), 31-3, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
5794 | break; | 5774 | break; |
5795 | case BC_TGETS: | 5775 | case BC_TGETS: |
5796 | dasm_put(Dst, 3842, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), DtB(->val), DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 5776 | dasm_put(Dst, 3834, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), DtB(->val), DtB(->next), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
5797 | dasm_put(Dst, 3906); | 5777 | dasm_put(Dst, 3898); |
5798 | break; | 5778 | break; |
5799 | case BC_TGETB: | 5779 | case BC_TGETB: |
5800 | dasm_put(Dst, 3911, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); | 5780 | dasm_put(Dst, 3903, 32-3, Dt6(->asize), Dt6(->array), Dt6(->metatable), Dt6(->nomm), 1<<MM_index); |
5801 | break; | 5781 | break; |
5802 | 5782 | ||
5803 | case BC_TSETV: | 5783 | case BC_TSETV: |
5804 | dasm_put(Dst, 3955, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex); | 5784 | dasm_put(Dst, 3947, Dt6(->asize), Dt6(->array), 31-3, Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex); |
5805 | dasm_put(Dst, 4022, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); | 5785 | dasm_put(Dst, 4014, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); |
5806 | break; | 5786 | break; |
5807 | case BC_TSETS: | 5787 | case BC_TSETS: |
5808 | dasm_put(Dst, 4034, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), 31-5, 31-3, Dt6(->marked), DtB(->key), DtB(->val), LJ_GC_BLACK, DtB(->val), Dt6(->metatable)); | 5788 | dasm_put(Dst, 4026, 32-1, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), 31-5, 31-3, Dt6(->marked), DtB(->key), DtB(->val), LJ_GC_BLACK, DtB(->val), Dt6(->metatable)); |
5809 | dasm_put(Dst, 4095, Dt6(->nomm), 1<<MM_newindex, DtB(->next), Dt6(->metatable), DISPATCH_GL(tmptv), Dt1(->base), Dt6(->nomm), 1<<MM_newindex, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); | 5789 | dasm_put(Dst, 4087, Dt6(->nomm), 1<<MM_newindex, DtB(->next), Dt6(->metatable), DISPATCH_GL(tmptv), Dt1(->base), Dt6(->nomm), 1<<MM_newindex, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); |
5810 | dasm_put(Dst, 4146, Dt6(->marked), Dt6(->gclist)); | 5790 | dasm_put(Dst, 4138, Dt6(->marked), Dt6(->gclist)); |
5811 | break; | 5791 | break; |
5812 | case BC_TSETB: | 5792 | case BC_TSETB: |
5813 | dasm_put(Dst, 4153, 32-3, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked)); | 5793 | dasm_put(Dst, 4145, 32-3, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked)); |
5814 | dasm_put(Dst, 4213, Dt6(->gclist)); | 5794 | dasm_put(Dst, 4205, Dt6(->gclist)); |
5815 | break; | 5795 | break; |
5816 | 5796 | ||
5817 | case BC_TSETM: | 5797 | case BC_TSETM: |
5818 | dasm_put(Dst, 4218, 32-3, Dt6(->asize), 31-3, Dt6(->marked), Dt6(->array), LJ_GC_BLACK, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); | 5798 | dasm_put(Dst, 4210, 32-3, Dt6(->asize), 31-3, Dt6(->marked), Dt6(->array), LJ_GC_BLACK, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); |
5819 | dasm_put(Dst, 4287); | 5799 | dasm_put(Dst, 4279); |
5820 | break; | 5800 | break; |
5821 | 5801 | ||
5822 | /* -- Calls and vararg handling ----------------------------------------- */ | 5802 | /* -- Calls and vararg handling ----------------------------------------- */ |
5823 | 5803 | ||
5824 | case BC_CALLM: | 5804 | case BC_CALLM: |
5825 | dasm_put(Dst, 4290); | 5805 | dasm_put(Dst, 4282); |
5826 | break; | 5806 | break; |
5827 | case BC_CALL: | 5807 | case BC_CALL: |
5828 | dasm_put(Dst, 4292, Dt7(->pc)); | 5808 | dasm_put(Dst, 4284, Dt7(->pc)); |
5829 | break; | 5809 | break; |
5830 | 5810 | ||
5831 | case BC_CALLMT: | 5811 | case BC_CALLMT: |
5832 | dasm_put(Dst, 4312); | 5812 | dasm_put(Dst, 4304); |
5833 | break; | 5813 | break; |
5834 | case BC_CALLT: | 5814 | case BC_CALLT: |
5835 | dasm_put(Dst, 4314, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); | 5815 | dasm_put(Dst, 4306, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); |
5836 | dasm_put(Dst, 4379, FRAME_TYPE); | 5816 | dasm_put(Dst, 4371, FRAME_TYPE); |
5837 | break; | 5817 | break; |
5838 | 5818 | ||
5839 | case BC_ITERC: | 5819 | case BC_ITERC: |
5840 | dasm_put(Dst, 4386, Dt7(->pc)); | 5820 | dasm_put(Dst, 4378, Dt7(->pc)); |
5841 | break; | 5821 | break; |
5842 | 5822 | ||
5843 | case BC_ITERN: | 5823 | case BC_ITERN: |
5844 | #if LJ_HASJIT | 5824 | #if LJ_HASJIT |
5845 | #endif | 5825 | #endif |
5846 | dasm_put(Dst, 4412, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16)); | 5826 | dasm_put(Dst, 4404, Dt6(->asize), Dt6(->array), 31-3, -(BCBIAS_J*4 >> 16), Dt6(->hmask), Dt6(->node), 31-5, 31-3, DtB(->key), -(BCBIAS_J*4 >> 16)); |
5847 | dasm_put(Dst, 4491); | 5827 | dasm_put(Dst, 4483); |
5848 | break; | 5828 | break; |
5849 | 5829 | ||
5850 | case BC_ISNEXT: | 5830 | case BC_ISNEXT: |
5851 | dasm_put(Dst, 4495, LJ_TTAB, LJ_TFUNC, LJ_TNIL, Dt8(->ffid), FF_next_N, 32-1, -(BCBIAS_J*4 >> 16), BC_JMP, BC_ITERC, -(BCBIAS_J*4 >> 16)); | 5831 | dasm_put(Dst, 4487, LJ_TTAB, LJ_TFUNC, LJ_TNIL, Dt8(->ffid), FF_next_N, 32-1, -(BCBIAS_J*4 >> 16), BC_JMP, BC_ITERC, -(BCBIAS_J*4 >> 16)); |
5852 | break; | 5832 | break; |
5853 | 5833 | ||
5854 | case BC_VARG: | 5834 | case BC_VARG: |
5855 | dasm_put(Dst, 4546, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base)); | 5835 | dasm_put(Dst, 4538, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base)); |
5856 | dasm_put(Dst, 4626); | 5836 | dasm_put(Dst, 4618); |
5857 | break; | 5837 | break; |
5858 | 5838 | ||
5859 | /* -- Returns ----------------------------------------------------------- */ | 5839 | /* -- Returns ----------------------------------------------------------- */ |
5860 | 5840 | ||
5861 | case BC_RETM: | 5841 | case BC_RETM: |
5862 | dasm_put(Dst, 4632); | 5842 | dasm_put(Dst, 4624); |
5863 | break; | 5843 | break; |
5864 | 5844 | ||
5865 | case BC_RET: | 5845 | case BC_RET: |
5866 | dasm_put(Dst, 4634, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); | 5846 | dasm_put(Dst, 4626, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); |
5867 | break; | 5847 | break; |
5868 | 5848 | ||
5869 | case BC_RET0: case BC_RET1: | 5849 | case BC_RET0: case BC_RET1: |
5870 | dasm_put(Dst, 4704, FRAME_TYPE, FRAME_VARG); | 5850 | dasm_put(Dst, 4696, FRAME_TYPE, FRAME_VARG); |
5871 | if (op == BC_RET1) { | 5851 | if (op == BC_RET1) { |
5872 | dasm_put(Dst, 4717); | 5852 | dasm_put(Dst, 4709); |
5873 | } | 5853 | } |
5874 | dasm_put(Dst, 4720, Dt7(->pc), PC2PROTO(k)); | 5854 | dasm_put(Dst, 4712, Dt7(->pc), PC2PROTO(k)); |
5875 | break; | 5855 | break; |
5876 | 5856 | ||
5877 | /* -- Loops and branches ------------------------------------------------ */ | 5857 | /* -- Loops and branches ------------------------------------------------ */ |
5878 | 5858 | ||
5879 | case BC_FORL: | 5859 | case BC_FORL: |
5880 | #if LJ_HASJIT | 5860 | #if LJ_HASJIT |
5881 | dasm_put(Dst, 4748); | 5861 | dasm_put(Dst, 4740); |
5882 | #endif | 5862 | #endif |
5883 | break; | 5863 | break; |
5884 | 5864 | ||
@@ -5890,35 +5870,35 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5890 | case BC_FORI: | 5870 | case BC_FORI: |
5891 | case BC_IFORL: | 5871 | case BC_IFORL: |
5892 | vk = (op == BC_IFORL || op == BC_JFORL); | 5872 | vk = (op == BC_IFORL || op == BC_JFORL); |
5893 | dasm_put(Dst, 4750, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8); | 5873 | dasm_put(Dst, 4742, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8); |
5894 | if (!vk) { | 5874 | if (!vk) { |
5895 | dasm_put(Dst, 4758); | 5875 | dasm_put(Dst, 4750); |
5896 | } | 5876 | } |
5897 | if (vk) { | 5877 | if (vk) { |
5898 | dasm_put(Dst, 4766, FORL_IDX*8); | 5878 | dasm_put(Dst, 4758, FORL_IDX*8); |
5899 | } | 5879 | } |
5900 | dasm_put(Dst, 4770, FORL_EXT*8); | 5880 | dasm_put(Dst, 4762, FORL_EXT*8); |
5901 | if (op != BC_JFORL) { | 5881 | if (op != BC_JFORL) { |
5902 | dasm_put(Dst, 4778, 32-1); | 5882 | dasm_put(Dst, 4770, 32-1); |
5903 | if (op == BC_JFORI) { | 5883 | if (op == BC_JFORI) { |
5904 | dasm_put(Dst, 4782, -(BCBIAS_J*4 >> 16)); | 5884 | dasm_put(Dst, 4774, -(BCBIAS_J*4 >> 16)); |
5905 | } else { | 5885 | } else { |
5906 | dasm_put(Dst, 4785, -(BCBIAS_J*4 >> 16)); | 5886 | dasm_put(Dst, 4777, -(BCBIAS_J*4 >> 16)); |
5907 | } | 5887 | } |
5908 | } | 5888 | } |
5909 | if (op == BC_FORI) { | 5889 | if (op == BC_FORI) { |
5910 | dasm_put(Dst, 4788); | 5890 | dasm_put(Dst, 4780); |
5911 | } else if (op == BC_IFORL) { | 5891 | } else if (op == BC_IFORL) { |
5912 | dasm_put(Dst, 4790); | 5892 | dasm_put(Dst, 4782); |
5913 | } else { | 5893 | } else { |
5914 | dasm_put(Dst, 4792, BC_JLOOP); | 5894 | dasm_put(Dst, 4784, BC_JLOOP); |
5915 | } | 5895 | } |
5916 | dasm_put(Dst, 4795); | 5896 | dasm_put(Dst, 4787); |
5917 | break; | 5897 | break; |
5918 | 5898 | ||
5919 | case BC_ITERL: | 5899 | case BC_ITERL: |
5920 | #if LJ_HASJIT | 5900 | #if LJ_HASJIT |
5921 | dasm_put(Dst, 4810); | 5901 | dasm_put(Dst, 4802); |
5922 | #endif | 5902 | #endif |
5923 | break; | 5903 | break; |
5924 | 5904 | ||
@@ -5927,40 +5907,40 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5927 | break; | 5907 | break; |
5928 | #endif | 5908 | #endif |
5929 | case BC_IITERL: | 5909 | case BC_IITERL: |
5930 | dasm_put(Dst, 4812); | 5910 | dasm_put(Dst, 4804); |
5931 | if (op == BC_JITERL) { | 5911 | if (op == BC_JITERL) { |
5932 | dasm_put(Dst, 4818); | 5912 | dasm_put(Dst, 4810); |
5933 | } else { | 5913 | } else { |
5934 | dasm_put(Dst, 4820, 32-1, -(BCBIAS_J*4 >> 16)); | 5914 | dasm_put(Dst, 4812, 32-1, -(BCBIAS_J*4 >> 16)); |
5935 | } | 5915 | } |
5936 | dasm_put(Dst, 4827); | 5916 | dasm_put(Dst, 4819); |
5937 | break; | 5917 | break; |
5938 | 5918 | ||
5939 | case BC_LOOP: | 5919 | case BC_LOOP: |
5940 | #if LJ_HASJIT | 5920 | #if LJ_HASJIT |
5941 | dasm_put(Dst, 4839); | 5921 | dasm_put(Dst, 4831); |
5942 | #endif | 5922 | #endif |
5943 | break; | 5923 | break; |
5944 | 5924 | ||
5945 | case BC_ILOOP: | 5925 | case BC_ILOOP: |
5946 | dasm_put(Dst, 4841); | 5926 | dasm_put(Dst, 4833); |
5947 | break; | 5927 | break; |
5948 | 5928 | ||
5949 | case BC_JLOOP: | 5929 | case BC_JLOOP: |
5950 | #if LJ_HASJIT | 5930 | #if LJ_HASJIT |
5951 | dasm_put(Dst, 4852); | 5931 | dasm_put(Dst, 4844); |
5952 | #endif | 5932 | #endif |
5953 | break; | 5933 | break; |
5954 | 5934 | ||
5955 | case BC_JMP: | 5935 | case BC_JMP: |
5956 | dasm_put(Dst, 4854, 32-1, -(BCBIAS_J*4 >> 16)); | 5936 | dasm_put(Dst, 4846, 32-1, -(BCBIAS_J*4 >> 16)); |
5957 | break; | 5937 | break; |
5958 | 5938 | ||
5959 | /* -- Function headers -------------------------------------------------- */ | 5939 | /* -- Function headers -------------------------------------------------- */ |
5960 | 5940 | ||
5961 | case BC_FUNCF: | 5941 | case BC_FUNCF: |
5962 | #if LJ_HASJIT | 5942 | #if LJ_HASJIT |
5963 | dasm_put(Dst, 4870); | 5943 | dasm_put(Dst, 4862); |
5964 | #endif | 5944 | #endif |
5965 | case BC_FUNCV: /* NYI: compiled vararg functions. */ | 5945 | case BC_FUNCV: /* NYI: compiled vararg functions. */ |
5966 | break; | 5946 | break; |
@@ -5970,38 +5950,38 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
5970 | break; | 5950 | break; |
5971 | #endif | 5951 | #endif |
5972 | case BC_IFUNCF: | 5952 | case BC_IFUNCF: |
5973 | dasm_put(Dst, 4872, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3); | 5953 | dasm_put(Dst, 4864, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3); |
5974 | if (op == BC_JFUNCF) { | 5954 | if (op == BC_JFUNCF) { |
5975 | dasm_put(Dst, 4890); | 5955 | dasm_put(Dst, 4882); |
5976 | } else { | 5956 | } else { |
5977 | dasm_put(Dst, 4892); | 5957 | dasm_put(Dst, 4884); |
5978 | } | 5958 | } |
5979 | dasm_put(Dst, 4901); | 5959 | dasm_put(Dst, 4893); |
5980 | break; | 5960 | break; |
5981 | 5961 | ||
5982 | case BC_JFUNCV: | 5962 | case BC_JFUNCV: |
5983 | #if !LJ_HASJIT | 5963 | #if !LJ_HASJIT |
5984 | break; | 5964 | break; |
5985 | #endif | 5965 | #endif |
5986 | dasm_put(Dst, 4907); | 5966 | dasm_put(Dst, 4899); |
5987 | break; /* NYI: compiled vararg functions. */ | 5967 | break; /* NYI: compiled vararg functions. */ |
5988 | 5968 | ||
5989 | case BC_IFUNCV: | 5969 | case BC_IFUNCV: |
5990 | dasm_put(Dst, 4909, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams)); | 5970 | dasm_put(Dst, 4901, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams)); |
5991 | break; | 5971 | break; |
5992 | 5972 | ||
5993 | case BC_FUNCC: | 5973 | case BC_FUNCC: |
5994 | case BC_FUNCCW: | 5974 | case BC_FUNCCW: |
5995 | if (op == BC_FUNCC) { | 5975 | if (op == BC_FUNCC) { |
5996 | dasm_put(Dst, 4959, Dt8(->f)); | 5976 | dasm_put(Dst, 4951, Dt8(->f)); |
5997 | } else { | 5977 | } else { |
5998 | dasm_put(Dst, 4962, DISPATCH_GL(wrapf)); | 5978 | dasm_put(Dst, 4954, DISPATCH_GL(wrapf)); |
5999 | } | 5979 | } |
6000 | dasm_put(Dst, 4965, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C); | 5980 | dasm_put(Dst, 4957, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C); |
6001 | if (op == BC_FUNCCW) { | 5981 | if (op == BC_FUNCCW) { |
6002 | dasm_put(Dst, 4978, Dt8(->f)); | 5982 | dasm_put(Dst, 4970, Dt8(->f)); |
6003 | } | 5983 | } |
6004 | dasm_put(Dst, 4981, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate)); | 5984 | dasm_put(Dst, 4973, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate)); |
6005 | break; | 5985 | break; |
6006 | 5986 | ||
6007 | /* ---------------------------------------------------------------------- */ | 5987 | /* ---------------------------------------------------------------------- */ |
@@ -6021,7 +6001,7 @@ static int build_backend(BuildCtx *ctx) | |||
6021 | 6001 | ||
6022 | build_subroutines(ctx); | 6002 | build_subroutines(ctx); |
6023 | 6003 | ||
6024 | dasm_put(Dst, 5002); | 6004 | dasm_put(Dst, 4994); |
6025 | for (op = 0; op < BC__MAX; op++) | 6005 | for (op = 0; op < BC__MAX; op++) |
6026 | build_ins(ctx, (BCOp)op, op); | 6006 | build_ins(ctx, (BCOp)op, op); |
6027 | 6007 | ||
diff --git a/src/lj_vmmath.c b/src/lj_vmmath.c index 8ae8863b..46f06504 100644 --- a/src/lj_vmmath.c +++ b/src/lj_vmmath.c | |||
@@ -39,7 +39,7 @@ double lj_vm_exp2(double a) | |||
39 | } | 39 | } |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #if !LJ_TARGET_ARM | 42 | #if !(LJ_TARGET_ARM || LJ_TARGET_PPC) |
43 | int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b) | 43 | int32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b) |
44 | { | 44 | { |
45 | uint32_t y, ua, ub; | 45 | uint32_t y, ua, ub; |
@@ -81,7 +81,7 @@ double lj_vm_powi(double x, int32_t k) | |||
81 | else if (k == 1) | 81 | else if (k == 1) |
82 | return x; | 82 | return x; |
83 | else if (k == 0) | 83 | else if (k == 0) |
84 | return 1; | 84 | return 1.0; |
85 | else | 85 | else |
86 | return 1.0 / lj_vm_powui(x, (uint32_t)-k); | 86 | return 1.0 / lj_vm_powui(x, (uint32_t)-k); |
87 | } | 87 | } |