Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9886,7 +9886,18 @@ void LinearScan::resolveEdge(BasicBlock* fromBlock,
regNumber tempRegFlt = REG_NA;
if ((compiler->compFloatingPointUsed) && (resolveType != ResolveSharedCritical))
{

#ifdef _TARGET_ARM_
// Let's try to reserve a double register for TYP_FLOAT and TYP_DOUBLE
tempRegFlt = getTempRegForResolution(fromBlock, toBlock, TYP_DOUBLE);
if (tempRegFlt == REG_NA)
{
// If fails, try to reserve a float register for TYP_FLOAT
tempRegFlt = getTempRegForResolution(fromBlock, toBlock, TYP_FLOAT);
}
#else
tempRegFlt = getTempRegForResolution(fromBlock, toBlock, TYP_FLOAT);
#endif
}

regMaskTP targetRegsToDo = RBM_NONE;
Expand Down Expand Up @@ -10043,7 +10054,16 @@ void LinearScan::resolveEdge(BasicBlock* fromBlock,
bool useSwap = false;
if (emitter::isFloatReg(targetReg))
{
tempReg = tempRegFlt;
#ifdef _TARGET_ARM_
if (sourceIntervals[fromReg]->registerType == TYP_DOUBLE)
{
// ARM32 requires a double temp register for TYP_DOUBLE.
// We tried to reserve a double temp register first, but sometimes we can't.
tempReg = genIsValidDoubleReg(tempRegFlt) ? tempRegFlt : REG_NA;
}
else
#endif // _TARGET_ARM_
tempReg = tempRegFlt;
}
#ifdef _TARGET_XARCH_
else
Expand Down