Skip to content

Commit

Permalink
Merge pull request LuaJIT#86 from cbaylis/fix-div
Browse files Browse the repository at this point in the history
Fix divide by -1.
  • Loading branch information
cbaylis authored Sep 2, 2016
2 parents 263a49a + ba65697 commit 6989976
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lj_opt_fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ LJFOLDF(simplify_nummuldiv_k)
return LEFTFOLD;
} else if (n == -1.0) { /* x o -1 ==> -x */
fins->o = IR_NEG;
fins->op2 = (IRRef1)lj_ir_ksimd(J, LJ_KSIMD_NEG);
fins->op2 = lj_ir_k64(J, IR_KNUM, LJ_KSIMD(J, LJ_KSIMD_NEG)->u64);
return RETRYFOLD;
} else if (fins->o == IR_MUL && n == 2.0) { /* x * 2 ==> x + x */
fins->o = IR_ADD;
Expand Down
8 changes: 4 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ LUAJIT?=luajit
LUA_FLAGS?=-jdump=+rsXa
# Define tests which should be skipped for some reasons.
SKIPPED_LUA_TEST=fpm_cos addov
# mul and div on x86 fail due to issue with XCFLAGS="-DLUAJIT_ENABLE_GC64"
SKIPPED_LUA_TEST_x86_64=mul div
SKIPPED_LUA_TEST_i686=mul div
# mul on x86 fail due to issue with XCFLAGS="-DLUAJIT_ENABLE_GC64"
SKIPPED_LUA_TEST_x86_64=mul
SKIPPED_LUA_TEST_i686=mul
# Below features have not been implemented on aarch64.
SKIPPED_LUA_TEST_aarch64=div call_vararg \
SKIPPED_LUA_TEST_aarch64=call_vararg \
snew \
vload xstore_addvalue fstore xload_int \
abs atan2 ldexp max min pow \
Expand Down

0 comments on commit 6989976

Please sign in to comment.