From 8c3ca557cb4031087eb307e704867f2fc9925a05 Mon Sep 17 00:00:00 2001 From: Luke Li Date: Mon, 20 Jan 2025 17:50:40 -0500 Subject: [PATCH] Fast Path Math.min/max_F/D 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 --- runtime/compiler/p/codegen/J9CodeGenerator.cpp | 6 ++++++ runtime/compiler/p/codegen/J9TreeEvaluator.cpp | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/compiler/p/codegen/J9CodeGenerator.cpp b/runtime/compiler/p/codegen/J9CodeGenerator.cpp index dbb88f3e3c3..1a784de9d9b 100644 --- a/runtime/compiler/p/codegen/J9CodeGenerator.cpp +++ b/runtime/compiler/p/codegen/J9CodeGenerator.cpp @@ -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. diff --git a/runtime/compiler/p/codegen/J9TreeEvaluator.cpp b/runtime/compiler/p/codegen/J9TreeEvaluator.cpp index 64e0cafa2f3..ba6f08442ef 100644 --- a/runtime/compiler/p/codegen/J9TreeEvaluator.cpp +++ b/runtime/compiler/p/codegen/J9TreeEvaluator.cpp @@ -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);