Files
FEX-Emu--FEX/FEXCore/Source/Interface/IR/RegisterAllocationData.h
T
Lioncache 19e8c3fcb6 RegisterAllocationData: Remove unused headers
Gets rid of unnecessary header dependencies.
2025-09-03 10:31:41 -04:00

45 lines
854 B
C++

// SPDX-License-Identifier: MIT
#pragma once
#include "IR.h"
#include <cstdint>
namespace FEXCore::IR {
union PhysicalRegister {
uint8_t Raw;
struct {
// 32 maximum physical registers
uint8_t Reg : 5;
// 8 Maximum classes
uint8_t Class : 3;
};
bool operator==(const PhysicalRegister& Other) const {
return Raw == Other.Raw;
}
PhysicalRegister(RegisterClassType Class, uint8_t Reg)
: Reg(Reg)
, Class(Class.Val) {}
PhysicalRegister(OrderedNodeWrapper Arg)
: Raw(Arg.GetImmediate()) {}
PhysicalRegister(Ref Node)
: Raw(Node->Reg) {}
static const PhysicalRegister Invalid() {
return PhysicalRegister(InvalidClass, 0);
}
bool IsInvalid() const {
static_assert(InvalidClass == 0);
return Raw == 0;
}
};
static_assert(sizeof(PhysicalRegister) == 1);
} // namespace FEXCore::IR