Skip to content
Snippets Groups Projects
Commit 63c3799f authored by Clark Coleman's avatar Clark Coleman
Browse files

Corner case fix to support LAF; BinaryRTL() building cleanup.

parent 8acd3ee3
No related branches found
No related tags found
No related merge requests found
......@@ -4089,10 +4089,10 @@ bool SMPFunction::MDUpdateFGStackLocInfo(STARS_ea_t InstAddr, const STARSOpndTyp
this->PositiveOffsetFineGrainedStackTable[SignedOffset].SizeInfo |= NewFG.SizeInfo;
}
}
else if (this->OutgoingArgsComputed && (((std::size_t) SignedOffset) < this->OutgoingArgsSize)) {
else if (!this->DoesStackFrameExtendPastStackTop() && this->OutgoingArgsComputed && (((std::size_t) SignedOffset) < this->OutgoingArgsSize)) {
// We don't want to update the outgoing args region, as it will not be consistent
// over multiple function calls. NOTE: We could fine tune this by seeing if we
// call mutliple target functions or not; if only one, then outgoing args region
// call multiple target functions or not; if only one, then outgoing args region
// would be consistent in the absence of varargs targets.
return false;
}
......
......@@ -18714,10 +18714,9 @@ bool SMPInstr::BuildBinaryRTL(SMPoperator BinaryOp, bool HiddenFPStackOp) {
bool StackPointerModification = false; // SP := SP SMP_BITWISE_AND operand
bool NeedsGuard = ((STARS_NN_arpl == opcode) || (STARS_NN_bound == opcode));
bool BuildOnlySignalRT = (STARS_NN_bound == opcode);
SMPRegTransfer *TempRT = NULL;
SMPRegTransfer *RightRT = new SMPRegTransfer;
SMPGuard *Guard1 = NULL;
RightRT->SetParentInst(this);
SMPRegTransfer *TempRT = nullptr;
SMPRegTransfer *RightRT = nullptr;
SMPGuard *Guard1 = nullptr;
 
STARSOpndTypePtr VoidOp = this->STARSInstPtr->MakeVoidOpnd();
 
......@@ -18737,6 +18736,8 @@ bool SMPInstr::BuildBinaryRTL(SMPoperator BinaryOp, bool HiddenFPStackOp) {
TempRT->SetParentInst(this);
TempRT->SetLeftOperand(FPRegOp);
TempRT->SetOperator(SMP_ASSIGN);
RightRT = new SMPRegTransfer;
RightRT->SetParentInst(this);
RightRT->SetLeftOperand(FPRegOp);
RightRT->SetOperator(BinaryOp);
RightRT->SetRightOperand(VoidOp);
......@@ -18767,6 +18768,8 @@ bool SMPInstr::BuildBinaryRTL(SMPoperator BinaryOp, bool HiddenFPStackOp) {
}
else {
if (!BuildOnlySignalRT) {
RightRT = new SMPRegTransfer;
RightRT->SetParentInst(this);
RightRT->SetLeftOperand(TempOp);
RightRT->SetOperator(BinaryOp);
TempRT->SetRightTree(RightRT);
......@@ -18808,9 +18811,15 @@ bool SMPInstr::BuildBinaryRTL(SMPoperator BinaryOp, bool HiddenFPStackOp) {
if (!MemSrc || MemDest || (IsMemOperand(TempOp))) {
SourceFound = true;
if (!BuildOnlySignalRT) {
RightRT->SetRightOperand(TempOp);
if (StackPointerModification && (TempOp->IsImmedOp())) {
this->SetStackAlignmentInst();
if (nullptr != RightRT) {
RightRT->SetRightOperand(TempOp);
if (StackPointerModification && (TempOp->IsImmedOp())) {
this->SetStackAlignmentInst();
}
}
else {
SourceFound = false; // take error exit
break;
}
}
}
......@@ -18835,10 +18844,9 @@ bool SMPInstr::BuildBinaryRTL(SMPoperator BinaryOp, bool HiddenFPStackOp) {
} // end for (OpNum = 0; ...)
 
if (!DestFound || !SourceFound) {
assert(NULL != RightRT);
if (DestFound && (NULL != TempRT))
if (DestFound && (nullptr != TempRT))
delete TempRT;
else
else if (nullptr != RightRT)
delete RightRT;
#if SMP_DEBUG_BUILD_RTL
if (!DestFound) {
......@@ -18857,7 +18865,8 @@ bool SMPInstr::BuildBinaryRTL(SMPoperator BinaryOp, bool HiddenFPStackOp) {
TempRT->SetLeftOperand(VoidOp);
TempRT->SetRightOperand(VoidOp);
TempRT->SetOperator(SMP_SIGNAL);
delete RightRT;
if (nullptr != RightRT)
delete RightRT;
}
this->RTL.push_back(TempRT);
// The "p" at the end of the opcode indicates that the floating point
......@@ -23447,7 +23456,7 @@ bool SMPInstr::BuildX86RTL(void)
 
case STARS_NN_fist: // Store Integer
case STARS_NN_fistp: // Store Integer and Pop
return this->BuildBinaryRTL(SMP_CONVERT_FP_TO_INT);
return this->BuildUnaryRTL(SMP_CONVERT_FP_TO_INT);
 
case STARS_NN_fbld: // Load BCD
case STARS_NN_fbstp: // Store BCD and Pop
......@@ -24381,7 +24390,7 @@ bool SMPInstr::BuildX86RTL(void)
break;
 
case STARS_NN_fisttp: // Store ST in intXX (chop) and pop
return this->BuildBinaryRTL(SMP_CONVERT_FP_TO_INT);
return this->BuildUnaryRTL(SMP_CONVERT_FP_TO_INT);
break;
 
case STARS_NN_lddqu: // Load unaligned integer 128-bit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment