public x86RegisterList Union(x86RegisterList Other) { if (!Initialized) { return(Other); } if (!Other.Initialized) { return(this); } var MaxSize = Math.Max(Size, Other.Size); var Ret = new x86RegisterList(MaxSize); for (var i = 0; i < MaxSize; i++) { if (i < Size && this[i]) { Ret[i] = true; } else if (i < Other.Size && Other[i]) { Ret[i] = true; } } return(Ret); }
public void SetUsed(x86RegisterList List, x86RegisterMask Mask) { for (var i = 0; i < List.Size; i++) { if (List[i]) { SetUsed(i, Mask); } } }
public x86DataList(x86Architecture Arch, bool Alloc = true) { this.Arch = Arch; if (Alloc) { GRegisters = new x86GRegisterList(Arch.RegCount); SSERegisters = new x86RegisterList(Arch.RegCount); } }
public void SetUnused(x86RegisterList List) { for (var i = 0; i < List.Size; i++) { if (List[i]) { UsedRegs[i] = false; } } }
public void SetUsed(x86RegisterList Lst) { for (var i = 0; i < Lst.Size; i++) { if (Lst[i]) { UsedRegs[i] = true; } } }
public x86SSERegLocation AllocSSERegister(int Size, x86RegisterList CantBe = new x86RegisterList()) { var Ret = AllocSSERegHelper(Size, CantBe); if (Ret != null) { return(Ret); } return(AllocSSERegHelper(Size, CantBe, true)); }
public void Set(x86RegisterList List) { if (List.Size != Size) { throw new ApplicationException(); } for (var i = 0; i < Size; i++) { UsedRegs[i] = List[i]; } }
public x86RegisterList Inverse() { var Ret = new x86RegisterList(Size); for (var i = 0; i < Size; i++) { if (!UsedRegs[i]) { Ret[i] = true; } } return(Ret); }
public x86RegisterList Copy() { if (Initialized) { var Ret = new x86RegisterList(Size); for (var i = 0; i < Size; i++) { Ret[i] = this[i]; } return(Ret); } return(new x86RegisterList()); }
public x86SSERegLocation AllocSSERegHelper(int Size, x86RegisterList CantBe = new x86RegisterList(), bool EnableParamLocs = false) { var Sequence = x86CallConv.AllocationSequence.SSERegisters; for (var i = 0; i < Sequence.Length; i++) { var Reg = Sequence[i]; if (IsSSERegisterFree(Reg) && (!CantBe.Initialized || !CantBe[Reg])) { SSERegisters[Reg] = true; return(new x86SSERegLocation(Arch, Reg, Size)); } } return(null); }
public x86RegisterList Intersect(x86RegisterList Other) { if (!Initialized) { return(Other); } if (!Other.Initialized) { return(this); } var MinSize = Math.Min(Size, Other.Size); var Ret = new x86RegisterList(MinSize); for (var i = 0; i < MinSize; i++) { if (this[i] && Other[i]) { Ret[i] = true; } } return(Ret); }