mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixes to global indexing
This commit is contained in:
parent
24f931df51
commit
adbae6f1d4
3 changed files with 7 additions and 7 deletions
|
@ -3838,9 +3838,9 @@ bool BeMCContext::HasSymbolAddr(const BeMCOperand& operand)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BeMCOperand BeMCContext::ReplaceWithNewVReg(BeMCOperand& operand, int& instIdx, bool isInput, bool mustBeReg)
|
BeMCOperand BeMCContext::ReplaceWithNewVReg(BeMCOperand& operand, int& instIdx, bool isInput, bool mustBeReg, bool preserveDeref)
|
||||||
{
|
{
|
||||||
if ((isInput) && (operand.mKind == BeMCOperandKind_VRegLoad))
|
if ((isInput) && (operand.mKind == BeMCOperandKind_VRegLoad) && (preserveDeref))
|
||||||
{
|
{
|
||||||
BeMCOperand addrOperand = BeMCOperand::ToAddr(operand);
|
BeMCOperand addrOperand = BeMCOperand::ToAddr(operand);
|
||||||
BeMCOperand scratchReg = AllocVirtualReg(GetType(addrOperand), 2, mustBeReg);
|
BeMCOperand scratchReg = AllocVirtualReg(GetType(addrOperand), 2, mustBeReg);
|
||||||
|
@ -8356,7 +8356,7 @@ bool BeMCContext::DoLegalization()
|
||||||
{
|
{
|
||||||
if ((HasSymbolAddr(inst->mArg0)) && (inst->mKind != BeMCInstKind_Call))
|
if ((HasSymbolAddr(inst->mArg0)) && (inst->mKind != BeMCInstKind_Call))
|
||||||
{
|
{
|
||||||
ReplaceWithNewVReg(inst->mArg0, instIdx, true, false);
|
ReplaceWithNewVReg(inst->mArg0, instIdx, true, false, true);
|
||||||
isFinalRun = false;
|
isFinalRun = false;
|
||||||
// if (debugging)
|
// if (debugging)
|
||||||
// OutputDebugStrF(" SymbolAddr0\n");
|
// OutputDebugStrF(" SymbolAddr0\n");
|
||||||
|
@ -14769,7 +14769,7 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||||
|
|
||||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||||
//mDebugging = function->mName == "?Hey@Blurg@bf@@SAXXZ";
|
//mDebugging = function->mName == "?DrawBox@Graphics@gfx@Beefy@bf@@QEAAXPEAVImage@234@MMMM@Z";
|
||||||
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
//"?ColorizeCodeString@IDEUtils@IDE@bf@@SAXPEAVString@System@3@W4CodeKind@123@@Z";
|
||||||
//"?Main@Program@bf@@CAHPEAV?$Array1@PEAVString@System@bf@@@System@2@@Z";
|
//"?Main@Program@bf@@CAHPEAV?$Array1@PEAVString@System@bf@@@System@2@@Z";
|
||||||
|
|
||||||
|
|
|
@ -1317,7 +1317,7 @@ public:
|
||||||
BeMCOperand AllocRelativeVirtualReg(BeType* type, const BeMCOperand& relTo, const BeMCOperand& relOffset, int relScale);
|
BeMCOperand AllocRelativeVirtualReg(BeType* type, const BeMCOperand& relTo, const BeMCOperand& relOffset, int relScale);
|
||||||
BeMCVRegInfo* GetVRegInfo(const BeMCOperand& operand);
|
BeMCVRegInfo* GetVRegInfo(const BeMCOperand& operand);
|
||||||
bool HasSymbolAddr(const BeMCOperand& operand);
|
bool HasSymbolAddr(const BeMCOperand& operand);
|
||||||
BeMCOperand ReplaceWithNewVReg(BeMCOperand& operand, int& instIdx, bool isInput, bool mustBeReg = true);
|
BeMCOperand ReplaceWithNewVReg(BeMCOperand& operand, int& instIdx, bool isInput, bool mustBeReg = true, bool preserveDeref = false);
|
||||||
BeMCOperand RemapOperand(BeMCOperand& operand, BeMCRemapper& regRemaps);
|
BeMCOperand RemapOperand(BeMCOperand& operand, BeMCRemapper& regRemaps);
|
||||||
bool IsLive(BeVTrackingList* liveRegs, int vregIdx, BeMCRemapper& regRemaps);
|
bool IsLive(BeVTrackingList* liveRegs, int vregIdx, BeMCRemapper& regRemaps);
|
||||||
void AddRegRemap(int from, int to, BeMCRemapper& regRemaps, bool allowRemapToDbgVar = false);
|
void AddRegRemap(int from, int to, BeMCRemapper& regRemaps, bool allowRemapToDbgVar = false);
|
||||||
|
|
|
@ -35,8 +35,8 @@ namespace Tests
|
||||||
Test.Assert(iArr[3] == 0);
|
Test.Assert(iArr[3] == 0);
|
||||||
|
|
||||||
iArr[0] += 1000;
|
iArr[0] += 1000;
|
||||||
iArr[2] += 2000;
|
iArr[1] += 2000;
|
||||||
iArr[3] += 3000;
|
iArr[2] += 3000;
|
||||||
iArr[3] += 4000;
|
iArr[3] += 4000;
|
||||||
|
|
||||||
Test.Assert(iArr[0] == 1123);
|
Test.Assert(iArr[0] == 1123);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue