Disable FMA by default. Use -Ofma or jit.opt.start("+fma") to enable.

See the discussion in #918 for the rationale.
This commit is contained in:
Mike Pall
2022-12-07 18:38:22 +01:00
parent 7d5d4a1b1a
commit de2e1ca9d3
7 changed files with 35 additions and 6 deletions

View File

@@ -337,7 +337,8 @@ static int asm_fusemadd(ASMState *as, IRIns *ir, A64Ins ai, A64Ins air)
{
IRRef lref = ir->op1, rref = ir->op2;
IRIns *irm;
if (lref != rref &&
if ((as->flags & JIT_F_OPT_FMA) &&
lref != rref &&
((mayfuse(as, lref) && (irm = IR(lref), irm->o == IR_MUL) &&
ra_noreg(irm->r)) ||
(mayfuse(as, rref) && (irm = IR(rref), irm->o == IR_MUL) &&