Skip to content

Commit

Permalink
Fast Path Math.min/max_F/D
Browse files Browse the repository at this point in the history
Re-enable the fast-pathing of Math.min/max for floating
points with the behaviours around +/-0.0 and NaN correctly
handled.

Signed-off-by: Luke Li <[email protected]>
  • Loading branch information
luke-li-2003 committed Jan 27, 2025
1 parent e395c4f commit 8c3ca55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions runtime/compiler/p/codegen/J9CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ J9::Power::CodeGenerator::initialize()
cg->setIsDualTLH();
}

static bool disableInlineMath_MaxMin_FD = feGetEnv("TR_disableInlineMaxMin") != NULL;
if (!disableInlineMath_MaxMin_FD && comp->target().cpu.isAtLeast(OMR_PROCESSOR_PPC_P7))
{
cg->setSupportsInlineMath_MaxMin_FD();
}

/*
* "Statically" initialize the FE-specific tree evaluator functions.
* This code only needs to execute once per JIT lifetime.
Expand Down
1 change: 0 additions & 1 deletion runtime/compiler/p/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12173,7 +12173,6 @@ J9::Power::CodeGenerator::inlineDirectCall(TR::Node *node, TR::Register *&result
return true;
}
break;

case TR::java_lang_Math_fma_D:
case TR::java_lang_StrictMath_fma_D:
resultReg = inlineFPTrg1Src3(node, TR::InstOpCode::fmadd, cg);
Expand Down

0 comments on commit 8c3ca55

Please sign in to comment.