mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Fixed backend indirect float const storage issue
This commit is contained in:
parent
58eec21fbf
commit
2054ea0fd8
1 changed files with 19 additions and 5 deletions
|
@ -10650,11 +10650,25 @@ bool BeMCContext::DoLegalization()
|
||||||
CheckForce(vregInfo);
|
CheckForce(vregInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
BeMCOperand castedVReg = AllocVirtualReg(mModule->mContext->GetPrimitiveType(BeTypeCode_Int64), 2, false);
|
BeMCOperand castedVReg;
|
||||||
CreateDefineVReg(castedVReg, instIdx++);
|
if (inst->mArg0.mKind == BeMCOperandKind_VRegLoad)
|
||||||
auto castedVRegInfo = GetVRegInfo(castedVReg);
|
{
|
||||||
castedVRegInfo->mIsExpr = true;
|
// Maintain the load-ness (don't wrap a load)
|
||||||
castedVRegInfo->mRelTo = inst->mArg0;
|
castedVReg = AllocVirtualReg(mModule->mContext->GetPointerTo(mModule->mContext->GetPrimitiveType(BeTypeCode_Int64)), 2, false);
|
||||||
|
CreateDefineVReg(castedVReg, instIdx++);
|
||||||
|
auto castedVRegInfo = GetVRegInfo(castedVReg);
|
||||||
|
castedVRegInfo->mIsExpr = true;
|
||||||
|
castedVRegInfo->mRelTo = BeMCOperand::FromVReg(inst->mArg0.mVRegIdx);
|
||||||
|
castedVReg.mKind = BeMCOperandKind_VRegLoad;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
castedVReg = AllocVirtualReg(mModule->mContext->GetPrimitiveType(BeTypeCode_Int64), 2, false);
|
||||||
|
CreateDefineVReg(castedVReg, instIdx++);
|
||||||
|
auto castedVRegInfo = GetVRegInfo(castedVReg);
|
||||||
|
castedVRegInfo->mIsExpr = true;
|
||||||
|
castedVRegInfo->mRelTo = inst->mArg0;
|
||||||
|
}
|
||||||
|
|
||||||
BeMCOperand scratchReg = AllocVirtualReg(mModule->mContext->GetPrimitiveType(BeTypeCode_Int64), 2, true);
|
BeMCOperand scratchReg = AllocVirtualReg(mModule->mContext->GetPrimitiveType(BeTypeCode_Int64), 2, true);
|
||||||
CreateDefineVReg(scratchReg, instIdx++);
|
CreateDefineVReg(scratchReg, instIdx++);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue