implement xorRR, remove unused Assembler::stackSyncRegister

This commit is contained in:
Joel Dice 2008-04-20 16:19:11 -06:00
parent 9976c1132c
commit a259beccdc
2 changed files with 13 additions and 19 deletions

View File

@ -153,8 +153,6 @@ class Assembler {
virtual unsigned argumentRegisterCount() = 0;
virtual int argumentRegister(unsigned index) = 0;
virtual int stackSyncRegister(unsigned index) = 0;
virtual void getTargets(UnaryOperation op, unsigned size,
Register* a) = 0;

View File

@ -872,6 +872,17 @@ andCM(Context* c, unsigned size UNUSED, Assembler::Constant* a,
}
}
void
xorRR(Context* c, unsigned size UNUSED, Assembler::Register* a,
Assembler::Register* b)
{
assert(c, BytesPerWord == 8 or size == 4); // todo
rex(c);
c->code.append(0x31);
c->code.append(0xc0 | (a->low << 3) | b->low);
}
void
shiftLeftCR(Context* c, unsigned size UNUSED, Assembler::Constant* a,
Assembler::Register* b)
@ -1047,6 +1058,8 @@ populateTables()
BinaryOperations[INDEX2(And, Constant, Register)] = CAST2(andCR);
BinaryOperations[INDEX2(And, Constant, Memory)] = CAST2(andCM);
BinaryOperations[INDEX2(Xor, Register, Register)] = CAST2(xorRR);
BinaryOperations[INDEX2(ShiftLeft, Constant, Register)] = CAST2(shiftLeftCR);
BinaryOperations[INDEX2(Subtract, Constant, Register)] = CAST2(subtractCR);
@ -1124,23 +1137,6 @@ class MyAssembler: public Assembler {
}
}
virtual int stackSyncRegister(unsigned index) {
switch (index) {
case 0:
return rax;
case 1:
return rcx;
case 2:
return rdx;
case 3:
return rsi;
case 4:
return rdi;
default:
abort(&c);
}
}
virtual void getTargets(UnaryOperation /*op*/, unsigned /*size*/,
Register* r)
{