Skip to content

Commit

Permalink
Disable x87 floating point GRA
Browse files Browse the repository at this point in the history
* Set the CodeGenerator flag to disable x87 floating point GRA when
SSE2 is not being used for floating point.

* Minor cleanup in RegisterCandidate around the code that uses the
getDisableFloatingPointGRA() query.

Signed-off-by: Daryl Maier <maier@ca.ibm.com>
  • Loading branch information
0xdaryl committed Oct 19, 2020
1 parent cd753ab commit 89a6afe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 33 deletions.
38 changes: 5 additions & 33 deletions compiler/optimizer/RegisterCandidate.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2019 IBM Corp. and others
* Copyright (c) 2000, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -2610,41 +2610,13 @@ TR_RegisterCandidates::assign(TR::Block ** cfgBlocks, int32_t numberOfBlocks, in

if (isFloat)
{
if (debug("disableGlobalFPRs")
|| cg->getDisableFloatingPointGRA()
if (cg->getDisableFloatingPointGRA()
#ifdef J9_PROJECT_SPECIFIC
|| (dt == TR::DecimalLongDouble)
|| (dt == TR::DecimalLongDouble)
#endif
)
{
continue;
}

// Cannot keep FP values on FP stack across a switch on IA32
//
if (!comp()->cg()->getSupportsJavaFloatSemantics())
{
temp = rc->getBlocksLiveOnEntry();
temp |= rc->getBlocksLiveOnExit();
temp &= switchBlocks;
if (!temp.isEmpty())
{
//printf("Discarding FP candidate in %s\n", comp()->getCurrentMethod()->signature());
continue;
}
}

if (0 && comp()->cg()->spillsFPRegistersAcrossCalls())
)
{
temp = rc->getBlocksLiveOnEntry();
temp &= rc->getBlocksLiveOnExit();
temp &= callBlocks;
if (!temp.isEmpty())
{
//dumpOptDetails(comp(), "Discarding FP candidate %d\n", rc->getSymbolReference()->getReferenceNumber());
//printf("Discarding FP candidate in %s\n", comp()->getCurrentMethod()->signature());
continue;
}
continue;
}

firstRegister = cg->getFirstGlobalFPR(), lastRegister = cg->getLastGlobalFPR();
Expand Down
4 changes: 4 additions & 0 deletions compiler/x/codegen/OMRCodeGenerator.cpp
Expand Up @@ -268,6 +268,10 @@ OMR::X86::CodeGenerator::initializeX86(TR::Compilation *comp)
self()->setSupportsAutoSIMD();
self()->setSupportsJavaFloatSemantics();
}
else
{
self()->setDisableFloatingPointGRA();
}

// Choose the best XMM double precision load instruction for the target architecture.
//
Expand Down

0 comments on commit 89a6afe

Please sign in to comment.