From 2ca58aa67d68076f8980395f45ce1215875fc0fc Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Wed, 14 Jul 2010 14:11:48 +0200 Subject: [PATCH] Fix arg check for two-arg SSE math functions in interpreter. --- src/buildvm_x64.h | 12 ++++++------ src/buildvm_x64win.h | 12 ++++++------ src/buildvm_x86.dasc | 2 +- src/buildvm_x86.h | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/buildvm_x64.h b/src/buildvm_x64.h index d98d225d..a44f7e50 100644 --- a/src/buildvm_x64.h +++ b/src/buildvm_x64.h @@ -1206,7 +1206,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) } dasm_put(Dst, 4774, 2+1, LJ_TISNUM, LJ_TISNUM); if (sse) { - dasm_put(Dst, 4826, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 4826, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 4873, 2+1, LJ_TISNUM, LJ_TISNUM); } @@ -1319,27 +1319,27 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) } dasm_put(Dst, 6405); if (sse) { - dasm_put(Dst, 6416, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6416, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6485); if (sse) { - dasm_put(Dst, 6494, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6494, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6563); if (sse) { - dasm_put(Dst, 6573, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6573, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6642); if (sse) { - dasm_put(Dst, 6652, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6652, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6721); if (sse) { - dasm_put(Dst, 6730, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6730, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6799, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h index 81ca8c03..5e57bb3f 100644 --- a/src/buildvm_x64win.h +++ b/src/buildvm_x64win.h @@ -1207,7 +1207,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) } dasm_put(Dst, 4748, 2+1, LJ_TISNUM, LJ_TISNUM); if (sse) { - dasm_put(Dst, 4800, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 4800, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 4847, 2+1, LJ_TISNUM, LJ_TISNUM); } @@ -1320,27 +1320,27 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) } dasm_put(Dst, 6364); if (sse) { - dasm_put(Dst, 6375, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6375, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6444); if (sse) { - dasm_put(Dst, 6453, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6453, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6522); if (sse) { - dasm_put(Dst, 6532, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6532, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6601); if (sse) { - dasm_put(Dst, 6611, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6611, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6680); if (sse) { - dasm_put(Dst, 6689, 1+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); + dasm_put(Dst, 6689, 2+1, LJ_TISNUM, LJ_TISNUM, (unsigned int)(U64x(43380000,00000000)), (unsigned int)((U64x(43380000,00000000))>>32)); } else { } dasm_put(Dst, 6758, 1+2, 1+1, Dt1(->base), 8*LUA_MINSTACK, Dt1(->top), Dt1(->maxstack), Dt8(->f), Dt1(->base)); diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc index 31845526..36151318 100644 --- a/src/buildvm_x86.dasc +++ b/src/buildvm_x86.dasc @@ -1211,7 +1211,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) |.endmacro | |.macro .ffunc_nnsse, name - | .ffunc_1 name + | .ffunc_2 name | cmp dword [BASE+4], LJ_TISNUM; ja ->fff_fallback | cmp dword [BASE+12], LJ_TISNUM; ja ->fff_fallback | movsd xmm0, qword [BASE] diff --git a/src/buildvm_x86.h b/src/buildvm_x86.h index 6f0b6090..e833c3c3 100644 --- a/src/buildvm_x86.h +++ b/src/buildvm_x86.h @@ -1265,7 +1265,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) } dasm_put(Dst, 4858, 2+1, LJ_TISNUM, LJ_TISNUM); if (sse) { - dasm_put(Dst, 4910, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 4910, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 4957, 2+1, LJ_TISNUM, LJ_TISNUM); } @@ -1404,31 +1404,31 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse) } dasm_put(Dst, 6982); if (sse) { - dasm_put(Dst, 6993, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 6993, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 7067, 2+1, LJ_TISNUM, LJ_TISNUM); } dasm_put(Dst, 7133); if (sse) { - dasm_put(Dst, 7142, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 7142, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 7216, 2+1, LJ_TISNUM, LJ_TISNUM); } dasm_put(Dst, 7282); if (sse) { - dasm_put(Dst, 7292, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 7292, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 7366, 2+1, LJ_TISNUM, LJ_TISNUM); } dasm_put(Dst, 7432); if (sse) { - dasm_put(Dst, 7442, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 7442, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 7516, 2+1, LJ_TISNUM, LJ_TISNUM); } dasm_put(Dst, 7582); if (sse) { - dasm_put(Dst, 7591, 1+1, LJ_TISNUM, LJ_TISNUM); + dasm_put(Dst, 7591, 2+1, LJ_TISNUM, LJ_TISNUM); } else { dasm_put(Dst, 7665, 2+1, LJ_TISNUM, LJ_TISNUM); }