Skip to content

Commit

Permalink
Deperecate all DFP opcodes and datatypes
Browse files Browse the repository at this point in the history
This commit is the mean of the change to deprecate DFP related code.
Here we remove all the opcodes and datatypes related to DFP along with
cleaning up some intertwined APIs.

The following is a list of opcodes we removed:

- dfconst
- ddconst
- deconst
- dfload
- ddload
- deload
- dfloadi
- ddloadi
- deloadi
- dfstore
- ddstore
- destore
- dfstorei
- ddstorei
- destorei
- dfreturn
- ddreturn
- dereturn
- dfcall
- ddcall
- decall
- dfcalli
- ddcalli
- decalli
- dfadd
- ddadd
- deadd
- dfsub
- ddsub
- desub
- dfmul
- ddmul
- demul
- dfdiv
- dddiv
- dediv
- dfrem
- ddrem
- derem
- dfneg
- ddneg
- deneg
- dfabs
- ddabs
- deabs
- dfshl
- dfshr
- ddshl
- ddshr
- deshl
- deshr
- dfshrRounded
- ddshrRounded
- deshrRounded
- dfSetNegative
- ddSetNegative
- deSetNegative
- dfModifyPrecision
- ddModifyPrecision
- deModifyPrecision
- i2df
- iu2df
- l2df
- lu2df
- f2df
- d2df
- dd2df
- de2df
- b2df
- bu2df
- s2df
- su2df
- df2i
- df2iu
- df2l
- df2lu
- df2f
- df2d
- df2dd
- df2de
- df2b
- df2bu
- df2s
- df2c
- i2dd
- iu2dd
- l2dd
- lu2dd
- f2dd
- d2dd
- de2dd
- b2dd
- bu2dd
- s2dd
- su2dd
- dd2i
- dd2iu
- dd2l
- dd2lu
- dd2f
- dd2d
- dd2de
- dd2b
- dd2bu
- dd2s
- dd2c
- i2de
- iu2de
- l2de
- lu2de
- f2de
- d2de
- b2de
- bu2de
- s2de
- su2de
- de2i
- de2iu
- de2l
- de2lu
- de2f
- de2d
- de2b
- de2bu
- de2s
- de2c
- ifdfcmpeq
- ifdfcmpne
- ifdfcmplt
- ifdfcmpge
- ifdfcmpgt
- ifdfcmple
- ifdfcmpequ
- ifdfcmpneu
- ifdfcmpltu
- ifdfcmpgeu
- ifdfcmpgtu
- ifdfcmpleu
- dfcmpeq
- dfcmpne
- dfcmplt
- dfcmpge
- dfcmpgt
- dfcmple
- dfcmpequ
- dfcmpneu
- dfcmpltu
- dfcmpgeu
- dfcmpgtu
- dfcmpleu
- ifddcmpeq
- ifddcmpne
- ifddcmplt
- ifddcmpge
- ifddcmpgt
- ifddcmple
- ifddcmpequ
- ifddcmpneu
- ifddcmpltu
- ifddcmpgeu
- ifddcmpgtu
- ifddcmpleu
- ddcmpeq
- ddcmpne
- ddcmplt
- ddcmpge
- ddcmpgt
- ddcmple
- ddcmpequ
- ddcmpneu
- ddcmpltu
- ddcmpgeu
- ddcmpgtu
- ddcmpleu
- ifdecmpeq
- ifdecmpne
- ifdecmplt
- ifdecmpge
- ifdecmpgt
- ifdecmple
- ifdecmpequ
- ifdecmpneu
- ifdecmpltu
- ifdecmpgeu
- ifdecmpgtu
- ifdecmpleu
- decmpeq
- decmpne
- decmplt
- decmpge
- decmpgt
- decmple
- decmpequ
- decmpneu
- decmpltu
- decmpgeu
- decmpgtu
- decmpleu
- dfRegLoad
- ddRegLoad
- deRegLoad
- dfRegStore
- ddRegStore
- deRegStore
- dfselect
- ddselect
- deselect
- dfexp
- ddexp
- deexp
- dfnint
- ddnint
- denint
- dfsqrt
- ddsqrt
- desqrt
- dfcos
- ddcos
- decos
- dfsin
- ddsin
- desin
- dftan
- ddtan
- detan
- dfcosh
- ddcosh
- decosh
- dfsinh
- ddsinh
- desinh
- dftanh
- ddtanh
- detanh
- dfacos
- ddacos
- deacos
- dfasin
- ddasin
- deasin
- dfatan
- ddatan
- deatan
- dfatan2
- ddatan2
- deatan2
- dflog
- ddlog
- delog
- dffloor
- ddfloor
- defloor
- dfceil
- ddceil
- deceil
- dfmax
- ddmax
- demax
- dfmin
- ddmin
- demin
- dfInsExp
- ddInsExp
- deInsExp
- ddclean
- declean
- zd2df
- df2zd
- zd2dd
- dd2zd
- zd2de
- de2zd
- zd2dfAbs
- zd2ddAbs
- zd2deAbs
- df2zdSetSign
- dd2zdSetSign
- de2zdSetSign
- df2zdClean
- dd2zdClean
- de2zdClean
- pd2df
- pd2dfAbs
- df2pd
- df2pdSetSign
- df2pdClean
- pd2dd
- pd2ddAbs
- dd2pd
- dd2pdSetSign
- dd2pdClean
- pd2de
- pd2deAbs
- de2pd
- de2pdSetSign
- de2pdClean

The following is a list of data types we removed:

- DecimalFloat
- DecimalDouble
- DecimalLongDouble
  • Loading branch information
fjeremic committed Apr 26, 2021
1 parent ad3a5b2 commit 9f31bc7
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 780 deletions.
31 changes: 0 additions & 31 deletions compiler/codegen/CodeGenRA.cpp
Expand Up @@ -197,31 +197,15 @@ OMR::CodeGenerator::estimateRegisterPressure(TR::Node *node, int32_t &registerPr
TR::DataType dtype = node->getDataType();
if (dtype == TR::Float
|| dtype == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dtype == TR::DecimalFloat
|| dtype == TR::DecimalDouble
|| dtype == TR::DecimalLongDouble
#endif
)
gprCandidate = false;
if (node->getDataType() == TR::Float
|| node->getDataType() == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| node->getDataType() == TR::DecimalFloat
|| node->getDataType() == TR::DecimalDouble
#endif
)
{
if (!gprCandidate)
registerPressure++;
}
#ifdef J9_PROJECT_SPECIFIC
else if (node->getDataType() == TR::DecimalLongDouble)
{
if (!gprCandidate)
registerPressure +=2;
}
#endif
else
{
if (gprCandidate)
Expand Down Expand Up @@ -1200,11 +1184,6 @@ OMR::CodeGenerator::pickRegister(TR_RegisterCandidate *rc,

const bool usesFPR = (dtype == TR::Float
|| dtype == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dtype == TR::DecimalFloat
|| dtype == TR::DecimalDouble
|| dtype == TR::DecimalLongDouble
#endif
);

const bool usesVRF = dtype.isVector();
Expand Down Expand Up @@ -1738,11 +1717,6 @@ OMR::CodeGenerator::pickRegister(TR_RegisterCandidate *rc,
uint8_t regsWithheld =
(dtype == TR::Float
|| dtype == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dtype == TR::DecimalFloat
|| dtype == TR::DecimalDouble
|| dtype == TR::DecimalLongDouble
#endif
) ?
fprsWithheldFromPickRegister : (self()->comp()->getMethodHotness() == warm)? gprsWithheldFromPickRegisterWhenWarm :
gprsWithheldFromPickRegister;
Expand Down Expand Up @@ -1806,11 +1780,6 @@ OMR::CodeGenerator::pickRegister(TR_RegisterCandidate *rc,
dtype = rcSymbol->getDataType();
if (dtype == TR::Float
|| dtype == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dtype == TR::DecimalFloat
|| dtype == TR::DecimalDouble
|| dtype == TR::DecimalLongDouble
#endif
)
preservedRegisters = self()->getGlobalFPRsPreservedAcrossCalls();
else
Expand Down
1 change: 0 additions & 1 deletion compiler/il/OMRNode.hpp
Expand Up @@ -2164,7 +2164,6 @@ class OMR_EXTENSIBLE Node
unneededConv = 0x00000400, ///< Flag used by TR::x2y
ParentSupportsLazyClobber = 0x00002000, ///< Tactical x86 codegen flag. Only when refcount <= 1. Indicates that parent will consult the register's node count before clobbering it (not just the node's refcount).

// Flag used by float to fixed conversion nodes e.g. f2i/f2pd/d2i/df2i/f2l/d2l/f2s/d2pd etc
callForFloatToFixedConversion = 0x00400000,

// Flags used by TR::fence
Expand Down
28 changes: 0 additions & 28 deletions compiler/optimizer/GlobalRegisterAllocator.cpp
Expand Up @@ -1050,11 +1050,6 @@ TR_GlobalRegisterAllocator::transformNode(
(!value->getOpCode().isLoadReg() && !value->getOpCode().isLoadVar()) &&
(symbol->getDataType() == TR::Float
|| symbol->getDataType() == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| symbol->getDataType() == TR::DecimalFloat
|| symbol->getDataType() == TR::DecimalDouble
|| symbol->getDataType() == TR::DecimalLongDouble
#endif
) &&
(!parent->getOpCode().isStore() &&
(parent->getOpCodeValue() != TR::fRegStore) &&
Expand Down Expand Up @@ -1289,11 +1284,6 @@ TR_GlobalRegisterAllocator::transformNode(
bool fpStore = false;
if (symRef->getSymbol()->getDataType() == TR::Float
|| symRef->getSymbol()->getDataType() == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| symRef->getSymbol()->getDataType() == TR::DecimalFloat
|| symRef->getSymbol()->getDataType() == TR::DecimalDouble
|| symRef->getSymbol()->getDataType() == TR::DecimalLongDouble
#endif
)
fpStore = true;

Expand Down Expand Up @@ -3477,11 +3467,6 @@ void TR_GlobalRegisterAllocator::offerAllFPAutosAndParmsAsCandidates(TR::Block *

if ((sym->getDataType() == TR::Float
|| sym->getDataType() == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| sym->getDataType() == TR::DecimalFloat
|| sym->getDataType() == TR::DecimalDouble
|| sym->getDataType() == TR::DecimalLongDouble
#endif
) &&
isTypeAvailable(symRef) &&
((sym->isAuto() && methodSymbol->getAutomaticList().find(sym->castToAutoSymbol())) ||
Expand Down Expand Up @@ -4502,17 +4487,9 @@ TR_LiveRangeSplitter::splitLiveRanges(TR_StructureSubGraphNode *structureNode)
TR::DataType dt = symRef->getSymbol()->getDataType();
bool isFloat = (dt == TR::Float
|| dt == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dt == TR::DecimalFloat
|| dt == TR::DecimalDouble
|| dt == TR::DecimalLongDouble
#endif
);
int32_t numRegsForCandidate = 1;
if ((symRef->getSymbol()->getType().isInt64() && comp()->target().is32Bit())
#ifdef J9_PROJECT_SPECIFIC
|| symRef->getSymbol()->getType().isLongDouble()
#endif
)
numRegsForCandidate = 2;

Expand Down Expand Up @@ -4612,11 +4589,6 @@ TR_LiveRangeSplitter::replaceAutosUsedIn(
TR::DataType dt = symRef->getSymbol()->getDataType();
bool isFloat = (dt == TR::Float
|| dt == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dt == TR::DecimalFloat
|| dt == TR::DecimalDouble
|| dt == TR::DecimalLongDouble
#endif
);
int32_t numRegsForCandidate = 1;
if (node->requiresRegisterPair(comp()))
Expand Down
4 changes: 0 additions & 4 deletions compiler/optimizer/OMROptimizer.cpp
Expand Up @@ -2505,10 +2505,6 @@ bool OMR::Optimizer::areNodesEquivalent(TR::Node *node1, TR::Node *node2, TR::C
return false;
}
#ifdef J9_PROJECT_SPECIFIC
else if (node1->getType().isDFP() && node1->getOpCode().isModifyPrecision() && node1->getDFPPrecision() != node2->getDFPPrecision())
{
return false;
}
else if (node1->getType().isBCD())
{
if (node1->isDecimalSizeAndShapeEquivalent(node2))
Expand Down
26 changes: 0 additions & 26 deletions compiler/optimizer/RegisterCandidate.cpp
Expand Up @@ -198,11 +198,6 @@ TR_RegisterCandidate::getRegisterKinds()
TR::DataType dt = getDataType();
if(dt == TR::Float
|| dt == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dt == TR::DecimalFloat
|| dt == TR::DecimalDouble
|| dt == TR::DecimalLongDouble
#endif
)
return TR_FPR;
else if (dt.isVector())
Expand Down Expand Up @@ -702,9 +697,6 @@ bool TR_RegisterCandidate::rcNeeds2Regs(TR::Compilation *comp)
}
else
return ((getType().isInt64() && comp->target().is32Bit() && !comp->cg()->use64BitRegsOn32Bit())
#ifdef J9_PROJECT_SPECIFIC
|| getType().isLongDouble()
#endif
);
}

Expand Down Expand Up @@ -1839,11 +1831,6 @@ TR_RegisterCandidates::reprioritizeCandidates(
bool isFPCandidate = false;
if (rc->getDataType() == TR::Float
|| rc->getDataType() == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| rc->getDataType() == TR::DecimalFloat
|| rc->getDataType() == TR::DecimalDouble
|| rc->getDataType() == TR::DecimalLongDouble
#endif
)
isFPCandidate = true;

Expand Down Expand Up @@ -2320,11 +2307,6 @@ TR_RegisterCandidates::assign(TR::Block ** cfgBlocks, int32_t numberOfBlocks, in
rc->getWeight());
bool isFloat = (rc->getDataType() == TR::Float
|| rc->getDataType() == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| rc->getDataType() == TR::DecimalFloat
|| rc->getDataType() == TR::DecimalDouble
|| rc->getDataType() == TR::DecimalLongDouble
#endif
);
bool isVector = rc->getDataType().isVector();
bool needs2Regs = false;
Expand Down Expand Up @@ -2599,21 +2581,13 @@ TR_RegisterCandidates::assign(TR::Block ** cfgBlocks, int32_t numberOfBlocks, in

bool isFloat = (dt == TR::Float
|| dt == TR::Double
#ifdef J9_PROJECT_SPECIFIC
|| dt == TR::DecimalFloat
|| dt == TR::DecimalDouble
|| dt == TR::DecimalLongDouble
#endif
);
bool isVector = dt.isVector();
int32_t firstRegister, lastRegister;

if (isFloat)
{
if (cg->getDisableFloatingPointGRA()
#ifdef J9_PROJECT_SPECIFIC
|| (dt == TR::DecimalLongDouble)
#endif
)
{
continue;
Expand Down
20 changes: 0 additions & 20 deletions compiler/optimizer/ValueNumberInfo.cpp
Expand Up @@ -304,10 +304,6 @@ bool TR_ValueNumberInfo::congruentNodes(TR::Node * node, TR::Node * entryNode)
node->getOpCode().getName(),node,node->castedToBCD(),entryNode->getOpCode().getName(),entryNode,entryNode->castedToBCD());
return false;
}
else if (node->getType().isDFP() && node->getOpCode().isModifyPrecision() && node->getDFPPrecision() != entryNode->getDFPPrecision())
{
return false;
}
#endif

// Check for loads of constants. They're much like isLoadConst.
Expand Down Expand Up @@ -373,10 +369,6 @@ bool TR_ValueNumberInfo::congruentNodes(TR::Node * node, TR::Node * entryNode)
case TR::Float: isSame = (node->getFloatBits() == entryNode->getFloatBits()); break;
case TR::Int64:
case TR::Double: isSame = (node->getLongInt() == entryNode->getLongInt()); break;
#ifdef J9_PROJECT_SPECIFIC
case TR::DecimalFloat: isSame = (node->getInt() == entryNode->getInt()); break;
case TR::DecimalDouble: isSame = (node->getLongInt() == entryNode->getLongInt()); break;
#endif
case TR::Address:isSame = (node->getAddress() == entryNode->getAddress()); break;
default:
{
Expand Down Expand Up @@ -496,14 +488,6 @@ void TR_ValueNumberInfo::initializeNode(TR::Node *node, int32_t &negativeValueNu
node->getOpCode().getName(),node,node->castedToBCD(),entryNode->getOpCode().getName(),entryNode,entryNode->castedToBCD());
continue;
}
else if (node->getType().isDFP() && node->getOpCode().isModifyPrecision() && node->getDFPPrecision() != entryNode->getDFPPrecision())
{
if (trace())
traceMsg(comp(), "DFP node %s (%p) and entryNode %s (%p) have different precisions -- do not consider as matching\n",
node->getOpCode().getName(), node,
entryNode->getOpCode().getName(), entryNode);
continue;
}
#endif

// Check for loads of constants. They're much like isLoadConst.
Expand Down Expand Up @@ -566,10 +550,6 @@ void TR_ValueNumberInfo::initializeNode(TR::Node *node, int32_t &negativeValueNu
case TR::Float: isSame = (node->getFloatBits() == entryNode->getFloatBits()); break;
case TR::Int64:
case TR::Double: isSame = (node->getLongInt() == entryNode->getLongInt()); break;
#ifdef J9_PROJECT_SPECIFIC
case TR::DecimalFloat: isSame = (node->getInt() == entryNode->getInt()); break;
case TR::DecimalDouble: isSame = (node->getLongInt() == entryNode->getLongInt()); break;
#endif
case TR::Address:isSame = (node->getAddress() == entryNode->getAddress()); break;
default:
{
Expand Down

0 comments on commit 9f31bc7

Please sign in to comment.