Skip to content

Commit

Permalink
Merge pull request #5618 from 0xdaryl/nox87gra
Browse files Browse the repository at this point in the history
Disable x87 floating point GRA
  • Loading branch information
vijaysun-omr committed Oct 22, 2020
2 parents 6b0f48b + 89a6afe commit 34e6c71
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 38 deletions.
4 changes: 2 additions & 2 deletions compiler/arm/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ OMR::ARM::CodeGenerator::initialize()
_numFPR = _linkageProperties->getNumAllocatableFloatRegisters();

// TODO: Disable FP-GRA since current GRA does not work well with ARM linkage (where Float register usage is limited).
cg->setDisableFpGRA();
cg->setDisableFloatingPointGRA();

cg->setSupportsRecompilation();

Expand Down Expand Up @@ -303,7 +303,7 @@ OMR::ARM::CodeGenerator::CodeGenerator()
_numFPR = _linkageProperties->getNumAllocatableFloatRegisters();

// TODO: Disable FP-GRA since current GRA does not work well with ARM linkage (where Float register usage is limited).
self()->setDisableFpGRA();
self()->setDisableFloatingPointGRA();

self()->setSupportsRecompilation();

Expand Down
6 changes: 3 additions & 3 deletions compiler/codegen/OMRCodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,8 +1469,8 @@ class OMR_EXTENSIBLE CodeGenerator
bool getDisableLongGRA() {return _flags1.testAny(DisableLongGRA);}
void setDisableLongGRA() {_flags1.set(DisableLongGRA);}

bool getDisableFpGRA() {return _flags2.testAny(DisableFpGRA);}
void setDisableFpGRA() {_flags2.set(DisableFpGRA);}
bool getDisableFloatingPointGRA() {return _flags2.testAny(DisableFloatingPointGRA);}
void setDisableFloatingPointGRA() {_flags2.set(DisableFloatingPointGRA);}

bool usesRegisterMaps() {return _flags1.testAny(UsesRegisterMaps);}
void setUsesRegisterMaps() {_flags1.set(UsesRegisterMaps);}
Expand Down Expand Up @@ -1767,7 +1767,7 @@ class OMR_EXTENSIBLE CodeGenerator
HasCCInfo = 0x00200000,
SupportsReverseLoadAndStore = 0x00400000,
SupportsLoweringConstLDivPower2 = 0x00800000,
DisableFpGRA = 0x01000000,
DisableFloatingPointGRA = 0x01000000,
// AVAILABLE = 0x02000000,
MethodModifiedByRA = 0x04000000,
// AVAILABLE = 0x08000000,
Expand Down
38 changes: 5 additions & 33 deletions compiler/optimizer/RegisterCandidate.cpp
Original file line number Diff line number Diff line change
@@ -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->getDisableFpGRA()
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
Original file line number Diff line number Diff line change
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 34e6c71

Please sign in to comment.