Skip to content

Commit

Permalink
Disable Max Min Helper on Z10 and below
Browse files Browse the repository at this point in the history
Max Min Helper in z codegen uses LOCR instructions
which are unsupported below Z10. This commit disables
max min optimization when on Z10 and below.

Issue: #2969

Signed-off-by: Daniel Hong <daniel.hong@live.com>
  • Loading branch information
dhong44 committed Sep 18, 2018
1 parent 3994cd6 commit 04c6437
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/z/codegen/ControlFlowEvaluator.cpp
Expand Up @@ -910,6 +910,9 @@ lcmpHelper(TR::Node * node, TR::CodeGenerator * cg)
*/
static TR::Register * maxMinHelper(TR::Node *node, TR::CodeGenerator *cg, bool isMax)
{
TR_ASSERT_FATAL(cg->getS390ProcessorInfo()->supportsArch(TR_S390ProcessorInfo::TR_z196),
"cannot evaluate %s on z10 or below", node->getOpCode().getName());

TR::Register *registerA = cg->gprClobberEvaluate(node->getFirstChild());
TR::Register *registerB = cg->evaluate(node->getSecondChild());
// Mask is 4 to pick b when a is Lower for max, 2 to pick b when a is higher for min
Expand Down
4 changes: 4 additions & 0 deletions compiler/z/codegen/OMRCodeGenerator.cpp
Expand Up @@ -705,6 +705,10 @@ OMR::Z::CodeGenerator::CodeGenerator()
{
self()->setSupportsAtomicLoadAndAdd();
}
else
{
comp->setOption(TR_DisableMaxMinOptimization);
}

if (_processorInfo.supportsArch(TR_S390ProcessorInfo::TR_zEC12))
{
Expand Down

0 comments on commit 04c6437

Please sign in to comment.