mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
typdef Register
This commit is contained in:
parent
45cc85829a
commit
61e79d4f3b
@ -85,7 +85,7 @@ class Architecture {
|
||||
virtual bool argumentAlignment() = 0;
|
||||
virtual bool argumentRegisterAlignment() = 0;
|
||||
virtual unsigned argumentRegisterCount() = 0;
|
||||
virtual int argumentRegister(unsigned index) = 0;
|
||||
virtual Register argumentRegister(unsigned index) = 0;
|
||||
|
||||
virtual bool hasLinkRegister() = 0;
|
||||
|
||||
|
@ -53,10 +53,10 @@ class Assembler {
|
||||
public:
|
||||
class Client {
|
||||
public:
|
||||
virtual int acquireTemporary(RegisterMask mask = ~static_cast<RegisterMask>(0)) = 0;
|
||||
virtual void releaseTemporary(int r) = 0;
|
||||
virtual Register acquireTemporary(RegisterMask mask = ~static_cast<RegisterMask>(0)) = 0;
|
||||
virtual void releaseTemporary(Register r) = 0;
|
||||
|
||||
virtual void save(int r) = 0;
|
||||
virtual void save(Register r) = 0;
|
||||
};
|
||||
|
||||
class Block {
|
||||
|
@ -17,6 +17,7 @@ namespace avian {
|
||||
namespace codegen {
|
||||
|
||||
typedef uint64_t RegisterMask;
|
||||
typedef int Register;
|
||||
|
||||
class BoundedRegisterMask {
|
||||
public:
|
||||
@ -62,7 +63,7 @@ class RegisterIterator {
|
||||
return index < mask.limit;
|
||||
}
|
||||
|
||||
inline int next()
|
||||
inline Register next()
|
||||
{
|
||||
int r = index;
|
||||
do {
|
||||
|
@ -2210,22 +2210,22 @@ class Client : public Assembler::Client {
|
||||
{
|
||||
}
|
||||
|
||||
virtual int acquireTemporary(RegisterMask mask)
|
||||
virtual Register acquireTemporary(RegisterMask mask)
|
||||
{
|
||||
unsigned cost;
|
||||
int r = pickRegisterTarget(c, 0, mask, &cost);
|
||||
Register r = pickRegisterTarget(c, 0, mask, &cost);
|
||||
expect(c, cost < Target::Impossible);
|
||||
save(r);
|
||||
c->registerResources[r].increment(c);
|
||||
return r;
|
||||
}
|
||||
|
||||
virtual void releaseTemporary(int r)
|
||||
virtual void releaseTemporary(Register r)
|
||||
{
|
||||
c->registerResources[r].decrement(c);
|
||||
}
|
||||
|
||||
virtual void save(int r)
|
||||
virtual void save(Register r)
|
||||
{
|
||||
RegisterResource* reg = c->registerResources + r;
|
||||
|
||||
|
@ -396,7 +396,7 @@ class CallEvent : public Event {
|
||||
SiteMask targetMask;
|
||||
if (index + (c->arch->argumentRegisterAlignment() ? footprint : 1)
|
||||
<= c->arch->argumentRegisterCount()) {
|
||||
int number = c->arch->argumentRegister(index);
|
||||
Register number = c->arch->argumentRegister(index);
|
||||
|
||||
if (DebugReads) {
|
||||
fprintf(stderr, "reg %d arg read %p\n", number, v);
|
||||
|
@ -57,10 +57,10 @@ unsigned resourceCost(Context* c,
|
||||
}
|
||||
|
||||
bool pickRegisterTarget(Context* c,
|
||||
int i,
|
||||
Register i,
|
||||
Value* v,
|
||||
RegisterMask mask,
|
||||
int* target,
|
||||
Register* target,
|
||||
unsigned* cost,
|
||||
CostCalculator* costCalculator)
|
||||
{
|
||||
@ -85,17 +85,17 @@ bool pickRegisterTarget(Context* c,
|
||||
return false;
|
||||
}
|
||||
|
||||
int pickRegisterTarget(Context* c,
|
||||
Register pickRegisterTarget(Context* c,
|
||||
Value* v,
|
||||
RegisterMask mask,
|
||||
unsigned* cost,
|
||||
CostCalculator* costCalculator)
|
||||
{
|
||||
int target = lir::NoRegister;
|
||||
Register target = lir::NoRegister;
|
||||
*cost = Target::Impossible;
|
||||
|
||||
if (mask & c->regFile->generalRegisters.mask) {
|
||||
for (int i = c->regFile->generalRegisters.limit - 1;
|
||||
for (Register i = c->regFile->generalRegisters.limit - 1;
|
||||
i >= c->regFile->generalRegisters.start;
|
||||
--i) {
|
||||
if (pickRegisterTarget(c, i, v, mask, &target, cost, costCalculator)) {
|
||||
@ -105,8 +105,8 @@ int pickRegisterTarget(Context* c,
|
||||
}
|
||||
|
||||
if (mask & c->regFile->floatRegisters.mask) {
|
||||
for (int i = c->regFile->floatRegisters.start;
|
||||
i < static_cast<int>(c->regFile->floatRegisters.limit);
|
||||
for (Register i = c->regFile->floatRegisters.start;
|
||||
i < static_cast<Register>(c->regFile->floatRegisters.limit);
|
||||
++i) {
|
||||
if (pickRegisterTarget(c, i, v, mask, &target, cost, costCalculator)) {
|
||||
return i;
|
||||
@ -123,7 +123,7 @@ Target pickRegisterTarget(Context* c,
|
||||
CostCalculator* costCalculator)
|
||||
{
|
||||
unsigned cost;
|
||||
int number = pickRegisterTarget(c, v, mask, &cost, costCalculator);
|
||||
Register number = pickRegisterTarget(c, v, mask, &cost, costCalculator);
|
||||
return Target(number, lir::RegisterOperand, cost);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ class Target {
|
||||
{
|
||||
}
|
||||
|
||||
Target(int index, lir::OperandType type, unsigned cost)
|
||||
Target(Register index, lir::OperandType type, unsigned cost)
|
||||
: index(index), type(type), cost(cost)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user