diff --git a/vm/jit_x86.c b/vm/jit_x86.c index 3b01df2c..e2fefde8 100644 --- a/vm/jit_x86.c +++ b/vm/jit_x86.c @@ -1323,7 +1323,7 @@ static void jit_number_op( jit_ctx *ctx, enum Operation op ) { XMov_rp(TMP2,TMP,FIELD(0)); XCmp_rb(TMP2,VAL_FLOAT); XJump(JNeq,jnot_float2); - + // load floats XAdd_rc(ACC,4); XFLd_i(ACC); @@ -1358,7 +1358,7 @@ static void jit_number_op( jit_ctx *ctx, enum Operation op ) { } if( op != OP_MOD ) { stack_push(Esp,2); - } + } XFStp_i(Esp); XCall_m(alloc_float); stack_pop(Esp,2); @@ -1371,7 +1371,7 @@ static void jit_number_op( jit_ctx *ctx, enum Operation op ) { PATCH_JUMP(jnot_int2); begin_call(); - XPush_c(GET_PC()); + XPush_c(GET_PC()); XPush_r(ACC); XPush_r(TMP); XPush_r(VM); @@ -1415,18 +1415,23 @@ static void jit_int_op( jit_ctx *ctx, enum IOperation op ) { XMov_rp(ACC,SP,FIELD(0)); is_int(ACC,false,jerr1); is_int(TMP,false,jerr2); - XShr_rc(TMP,1); - XShr_rc(ACC,1); switch( op ) { case IOP_SHL: + XShr_rc(ACC,1); + XShr_rc(TMP,1); XShl_rr(ACC,TMP); + best_int(); break; case IOP_SHR: + XShr_rc(TMP,1); XShr_rr(ACC,TMP); + XOr_rc(ACC,1); break; case IOP_USHR: + XShr_rc(TMP,1); XUShr_rr(ACC,TMP); + XOr_rc(ACC,1); break; case IOP_AND: XAnd_rr(ACC,TMP); @@ -1436,12 +1441,12 @@ static void jit_int_op( jit_ctx *ctx, enum IOperation op ) { break; case IOP_XOR: XXor_rr(ACC,TMP); + XOr_rc(ACC,1); break; default: ERROR; } - best_int(); XJump_near(jend); PATCH_JUMP(jerr1); @@ -1477,7 +1482,7 @@ static void jit_int_op( jit_ctx *ctx, enum IOperation op ) { } stack_pop(Esp,4); end_call(); - + PATCH_JUMP(jend); pop(1);