Fix pow() optimization inconsistencies.

This commit is contained in:
Mike Pall
2022-01-24 14:37:50 +01:00
parent c18acfe756
commit 9512d5c1ac
15 changed files with 114 additions and 205 deletions

View File

@@ -1667,14 +1667,17 @@ static void build_subroutines(BuildCtx *ctx)
|. nop
|.endmacro
|
|.macro math_extern2, func
| .ffunc_nn math_ .. func
|.macro math_extern2, name, func
| .ffunc_nn math_ .. name
|. load_got func
| call_extern
|. nop
| b ->fff_resn
|. nop
|.endmacro
|.macro math_extern2, func
| math_extern2 func, func
|.endmacro
|
|// TODO: Return integer type if result is integer (own sf implementation).
|.macro math_round, func
@@ -1728,7 +1731,7 @@ static void build_subroutines(BuildCtx *ctx)
| math_extern sinh
| math_extern cosh
| math_extern tanh
| math_extern2 pow
| math_extern2 pow, lj_vm_pow
| math_extern2 atan2
| math_extern2 fmod
|
@@ -3915,7 +3918,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| sltiu TMP0, TMP0, LJ_TISNUM
| sltiu TMP1, TMP1, LJ_TISNUM
| and AT, TMP0, TMP1
| load_got pow
| load_got lj_vm_pow
| beqz AT, ->vmeta_arith
|. daddu RA, BASE, RA
|.if FPU