diff --git a/src/assembler.h b/src/assembler.h index f84dd37b34..e97ee597db 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -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; diff --git a/src/x86.cpp b/src/x86.cpp index 8f57f259b6..508d4ebd7b 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -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) {