mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Fixed Abs codegen bug with spilled vregs
This commit is contained in:
parent
d24f169181
commit
71eca79ef1
1 changed files with 25 additions and 4 deletions
|
@ -3744,7 +3744,7 @@ BeMCOperand BeMCContext::AllocVirtualReg(BeType* type, int refCount, bool mustBe
|
||||||
|
|
||||||
if (mDebugging)
|
if (mDebugging)
|
||||||
{
|
{
|
||||||
if (mcOperand.mVRegIdx == 9)
|
if (mcOperand.mVRegIdx == 16)
|
||||||
{
|
{
|
||||||
NOP;
|
NOP;
|
||||||
}
|
}
|
||||||
|
@ -9018,6 +9018,27 @@ bool BeMCContext::DoLegalization()
|
||||||
// mov scratch, b
|
// mov scratch, b
|
||||||
// <op> a, scratch
|
// <op> a, scratch
|
||||||
auto targetType = GetType(inst->mArg0);
|
auto targetType = GetType(inst->mArg0);
|
||||||
|
|
||||||
|
if ((targetType->IsFloat()) && (arg0.IsVReg()) && (arg1.IsImmediateFloat()))
|
||||||
|
{
|
||||||
|
auto vregInfo0 = GetVRegInfo(arg0);
|
||||||
|
if (!vregInfo0->mIsExpr)
|
||||||
|
{
|
||||||
|
// Convert from "<op> %reg0, %reg1"
|
||||||
|
// To
|
||||||
|
// Mov %vreg2<reg>, %vreg0
|
||||||
|
// <op> %vreg2<reg>, %vreg1
|
||||||
|
// Mov %vreg0, %vreg2<reg>
|
||||||
|
auto prevDest = inst->mArg0;
|
||||||
|
ReplaceWithNewVReg(inst->mArg0, instIdx, true);
|
||||||
|
AllocInst(BeMCInstKind_Mov, prevDest, inst->mArg0, instIdx + 1);
|
||||||
|
IntroduceVRegs(inst->mArg0, mcBlock, instIdx, instIdx + 2);
|
||||||
|
instIdx++;
|
||||||
|
isFinalRun = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!targetType->IsNonVectorComposite())
|
if (!targetType->IsNonVectorComposite())
|
||||||
{
|
{
|
||||||
auto scratchType = GetType(inst->mArg1);
|
auto scratchType = GetType(inst->mArg1);
|
||||||
|
@ -15708,8 +15729,8 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||||
|
|
||||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||||
//mDebugging = (function->mName == "?Main@TestProgram@BeefTest@bf@@SAXXZ");
|
//mDebugging = (function->mName == "?MouseMove@PerfView@BeefPerf@bf@@UEAAXMM@Z");
|
||||||
// || (function->mName == "?__BfStaticCtor@roboto_font@Drawing@ClassicUO_assistant@bf@@SAXXZ")
|
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
|
||||||
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
|
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
|
||||||
// ;
|
// ;
|
||||||
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue