summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2015-05-04 06:36:16 +0200
committerMike Pall <mike>2015-05-04 06:36:16 +0200
commit9622d6b8b291644278a7d830556ebf6d670d24ca (patch)
tree55a321cb67b5bb5c439572adb2939693d23b2c61
parent11106aa83374c95f88679452e997229ecedefdcc (diff)
downloadluajit2-9622d6b8b291644278a7d830556ebf6d670d24ca.tar.gz
x86/x64: Fix argument check for bit shifts.
-rw-r--r--src/vm_x86.dasc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc
index 4544a3be..6cdb8cbd 100644
--- a/src/vm_x86.dasc
+++ b/src/vm_x86.dasc
@@ -2564,8 +2564,8 @@ static void build_subroutines(BuildCtx *ctx)
|
|.define TOBIT_BIAS, 0x59c00000 // 2^52 + 2^51 (float, not double!).
|
- |.macro .ffunc_bit, name, kind
- | .ffunc_1 name
+ |.macro .ffunc_bit, name, kind, fdef
+ | fdef name
|.if kind == 2
|.if SSE
| sseconst_tobit xmm1, RBa
@@ -2608,6 +2608,10 @@ static void build_subroutines(BuildCtx *ctx)
|2:
|.endmacro
|
+ |.macro .ffunc_bit, name, kind
+ | .ffunc_bit name, kind, .ffunc_1
+ |.endmacro
+ |
|.ffunc_bit bit_tobit, 0
|.if DUALNUM or SSE
|.if not SSE
@@ -2681,7 +2685,7 @@ static void build_subroutines(BuildCtx *ctx)
|
|.macro .ffunc_bit_sh, name, ins
|.if DUALNUM
- | .ffunc_bit name, 1
+ | .ffunc_bit name, 1, .ffunc_2
| // Note: no inline conversion from number for 2nd argument!
| cmp dword [BASE+12], LJ_TISNUM; jne ->fff_fallback
| mov RA, dword [BASE+8]