From 02d1a83ad9df97537984238e65498c0cbb8eef71 Mon Sep 17 00:00:00 2001 From: "joshuawarner32@gmail.com" Date: Thu, 4 Dec 2014 18:45:57 -0700 Subject: [PATCH] rename lir::Register to lir::RegisterPair --- include/avian/codegen/lir.h | 4 +- src/codegen/compiler/site.cpp | 2 +- src/codegen/target/arm/assembler.cpp | 28 +-- src/codegen/target/arm/operations.cpp | 258 +++++++++++----------- src/codegen/target/arm/operations.h | 196 ++++++++--------- src/codegen/target/arm/registers.h | 6 +- src/codegen/target/x86/assembler.cpp | 36 +-- src/codegen/target/x86/encode.cpp | 36 +-- src/codegen/target/x86/encode.h | 34 +-- src/codegen/target/x86/operations.cpp | 302 +++++++++++++------------- src/codegen/target/x86/operations.h | 196 ++++++++--------- src/compile.cpp | 22 +- 12 files changed, 560 insertions(+), 560 deletions(-) diff --git a/include/avian/codegen/lir.h b/include/avian/codegen/lir.h index 91b48fb96d..b5f9efe259 100644 --- a/include/avian/codegen/lir.h +++ b/include/avian/codegen/lir.h @@ -149,9 +149,9 @@ class Address : public Operand { Promise* address; }; -class Register : public Operand { +class RegisterPair : public Operand { public: - Register(int low, int high = NoRegister) : low(low), high(high) + RegisterPair(int low, int high = NoRegister) : low(low), high(high) { } diff --git a/src/codegen/compiler/site.cpp b/src/codegen/compiler/site.cpp index 99ce5fb154..1b7880d2d0 100644 --- a/src/codegen/compiler/site.cpp +++ b/src/codegen/compiler/site.cpp @@ -349,7 +349,7 @@ void RegisterSite::asAssemblerOperand(Context* c UNUSED, highNumber = lir::NoRegister; } - new (result) lir::Register(number, highNumber); + new (result) lir::RegisterPair(number, highNumber); } Site* RegisterSite::copy(Context* c) diff --git a/src/codegen/target/arm/assembler.cpp b/src/codegen/target/arm/assembler.cpp index c383aea819..bec887eab2 100644 --- a/src/codegen/target/arm/assembler.cpp +++ b/src/codegen/target/arm/assembler.cpp @@ -656,7 +656,7 @@ class MyAssembler : public Assembler { virtual void checkStackOverflow(uintptr_t handler, unsigned stackLimitOffsetFromThread) { - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); lir::Memory stackLimit(ThreadRegister, stackLimitOffsetFromThread); lir::Constant handlerConstant(new (con.zone) ResolvedPromise(handler)); branchRM(&con, @@ -669,11 +669,11 @@ class MyAssembler : public Assembler { virtual void saveFrame(unsigned stackOffset, unsigned ipOffset) { - lir::Register link(LinkRegister); + lir::RegisterPair link(LinkRegister); lir::Memory linkDst(ThreadRegister, ipOffset); moveRM(&con, TargetBytesPerWord, &link, TargetBytesPerWord, &linkDst); - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); lir::Memory stackDst(ThreadRegister, stackOffset); moveRM(&con, TargetBytesPerWord, &stack, TargetBytesPerWord, &stackDst); } @@ -705,7 +705,7 @@ class MyAssembler : public Assembler { unsigned offset = 0; for (unsigned i = 0; i < argumentCount; ++i) { if (i < arch_->argumentRegisterCount()) { - lir::Register dst(arch_->argumentRegister(i)); + lir::RegisterPair dst(arch_->argumentRegister(i)); apply(lir::Move, OperandInfo(RUNTIME_ARRAY_BODY(arguments)[i].size, @@ -745,12 +745,12 @@ class MyAssembler : public Assembler { // how to handle them: assertT(&con, footprint < 256); - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); ResolvedPromise footprintPromise(footprint * TargetBytesPerWord); lir::Constant footprintConstant(&footprintPromise); subC(&con, TargetBytesPerWord, &footprintConstant, &stack, &stack); - lir::Register returnAddress(LinkRegister); + lir::RegisterPair returnAddress(LinkRegister); lir::Memory returnAddressDst(StackRegister, (footprint - 1) * TargetBytesPerWord); moveRM(&con, @@ -762,7 +762,7 @@ class MyAssembler : public Assembler { virtual void adjustFrame(unsigned difference) { - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); ResolvedPromise differencePromise(difference * TargetBytesPerWord); lir::Constant differenceConstant(&differencePromise); subC(&con, TargetBytesPerWord, &differenceConstant, &stack, &stack); @@ -772,7 +772,7 @@ class MyAssembler : public Assembler { { footprint += FrameHeaderSize; - lir::Register returnAddress(LinkRegister); + lir::RegisterPair returnAddress(LinkRegister); lir::Memory returnAddressSrc(StackRegister, (footprint - 1) * TargetBytesPerWord); moveMR(&con, @@ -781,7 +781,7 @@ class MyAssembler : public Assembler { TargetBytesPerWord, &returnAddress); - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); ResolvedPromise footprintPromise(footprint * TargetBytesPerWord); lir::Constant footprintConstant(&footprintPromise); addC(&con, TargetBytesPerWord, &footprintConstant, &stack, &stack); @@ -798,7 +798,7 @@ class MyAssembler : public Assembler { if (offset) { footprint += FrameHeaderSize; - lir::Register link(LinkRegister); + lir::RegisterPair link(LinkRegister); lir::Memory returnAddressSrc(StackRegister, (footprint - 1) * TargetBytesPerWord); moveMR(&con, @@ -807,7 +807,7 @@ class MyAssembler : public Assembler { TargetBytesPerWord, &link); - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); ResolvedPromise footprintPromise((footprint - offset) * TargetBytesPerWord); lir::Constant footprintConstant(&footprintPromise); @@ -816,7 +816,7 @@ class MyAssembler : public Assembler { if (returnAddressSurrogate != lir::NoRegister) { assertT(&con, offset > 0); - lir::Register ras(returnAddressSurrogate); + lir::RegisterPair ras(returnAddressSurrogate); lir::Memory dst(StackRegister, (offset - 1) * TargetBytesPerWord); moveRM(&con, TargetBytesPerWord, &ras, TargetBytesPerWord, &dst); } @@ -840,7 +840,7 @@ class MyAssembler : public Assembler { if (TailCalls and argumentFootprint > StackAlignmentInWords) { offset = argumentFootprint - StackAlignmentInWords; - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); ResolvedPromise adjustmentPromise(offset * TargetBytesPerWord); lir::Constant adjustment(&adjustmentPromise); addC(&con, TargetBytesPerWord, &adjustment, &stack, &stack); @@ -856,7 +856,7 @@ class MyAssembler : public Assembler { { popFrame(frameFootprint); - lir::Register stack(StackRegister); + lir::RegisterPair stack(StackRegister); lir::Memory newStackSrc(ThreadRegister, stackOffsetFromThread); moveMR(&con, TargetBytesPerWord, &newStackSrc, TargetBytesPerWord, &stack); diff --git a/src/codegen/target/arm/operations.cpp b/src/codegen/target/arm/operations.cpp index 8afe088729..1fa365c7b7 100644 --- a/src/codegen/target/arm/operations.cpp +++ b/src/codegen/target/arm/operations.cpp @@ -35,20 +35,20 @@ inline unsigned lo8(int64_t i) void andC(Context* con, unsigned size, lir::Constant* a, - lir::Register* b, - lir::Register* dst); + lir::RegisterPair* b, + lir::RegisterPair* dst); void shiftLeftR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { int tmp1 = newTemp(con), tmp2 = newTemp(con), tmp3 = newTemp(con); ResolvedPromise maskPromise(0x3F); lir::Constant mask(&maskPromise); - lir::Register dst(tmp3); + lir::RegisterPair dst(tmp3); andC(con, 4, &mask, a, &dst); emit(con, lsl(tmp1, b->high, tmp3)); emit(con, rsbi(tmp2, tmp3, 32)); @@ -64,7 +64,7 @@ void shiftLeftR(Context* con, int tmp = newTemp(con); ResolvedPromise maskPromise(0x1F); lir::Constant mask(&maskPromise); - lir::Register dst(tmp); + lir::RegisterPair dst(tmp); andC(con, size, &mask, a, &dst); emit(con, lsl(t->low, b->low, tmp)); freeTemp(con, tmp); @@ -73,15 +73,15 @@ void shiftLeftR(Context* con, void moveRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize, - lir::Register* dst); + lir::RegisterPair* dst); void shiftLeftC(Context* con, unsigned size UNUSED, lir::Constant* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* b, + lir::RegisterPair* t) { assertT(con, size == vm::TargetBytesPerWord); if (getValue(a) & 0x1F) { @@ -93,15 +93,15 @@ void shiftLeftC(Context* con, void shiftRightR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { int tmp1 = newTemp(con), tmp2 = newTemp(con), tmp3 = newTemp(con); ResolvedPromise maskPromise(0x3F); lir::Constant mask(&maskPromise); - lir::Register dst(tmp3); + lir::RegisterPair dst(tmp3); andC(con, 4, &mask, a, &dst); emit(con, lsr(tmp1, b->low, tmp3)); emit(con, rsbi(tmp2, tmp3, 32)); @@ -117,7 +117,7 @@ void shiftRightR(Context* con, int tmp = newTemp(con); ResolvedPromise maskPromise(0x1F); lir::Constant mask(&maskPromise); - lir::Register dst(tmp); + lir::RegisterPair dst(tmp); andC(con, size, &mask, a, &dst); emit(con, asr(t->low, b->low, tmp)); freeTemp(con, tmp); @@ -127,8 +127,8 @@ void shiftRightR(Context* con, void shiftRightC(Context* con, unsigned size UNUSED, lir::Constant* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* b, + lir::RegisterPair* t) { assertT(con, size == vm::TargetBytesPerWord); if (getValue(a) & 0x1F) { @@ -140,14 +140,14 @@ void shiftRightC(Context* con, void unsignedShiftRightR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { int tmpShift = newTemp(con); ResolvedPromise maskPromise(size == 8 ? 0x3F : 0x1F); lir::Constant mask(&maskPromise); - lir::Register dst(tmpShift); + lir::RegisterPair dst(tmpShift); andC(con, 4, &mask, a, &dst); emit(con, lsr(t->low, b->low, tmpShift)); if (size == 8) { @@ -168,8 +168,8 @@ void unsignedShiftRightR(Context* con, void unsignedShiftRightC(Context* con, unsigned size UNUSED, lir::Constant* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* b, + lir::RegisterPair* t) { assertT(con, size == vm::TargetBytesPerWord); if (getValue(a) & 0x1F) { @@ -274,7 +274,7 @@ void resolve(MyBlock* b) } } -void jumpR(Context* con, unsigned size UNUSED, lir::Register* target) +void jumpR(Context* con, unsigned size UNUSED, lir::RegisterPair* target) { assertT(con, size == vm::TargetBytesPerWord); emit(con, bx(target->low)); @@ -282,14 +282,14 @@ void jumpR(Context* con, unsigned size UNUSED, lir::Register* target) void swapRR(Context* con, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(con, aSize == vm::TargetBytesPerWord); assertT(con, bSize == vm::TargetBytesPerWord); - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); moveRR(con, aSize, a, bSize, &tmp); moveRR(con, bSize, b, aSize, a); moveRR(con, bSize, &tmp, bSize, b); @@ -298,9 +298,9 @@ void swapRR(Context* con, void moveRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize, - lir::Register* dst) + lir::RegisterPair* dst) { bool srcIsFpr = isFpr(src); bool dstIsFpr = isFpr(dst); @@ -343,8 +343,8 @@ void moveRR(Context* con, moveRR(con, 4, src, 4, dst); emit(con, asri(dst->high, src->low, 31)); } else if (srcSize == 8 and dstSize == 8) { - lir::Register srcHigh(src->high); - lir::Register dstHigh(dst->high); + lir::RegisterPair srcHigh(src->high); + lir::RegisterPair dstHigh(dst->high); if (src->high == dst->low) { if (src->low == dst->high) { @@ -369,9 +369,9 @@ void moveRR(Context* con, void moveZRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned, - lir::Register* dst) + lir::RegisterPair* dst) { switch (srcSize) { case 2: @@ -388,16 +388,16 @@ void moveCR(Context* con, unsigned size, lir::Constant* src, unsigned, - lir::Register* dst); + lir::RegisterPair* dst); void moveCR2(Context* con, unsigned size, lir::Constant* src, - lir::Register* dst, + lir::RegisterPair* dst, Promise* callOffset) { if (isFpr(dst)) { // floating-point - lir::Register tmp = size > 4 ? makeTemp64(con) : makeTemp(con); + lir::RegisterPair tmp = size > 4 ? makeTemp64(con) : makeTemp(con); moveCR(con, size, src, size, &tmp); moveRR(con, size, &tmp, size, dst); freeTemp(con, tmp); @@ -407,7 +407,7 @@ void moveCR2(Context* con, lir::Constant srcLo(&loBits); ResolvedPromise hiBits(value >> 32); lir::Constant srcHi(&hiBits); - lir::Register dstHi(dst->high); + lir::RegisterPair dstHi(dst->high); moveCR(con, 4, &srcLo, 4, dst); moveCR(con, 4, &srcHi, 4, &dstHi); } else if (src->value->resolved() and isOfWidth(getValue(src), 8)) { @@ -422,16 +422,16 @@ void moveCR(Context* con, unsigned size, lir::Constant* src, unsigned, - lir::Register* dst) + lir::RegisterPair* dst) { moveCR2(con, size, src, dst, 0); } void addR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { emit(con, SETS(add(t->low, a->low, b->low))); @@ -443,9 +443,9 @@ void addR(Context* con, void subR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { emit(con, SETS(rsb(t->low, a->low, b->low))); @@ -458,8 +458,8 @@ void subR(Context* con, void addC(Context* con, unsigned size, lir::Constant* a, - lir::Register* b, - lir::Register* dst) + lir::RegisterPair* b, + lir::RegisterPair* dst) { assertT(con, size == vm::TargetBytesPerWord); @@ -481,8 +481,8 @@ void addC(Context* con, void subC(Context* con, unsigned size, lir::Constant* a, - lir::Register* b, - lir::Register* dst) + lir::RegisterPair* b, + lir::RegisterPair* dst) { assertT(con, size == vm::TargetBytesPerWord); @@ -503,9 +503,9 @@ void subC(Context* con, void multiplyR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { bool useTemporaries = b->low == t->low; @@ -531,9 +531,9 @@ void multiplyR(Context* con, void floatAbsoluteRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b) + lir::RegisterPair* b) { if (size == 8) { emit(con, fabsd(fpr64(b), fpr64(a))); @@ -544,9 +544,9 @@ void floatAbsoluteRR(Context* con, void floatNegateRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b) + lir::RegisterPair* b) { if (size == 8) { emit(con, fnegd(fpr64(b), fpr64(a))); @@ -557,9 +557,9 @@ void floatNegateRR(Context* con, void float2FloatRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b) + lir::RegisterPair* b) { if (size == 8) { emit(con, fcvtsd(fpr32(b), fpr64(a))); @@ -570,9 +570,9 @@ void float2FloatRR(Context* con, void float2IntRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b) + lir::RegisterPair* b) { int tmp = newTemp(con, FPR_MASK); int ftmp = fpr32(tmp); @@ -587,9 +587,9 @@ void float2IntRR(Context* con, void int2FloatRR(Context* con, unsigned, - lir::Register* a, + lir::RegisterPair* a, unsigned size, - lir::Register* b) + lir::RegisterPair* b) { emit(con, fmsr(fpr32(b), a->low)); if (size == 8) { // int to double @@ -601,9 +601,9 @@ void int2FloatRR(Context* con, void floatSqrtRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b) + lir::RegisterPair* b) { if (size == 8) { emit(con, fsqrtd(fpr64(b), fpr64(a))); @@ -614,9 +614,9 @@ void floatSqrtRR(Context* con, void floatAddR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { emit(con, faddd(fpr64(t), fpr64(a), fpr64(b))); @@ -627,9 +627,9 @@ void floatAddR(Context* con, void floatSubtractR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { emit(con, fsubd(fpr64(t), fpr64(b), fpr64(a))); @@ -640,9 +640,9 @@ void floatSubtractR(Context* con, void floatMultiplyR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { emit(con, fmuld(fpr64(t), fpr64(a), fpr64(b))); @@ -653,9 +653,9 @@ void floatMultiplyR(Context* con, void floatDivideR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t) { if (size == 8) { emit(con, fdivd(fpr64(t), fpr64(b), fpr64(a))); @@ -672,7 +672,7 @@ int normalize(Context* con, bool* release) { if (offset != 0 or scale != 1) { - lir::Register normalizedIndex( + lir::RegisterPair normalizedIndex( *preserveIndex ? con->client->acquireTemporary(GPR_MASK) : index); if (*preserveIndex) { @@ -685,7 +685,7 @@ int normalize(Context* con, int scaled; if (scale != 1) { - lir::Register unscaledIndex(index); + lir::RegisterPair unscaledIndex(index); ResolvedPromise scalePromise(log(scale)); lir::Constant scaleConstant(&scalePromise); @@ -702,12 +702,12 @@ int normalize(Context* con, } if (offset != 0) { - lir::Register untranslatedIndex(scaled); + lir::RegisterPair untranslatedIndex(scaled); ResolvedPromise offsetPromise(offset); lir::Constant offsetConstant(&offsetPromise); - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); moveCR(con, vm::TargetBytesPerWord, &offsetConstant, @@ -730,7 +730,7 @@ int normalize(Context* con, void store(Context* con, unsigned size, - lir::Register* src, + lir::RegisterPair* src, int base, int offset, int index, @@ -757,7 +757,7 @@ void store(Context* con, break; case 8: { // split into 2 32-bit stores - lir::Register srcHigh(src->high); + lir::RegisterPair srcHigh(src->high); store(con, 4, &srcHigh, base, 0, normalized, 1, preserveIndex); store(con, 4, src, base, 4, normalized, 1, preserveIndex); } break; @@ -766,7 +766,7 @@ void store(Context* con, abort(con); } } else { // FPR store - lir::Register base_(base), normalized_(normalized), + lir::RegisterPair base_(base), normalized_(normalized), absAddr = makeTemp(con); // FPR stores have only bases, so we must add the index addR(con, vm::TargetBytesPerWord, &base_, &normalized_, &absAddr); @@ -798,7 +798,7 @@ void store(Context* con, break; case 8: { // split into 2 32-bit stores - lir::Register srcHigh(src->high); + lir::RegisterPair srcHigh(src->high); store(con, 4, &srcHigh, base, offset, lir::NoRegister, 1, false); store(con, 4, src, base, offset + 4, lir::NoRegister, 1, false); } break; @@ -815,7 +815,7 @@ void store(Context* con, emit(con, fsts(fpr32(src), base, offset)); } } else { - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); ResolvedPromise offsetPromise(offset); lir::Constant offsetConstant(&offsetPromise); moveCR(con, @@ -832,7 +832,7 @@ void store(Context* con, void moveRM(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize UNUSED, lir::Memory* dst) { @@ -849,7 +849,7 @@ void load(Context* con, int index, unsigned scale, unsigned dstSize, - lir::Register* dst, + lir::RegisterPair* dst, bool preserveIndex, bool signExtend) { @@ -882,7 +882,7 @@ void load(Context* con, load(con, 4, base, 0, normalized, 1, 4, dst, preserveIndex, false); moveRR(con, 4, dst, 8, dst); } else if (srcSize == 8 and dstSize == 8) { - lir::Register dstHigh(dst->high); + lir::RegisterPair dstHigh(dst->high); load(con, 4, base, @@ -903,7 +903,7 @@ void load(Context* con, abort(con); } } else { // FPR load - lir::Register base_(base), normalized_(normalized), + lir::RegisterPair base_(base), normalized_(normalized), absAddr = makeTemp(con); // VFP loads only have bases, so we must add the index addR(con, vm::TargetBytesPerWord, &base_, &normalized_, &absAddr); @@ -946,7 +946,7 @@ void load(Context* con, case 8: { if (dstSize == 8) { - lir::Register dstHigh(dst->high); + lir::RegisterPair dstHigh(dst->high); load(con, 4, base, @@ -984,7 +984,7 @@ void load(Context* con, emit(con, flds(fpr32(dst), base, offset)); } } else { - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); ResolvedPromise offsetPromise(offset); lir::Constant offsetConstant(&offsetPromise); moveCR(con, @@ -1003,7 +1003,7 @@ void moveMR(Context* con, unsigned srcSize, lir::Memory* src, unsigned dstSize, - lir::Register* dst) + lir::RegisterPair* dst) { load(con, srcSize, @@ -1021,7 +1021,7 @@ void moveZMR(Context* con, unsigned srcSize, lir::Memory* src, unsigned dstSize, - lir::Register* dst) + lir::RegisterPair* dst) { load(con, srcSize, @@ -1037,9 +1037,9 @@ void moveZMR(Context* con, void andR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* dst) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* dst) { if (size == 8) emit(con, and_(dst->high, a->high, b->high)); @@ -1049,8 +1049,8 @@ void andR(Context* con, void andC(Context* con, unsigned size, lir::Constant* a, - lir::Register* b, - lir::Register* dst) + lir::RegisterPair* b, + lir::RegisterPair* dst) { int64_t v = a->value->value(); @@ -1061,8 +1061,8 @@ void andC(Context* con, ResolvedPromise low(v & 0xFFFFFFFF); lir::Constant al(&low); - lir::Register bh(b->high); - lir::Register dh(dst->high); + lir::RegisterPair bh(b->high); + lir::RegisterPair dh(dst->high); andC(con, 4, &al, b, dst); andC(con, 4, &ah, &bh, &dh); @@ -1078,7 +1078,7 @@ void andC(Context* con, // instruction bool useTemporary = b->low == dst->low; - lir::Register tmp(dst->low); + lir::RegisterPair tmp(dst->low); if (useTemporary) { tmp.low = con->client->acquireTemporary(GPR_MASK); } @@ -1098,9 +1098,9 @@ void andC(Context* con, void orR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* dst) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* dst) { if (size == 8) emit(con, orr(dst->high, a->high, b->high)); @@ -1109,9 +1109,9 @@ void orR(Context* con, void xorR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* dst) + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* dst) { if (size == 8) emit(con, eor(dst->high, a->high, b->high)); @@ -1122,7 +1122,7 @@ void moveAR2(Context* con, unsigned srcSize, lir::Address* src, unsigned dstSize, - lir::Register* dst) + lir::RegisterPair* dst) { assertT(con, srcSize == 4 and dstSize == 4); @@ -1137,16 +1137,16 @@ void moveAR(Context* con, unsigned srcSize, lir::Address* src, unsigned dstSize, - lir::Register* dst) + lir::RegisterPair* dst) { moveAR2(con, srcSize, src, dstSize, dst); } void compareRR(Context* con, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(con, !(isFpr(a) ^ isFpr(b))); // regs must be of the same type @@ -1168,14 +1168,14 @@ void compareCR(Context* con, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(con, aSize == 4 and bSize == 4); if (!isFpr(b) && a->value->resolved() && isOfWidth(a->value->value(), 8)) { emit(con, cmpi(b->low, a->value->value())); } else { - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); moveCR(con, aSize, a, bSize, &tmp); compareRR(con, bSize, &tmp, bSize, b); con->client->releaseTemporary(tmp.low); @@ -1190,7 +1190,7 @@ void compareCM(Context* con, { assertT(con, aSize == 4 and bSize == 4); - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); moveMR(con, bSize, b, bSize, &tmp); compareCR(con, aSize, a, bSize, &tmp); con->client->releaseTemporary(tmp.low); @@ -1198,13 +1198,13 @@ void compareCM(Context* con, void compareRM(Context* con, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, lir::Memory* b) { assertT(con, aSize == 4 and bSize == 4); - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); moveMR(con, bSize, b, bSize, &tmp); compareRR(con, aSize, a, bSize, &tmp); con->client->releaseTemporary(tmp.low); @@ -1352,13 +1352,13 @@ void branchLong(Context* con, void branchRR(Context* con, lir::TernaryOperation op, unsigned size, - lir::Register* a, - lir::Register* b, + lir::RegisterPair* a, + lir::RegisterPair* b, lir::Constant* target) { if (!isFpr(a) && size > vm::TargetBytesPerWord) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); branchLong( con, op, a, &ah, b, &bh, target, CAST2(compareRR), CAST2(compareRR)); @@ -1372,7 +1372,7 @@ void branchCR(Context* con, lir::TernaryOperation op, unsigned size, lir::Constant* a, - lir::Register* b, + lir::RegisterPair* b, lir::Constant* target) { assertT(con, !isFloatBranch(op)); @@ -1386,7 +1386,7 @@ void branchCR(Context* con, ResolvedPromise high((v >> 32) & ~static_cast(0)); lir::Constant ah(&high); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); branchLong( con, op, &al, &ah, b, &bh, target, CAST2(compareCR), CAST2(compareCR)); @@ -1399,7 +1399,7 @@ void branchCR(Context* con, void branchRM(Context* con, lir::TernaryOperation op, unsigned size, - lir::Register* a, + lir::RegisterPair* a, lir::Memory* b, lir::Constant* target) { @@ -1450,7 +1450,7 @@ void moveCM(Context* con, } break; default: - lir::Register tmp(con->client->acquireTemporary(GPR_MASK)); + lir::RegisterPair tmp(con->client->acquireTemporary(GPR_MASK)); moveCR(con, srcSize, src, dstSize, &tmp); moveRM(con, dstSize, &tmp, dstSize, dst); con->client->releaseTemporary(tmp.low); @@ -1459,9 +1459,9 @@ void moveCM(Context* con, void negateRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize UNUSED, - lir::Register* dst) + lir::RegisterPair* dst) { assertT(con, srcSize == dstSize); @@ -1473,7 +1473,7 @@ void negateRR(Context* con, } } -void callR(Context* con, unsigned size UNUSED, lir::Register* target) +void callR(Context* con, unsigned size UNUSED, lir::RegisterPair* target) { assertT(con, size == vm::TargetBytesPerWord); emit(con, blx(target->low)); @@ -1491,7 +1491,7 @@ void longCallC(Context* con, unsigned size UNUSED, lir::Constant* target) { assertT(con, size == vm::TargetBytesPerWord); - lir::Register tmp(4); + lir::RegisterPair tmp(4); moveCR2(con, vm::TargetBytesPerWord, target, &tmp, offsetPromise(con)); callR(con, vm::TargetBytesPerWord, &tmp); } @@ -1500,7 +1500,7 @@ void longJumpC(Context* con, unsigned size UNUSED, lir::Constant* target) { assertT(con, size == vm::TargetBytesPerWord); - lir::Register tmp(4); // a non-arg reg that we don't mind clobbering + lir::RegisterPair tmp(4); // a non-arg reg that we don't mind clobbering moveCR2(con, vm::TargetBytesPerWord, target, &tmp, offsetPromise(con)); jumpR(con, vm::TargetBytesPerWord, &tmp); } diff --git a/src/codegen/target/arm/operations.h b/src/codegen/target/arm/operations.h index af2c70fc46..4135bedbf4 100644 --- a/src/codegen/target/arm/operations.h +++ b/src/codegen/target/arm/operations.h @@ -45,19 +45,19 @@ inline int64_t getValue(lir::Constant* con) return con->value->value(); } -inline lir::Register makeTemp(Context* con) +inline lir::RegisterPair makeTemp(Context* con) { - lir::Register tmp(newTemp(con)); + lir::RegisterPair tmp(newTemp(con)); return tmp; } -inline lir::Register makeTemp64(Context* con) +inline lir::RegisterPair makeTemp64(Context* con) { - lir::Register tmp(newTemp(con), newTemp(con)); + lir::RegisterPair tmp(newTemp(con), newTemp(con)); return tmp; } -inline void freeTemp(Context* con, const lir::Register& tmp) +inline void freeTemp(Context* con, const lir::RegisterPair& tmp) { if (tmp.low != lir::NoRegister) freeTemp(con, tmp.low); @@ -67,45 +67,45 @@ inline void freeTemp(Context* con, const lir::Register& tmp) void shiftLeftR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void moveRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize, - lir::Register* dst); + lir::RegisterPair* dst); void shiftLeftC(Context* con, unsigned size UNUSED, lir::Constant* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* b, + lir::RegisterPair* t); void shiftRightR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void shiftRightC(Context* con, unsigned size UNUSED, lir::Constant* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* b, + lir::RegisterPair* t); void unsignedShiftRightR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void unsignedShiftRightC(Context* con, unsigned size UNUSED, lir::Constant* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* b, + lir::RegisterPair* t); bool needJump(MyBlock* b); @@ -113,133 +113,133 @@ unsigned padding(MyBlock* b, unsigned offset); void resolve(MyBlock* b); -void jumpR(Context* con, unsigned size UNUSED, lir::Register* target); +void jumpR(Context* con, unsigned size UNUSED, lir::RegisterPair* target); void swapRR(Context* con, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void moveRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize, - lir::Register* dst); + lir::RegisterPair* dst); void moveZRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned, - lir::Register* dst); + lir::RegisterPair* dst); void moveCR(Context* con, unsigned size, lir::Constant* src, unsigned, - lir::Register* dst); + lir::RegisterPair* dst); void moveCR2(Context* con, unsigned size, lir::Constant* src, - lir::Register* dst, + lir::RegisterPair* dst, Promise* callOffset); void moveCR(Context* con, unsigned size, lir::Constant* src, unsigned, - lir::Register* dst); + lir::RegisterPair* dst); void addR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void subR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void addC(Context* con, unsigned size, lir::Constant* a, - lir::Register* b, - lir::Register* dst); + lir::RegisterPair* b, + lir::RegisterPair* dst); void subC(Context* con, unsigned size, lir::Constant* a, - lir::Register* b, - lir::Register* dst); + lir::RegisterPair* b, + lir::RegisterPair* dst); void multiplyR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void floatAbsoluteRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b); + lir::RegisterPair* b); void floatNegateRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b); + lir::RegisterPair* b); void float2FloatRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b); + lir::RegisterPair* b); void float2IntRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b); + lir::RegisterPair* b); void int2FloatRR(Context* con, unsigned, - lir::Register* a, + lir::RegisterPair* a, unsigned size, - lir::Register* b); + lir::RegisterPair* b); void floatSqrtRR(Context* con, unsigned size, - lir::Register* a, + lir::RegisterPair* a, unsigned, - lir::Register* b); + lir::RegisterPair* b); void floatAddR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void floatSubtractR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void floatMultiplyR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); void floatDivideR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* t); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* t); int normalize(Context* con, int offset, @@ -250,7 +250,7 @@ int normalize(Context* con, void store(Context* con, unsigned size, - lir::Register* src, + lir::RegisterPair* src, int base, int offset, int index, @@ -259,7 +259,7 @@ void store(Context* con, void moveRM(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize UNUSED, lir::Memory* dst); @@ -270,7 +270,7 @@ void load(Context* con, int index, unsigned scale, unsigned dstSize, - lir::Register* dst, + lir::RegisterPair* dst, bool preserveIndex, bool signExtend); @@ -278,61 +278,61 @@ void moveMR(Context* con, unsigned srcSize, lir::Memory* src, unsigned dstSize, - lir::Register* dst); + lir::RegisterPair* dst); void moveZMR(Context* con, unsigned srcSize, lir::Memory* src, unsigned dstSize, - lir::Register* dst); + lir::RegisterPair* dst); void andR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* dst); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* dst); void andC(Context* con, unsigned size, lir::Constant* a, - lir::Register* b, - lir::Register* dst); + lir::RegisterPair* b, + lir::RegisterPair* dst); void orR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* dst); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* dst); void xorR(Context* con, unsigned size, - lir::Register* a, - lir::Register* b, - lir::Register* dst); + lir::RegisterPair* a, + lir::RegisterPair* b, + lir::RegisterPair* dst); void moveAR2(Context* con, unsigned srcSize, lir::Address* src, unsigned dstSize, - lir::Register* dst); + lir::RegisterPair* dst); void moveAR(Context* con, unsigned srcSize, lir::Address* src, unsigned dstSize, - lir::Register* dst); + lir::RegisterPair* dst); void compareRR(Context* con, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void compareCR(Context* con, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void compareCM(Context* con, unsigned aSize, @@ -342,7 +342,7 @@ void compareCM(Context* con, void compareRM(Context* con, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, lir::Memory* b); @@ -365,21 +365,21 @@ void branchLong(Context* con, void branchRR(Context* con, lir::TernaryOperation op, unsigned size, - lir::Register* a, - lir::Register* b, + lir::RegisterPair* a, + lir::RegisterPair* b, lir::Constant* target); void branchCR(Context* con, lir::TernaryOperation op, unsigned size, lir::Constant* a, - lir::Register* b, + lir::RegisterPair* b, lir::Constant* target); void branchRM(Context* con, lir::TernaryOperation op, unsigned size, - lir::Register* a, + lir::RegisterPair* a, lir::Memory* b, lir::Constant* target); @@ -403,11 +403,11 @@ void moveCM(Context* con, void negateRR(Context* con, unsigned srcSize, - lir::Register* src, + lir::RegisterPair* src, unsigned dstSize UNUSED, - lir::Register* dst); + lir::RegisterPair* dst); -void callR(Context* con, unsigned size UNUSED, lir::Register* target); +void callR(Context* con, unsigned size UNUSED, lir::RegisterPair* target); void callC(Context* con, unsigned size UNUSED, lir::Constant* target); diff --git a/src/codegen/target/arm/registers.h b/src/codegen/target/arm/registers.h index c47f2ae8c5..7d94af2349 100644 --- a/src/codegen/target/arm/registers.h +++ b/src/codegen/target/arm/registers.h @@ -26,7 +26,7 @@ const int N_FPRS = 16; const RegisterMask GPR_MASK = 0xffff; const RegisterMask FPR_MASK = 0xffff0000; -inline bool isFpr(lir::Register* reg) +inline bool isFpr(lir::RegisterPair* reg) { return reg->low >= N_GPRS; } @@ -35,7 +35,7 @@ inline int fpr64(int reg) { return reg - N_GPRS; } -inline int fpr64(lir::Register* reg) +inline int fpr64(lir::RegisterPair* reg) { return fpr64(reg->low); } @@ -43,7 +43,7 @@ inline int fpr32(int reg) { return fpr64(reg) << 1; } -inline int fpr32(lir::Register* reg) +inline int fpr32(lir::RegisterPair* reg) { return fpr64(reg) << 1; } diff --git a/src/codegen/target/x86/assembler.cpp b/src/codegen/target/x86/assembler.cpp index 4049683651..e91ffc6c8b 100644 --- a/src/codegen/target/x86/assembler.cpp +++ b/src/codegen/target/x86/assembler.cpp @@ -902,7 +902,7 @@ class MyAssembler : public Assembler { virtual void checkStackOverflow(uintptr_t handler, unsigned stackLimitOffsetFromThread) { - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); lir::Memory stackLimit(rbx, stackLimitOffsetFromThread); lir::Constant handlerConstant(resolvedPromise(&c, handler)); branchRM(&c, @@ -915,7 +915,7 @@ class MyAssembler : public Assembler { virtual void saveFrame(unsigned stackOffset, unsigned) { - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); lir::Memory stackDst(rbx, stackOffset); apply(lir::Move, OperandInfo(TargetBytesPerWord, lir::Operand::Type::RegisterPair, &stack), @@ -949,7 +949,7 @@ class MyAssembler : public Assembler { unsigned offset = 0; for (unsigned i = 0; i < argumentCount; ++i) { if (i < arch_->argumentRegisterCount()) { - lir::Register dst(arch_->argumentRegister(i)); + lir::RegisterPair dst(arch_->argumentRegister(i)); apply(lir::Move, OperandInfo(RUNTIME_ARRAY_BODY(arguments)[i].size, RUNTIME_ARRAY_BODY(arguments)[i].type, @@ -976,10 +976,10 @@ class MyAssembler : public Assembler { virtual void allocateFrame(unsigned footprint) { - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); if (UseFramePointer) { - lir::Register base(rbp); + lir::RegisterPair base(rbp); pushR(&c, TargetBytesPerWord, &base); apply(lir::Move, @@ -998,7 +998,7 @@ class MyAssembler : public Assembler { virtual void adjustFrame(unsigned difference) { - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); lir::Constant differenceConstant( resolvedPromise(&c, difference * TargetBytesPerWord)); apply(lir::Subtract, @@ -1011,15 +1011,15 @@ class MyAssembler : public Assembler { virtual void popFrame(unsigned frameFootprint) { if (UseFramePointer) { - lir::Register base(rbp); - lir::Register stack(rsp); + lir::RegisterPair base(rbp); + lir::RegisterPair stack(rsp); apply(lir::Move, OperandInfo(TargetBytesPerWord, lir::Operand::Type::RegisterPair, &base), OperandInfo(TargetBytesPerWord, lir::Operand::Type::RegisterPair, &stack)); popR(&c, TargetBytesPerWord, &base); } else { - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); lir::Constant footprint( resolvedPromise(&c, frameFootprint * TargetBytesPerWord)); apply(lir::Add, @@ -1036,7 +1036,7 @@ class MyAssembler : public Assembler { { if (TailCalls) { if (offset) { - lir::Register tmp(c.client->acquireTemporary()); + lir::RegisterPair tmp(c.client->acquireTemporary()); unsigned baseSize = UseFramePointer ? 1 : 0; @@ -1060,11 +1060,11 @@ class MyAssembler : public Assembler { if (UseFramePointer) { lir::Memory baseSrc(rsp, frameFootprint * TargetBytesPerWord); - lir::Register base(rbp); + lir::RegisterPair base(rbp); moveMR(&c, TargetBytesPerWord, &baseSrc, TargetBytesPerWord, &base); } - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); lir::Constant footprint(resolvedPromise( &c, (frameFootprint - offset + baseSize) * TargetBytesPerWord)); @@ -1073,7 +1073,7 @@ class MyAssembler : public Assembler { if (returnAddressSurrogate != lir::NoRegister) { assertT(&c, offset > 0); - lir::Register ras(returnAddressSurrogate); + lir::RegisterPair ras(returnAddressSurrogate); lir::Memory dst(rsp, offset * TargetBytesPerWord); moveRM(&c, TargetBytesPerWord, &ras, TargetBytesPerWord, &dst); } @@ -1081,7 +1081,7 @@ class MyAssembler : public Assembler { if (framePointerSurrogate != lir::NoRegister) { assertT(&c, offset > 0); - lir::Register fps(framePointerSurrogate); + lir::RegisterPair fps(framePointerSurrogate); lir::Memory dst(rsp, (offset - 1) * TargetBytesPerWord); moveRM(&c, TargetBytesPerWord, &fps, TargetBytesPerWord, &dst); } @@ -1102,10 +1102,10 @@ class MyAssembler : public Assembler { assertT(&c, (argumentFootprint % StackAlignmentInWords) == 0); if (TailCalls and argumentFootprint > StackAlignmentInWords) { - lir::Register returnAddress(rcx); + lir::RegisterPair returnAddress(rcx); popR(&c, TargetBytesPerWord, &returnAddress); - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); lir::Constant adjustment(resolvedPromise( &c, (argumentFootprint - StackAlignmentInWords) * TargetBytesPerWord)); @@ -1122,10 +1122,10 @@ class MyAssembler : public Assembler { { popFrame(frameFootprint); - lir::Register returnAddress(rcx); + lir::RegisterPair returnAddress(rcx); popR(&c, TargetBytesPerWord, &returnAddress); - lir::Register stack(rsp); + lir::RegisterPair stack(rsp); lir::Memory stackSrc(rbx, stackOffsetFromThread); moveMR(&c, TargetBytesPerWord, &stackSrc, TargetBytesPerWord, &stack); diff --git a/src/codegen/target/x86/encode.cpp b/src/codegen/target/x86/encode.cpp index f64d91a2c9..7911bb7cc1 100644 --- a/src/codegen/target/x86/encode.cpp +++ b/src/codegen/target/x86/encode.cpp @@ -76,22 +76,22 @@ void maybeRex(Context* c, } } -void maybeRex(Context* c, unsigned size, lir::Register* a, lir::Register* b) +void maybeRex(Context* c, unsigned size, lir::RegisterPair* a, lir::RegisterPair* b) { maybeRex(c, size, a->low, lir::NoRegister, b->low, false); } -void alwaysRex(Context* c, unsigned size, lir::Register* a, lir::Register* b) +void alwaysRex(Context* c, unsigned size, lir::RegisterPair* a, lir::RegisterPair* b) { maybeRex(c, size, a->low, lir::NoRegister, b->low, true); } -void maybeRex(Context* c, unsigned size, lir::Register* a) +void maybeRex(Context* c, unsigned size, lir::RegisterPair* a) { maybeRex(c, size, lir::NoRegister, lir::NoRegister, a->low, false); } -void maybeRex(Context* c, unsigned size, lir::Register* a, lir::Memory* b) +void maybeRex(Context* c, unsigned size, lir::RegisterPair* a, lir::Memory* b) { maybeRex(c, size, a->low, b->index, b->base, size == 1 and (a->low & 4)); } @@ -106,7 +106,7 @@ void modrm(Context* c, uint8_t mod, int a, int b) c->code.append(mod | (regCode(b) << 3) | regCode(a)); } -void modrm(Context* c, uint8_t mod, lir::Register* a, lir::Register* b) +void modrm(Context* c, uint8_t mod, lir::RegisterPair* a, lir::RegisterPair* b) { modrm(c, mod, a->low, b->low); } @@ -143,7 +143,7 @@ void modrmSibImm(Context* c, int a, int scale, int index, int base, int offset) } } -void modrmSibImm(Context* c, lir::Register* a, lir::Memory* b) +void modrmSibImm(Context* c, lir::RegisterPair* a, lir::Memory* b) { modrmSibImm(c, a->low, b->scale, b->index, b->base, b->offset); } @@ -177,9 +177,9 @@ void conditional(Context* c, unsigned condition, lir::Constant* a) void sseMoveRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize >= 4); assertT(c, aSize == bSize); @@ -213,10 +213,10 @@ void sseMoveCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize <= vm::TargetBytesPerWord); - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR2(c, aSize, a, aSize, &tmp, 0); sseMoveRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -226,7 +226,7 @@ void sseMoveMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize >= 4); @@ -244,7 +244,7 @@ void sseMoveMR(Context* c, void sseMoveRM(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, UNUSED unsigned bSize, lir::Memory* b) { @@ -353,9 +353,9 @@ void branchFloat(Context* c, lir::TernaryOperation op, lir::Constant* target) void floatRegOp(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b, + lir::RegisterPair* b, uint8_t op, uint8_t mod) { @@ -373,7 +373,7 @@ void floatMemOp(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b, + lir::RegisterPair* b, uint8_t op) { if (aSize == 4) { @@ -390,13 +390,13 @@ void moveCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void moveCR2(Context* c, UNUSED unsigned aSize, lir::Constant* a, UNUSED unsigned bSize, - lir::Register* b, + lir::RegisterPair* b, unsigned promiseOffset) { if (vm::TargetBytesPerWord == 4 and bSize == 8) { @@ -408,7 +408,7 @@ void moveCR2(Context* c, ResolvedPromise low(v & 0xFFFFFFFF); lir::Constant al(&low); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); moveCR(c, 4, &al, 4, b); moveCR(c, 4, &ah, 4, &bh); diff --git a/src/codegen/target/x86/encode.h b/src/codegen/target/x86/encode.h index 564b84f6e9..a51f27b725 100644 --- a/src/codegen/target/x86/encode.h +++ b/src/codegen/target/x86/encode.h @@ -32,13 +32,13 @@ void maybeRex(Context* c, int base, bool always); -void maybeRex(Context* c, unsigned size, lir::Register* a, lir::Register* b); +void maybeRex(Context* c, unsigned size, lir::RegisterPair* a, lir::RegisterPair* b); -void alwaysRex(Context* c, unsigned size, lir::Register* a, lir::Register* b); +void alwaysRex(Context* c, unsigned size, lir::RegisterPair* a, lir::RegisterPair* b); -void maybeRex(Context* c, unsigned size, lir::Register* a); +void maybeRex(Context* c, unsigned size, lir::RegisterPair* a); -void maybeRex(Context* c, unsigned size, lir::Register* a, lir::Memory* b); +void maybeRex(Context* c, unsigned size, lir::RegisterPair* a, lir::Memory* b); void maybeRex(Context* c, unsigned size, lir::Memory* a); @@ -47,19 +47,19 @@ inline int regCode(int a) return a & 7; } -inline int regCode(lir::Register* a) +inline int regCode(lir::RegisterPair* a) { return regCode(a->low); } -inline bool isFloatReg(lir::Register* a) +inline bool isFloatReg(lir::RegisterPair* a) { return a->low >= xmm0; } void modrm(Context* c, uint8_t mod, int a, int b); -void modrm(Context* c, uint8_t mod, lir::Register* a, lir::Register* b); +void modrm(Context* c, uint8_t mod, lir::RegisterPair* a, lir::RegisterPair* b); void sib(Context* c, unsigned scale, int index, int base); @@ -67,7 +67,7 @@ void modrmSib(Context* c, int width, int a, int scale, int index, int base); void modrmSibImm(Context* c, int a, int scale, int index, int base, int offset); -void modrmSibImm(Context* c, lir::Register* a, lir::Memory* b); +void modrmSibImm(Context* c, lir::RegisterPair* a, lir::Memory* b); void opcode(Context* c, uint8_t op); @@ -79,25 +79,25 @@ void conditional(Context* c, unsigned condition, lir::Constant* a); void sseMoveRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void sseMoveCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void sseMoveMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void sseMoveRM(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, UNUSED unsigned bSize, lir::Memory* b); @@ -107,9 +107,9 @@ void branchFloat(Context* c, lir::TernaryOperation op, lir::Constant* target); void floatRegOp(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b, + lir::RegisterPair* b, uint8_t op, uint8_t mod = 0xc0); @@ -117,14 +117,14 @@ void floatMemOp(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b, + lir::RegisterPair* b, uint8_t op); void moveCR2(Context* c, UNUSED unsigned aSize, lir::Constant* a, UNUSED unsigned bSize, - lir::Register* b, + lir::RegisterPair* b, unsigned promiseOffset); } // namespace x86 diff --git a/src/codegen/target/x86/operations.cpp b/src/codegen/target/x86/operations.cpp index 863d1cf5bf..b9229ea0aa 100644 --- a/src/codegen/target/x86/operations.cpp +++ b/src/codegen/target/x86/operations.cpp @@ -78,7 +78,7 @@ void longCallC(Context* c, unsigned size, lir::Constant* a) assertT(c, size == vm::TargetBytesPerWord); if (vm::TargetBytesPerWord == 8) { - lir::Register r(LongJumpRegister); + lir::RegisterPair r(LongJumpRegister); moveCR2(c, size, a, size, &r, 11); callR(c, size, &r); } else { @@ -86,7 +86,7 @@ void longCallC(Context* c, unsigned size, lir::Constant* a) } } -void jumpR(Context* c, unsigned size UNUSED, lir::Register* a) +void jumpR(Context* c, unsigned size UNUSED, lir::RegisterPair* a) { assertT(c, size == vm::TargetBytesPerWord); @@ -115,7 +115,7 @@ void longJumpC(Context* c, unsigned size, lir::Constant* a) assertT(c, size == vm::TargetBytesPerWord); if (vm::TargetBytesPerWord == 8) { - lir::Register r(LongJumpRegister); + lir::RegisterPair r(LongJumpRegister); moveCR2(c, size, a, size, &r, 11); jumpR(c, size, &r); } else { @@ -123,7 +123,7 @@ void longJumpC(Context* c, unsigned size, lir::Constant* a) } } -void callR(Context* c, unsigned size UNUSED, lir::Register* a) +void callR(Context* c, unsigned size UNUSED, lir::RegisterPair* a) { assertT(c, size == vm::TargetBytesPerWord); @@ -177,10 +177,10 @@ void alignedLongJumpC(Context* c, unsigned size, lir::Constant* a) } } -void pushR(Context* c, unsigned size, lir::Register* a) +void pushR(Context* c, unsigned size, lir::RegisterPair* a) { if (vm::TargetBytesPerWord == 4 and size == 8) { - lir::Register ah(a->high); + lir::RegisterPair ah(a->high); pushR(c, 4, &ah); pushR(c, 4, a); @@ -190,10 +190,10 @@ void pushR(Context* c, unsigned size, lir::Register* a) } } -void popR(Context* c, unsigned size, lir::Register* a) +void popR(Context* c, unsigned size, lir::RegisterPair* a) { if (vm::TargetBytesPerWord == 4 and size == 8) { - lir::Register ah(a->high); + lir::RegisterPair ah(a->high); popR(c, 4, a); popR(c, 4, &ah); @@ -206,7 +206,7 @@ void popR(Context* c, unsigned size, lir::Register* a) } } -void negateR(Context* c, unsigned size, lir::Register* a) +void negateR(Context* c, unsigned size, lir::RegisterPair* a) { if (vm::TargetBytesPerWord == 4 and size == 8) { assertT(c, a->low == rax and a->high == rdx); @@ -214,7 +214,7 @@ void negateR(Context* c, unsigned size, lir::Register* a) ResolvedPromise zeroPromise(0); lir::Constant zero(&zeroPromise); - lir::Register ah(a->high); + lir::RegisterPair ah(a->high); negateR(c, 4, a); addCarryCR(c, 4, &zero, &ah); @@ -227,9 +227,9 @@ void negateR(Context* c, unsigned size, lir::Register* a) void negateRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b UNUSED) + lir::RegisterPair* b UNUSED) { assertT(c, aSize == bSize); @@ -240,7 +240,7 @@ void moveCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { if (isFloatReg(b)) { sseMoveCR(c, aSize, a, bSize, b); @@ -253,7 +253,7 @@ void moveZCR(Context* c, unsigned aSize UNUSED, lir::Constant* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, not isFloatReg(b)); assertT(c, aSize == 2); @@ -267,9 +267,9 @@ void moveZCR(Context* c, void swapRR(Context* c, unsigned aSize UNUSED, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); assertT(c, aSize == vm::TargetBytesPerWord); @@ -281,9 +281,9 @@ void swapRR(Context* c, void moveRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, UNUSED unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { if (isFloatReg(a) or isFloatReg(b)) { sseMoveRR(c, aSize, a, bSize, b); @@ -291,8 +291,8 @@ void moveRR(Context* c, } if (vm::TargetBytesPerWord == 4 and aSize == 8 and bSize == 8) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); if (a->high == b->low) { if (a->low == b->high) { @@ -366,7 +366,7 @@ void moveMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { if (isFloatReg(b)) { sseMoveMR(c, aSize, a, bSize, b); @@ -408,7 +408,7 @@ void moveMR(Context* c, case 8: if (vm::TargetBytesPerWord == 4 and bSize == 8) { lir::Memory ah(a->base, a->offset + 4, a->index, a->scale); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); moveMR(c, 4, a, 4, b); moveMR(c, 4, &ah, 4, &bh); @@ -426,7 +426,7 @@ void moveMR(Context* c, void moveRM(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, lir::Memory* b) { @@ -469,7 +469,7 @@ void moveRM(Context* c, opcode(c, 0x89); modrmSibImm(c, a, b); } else { - lir::Register ah(a->high); + lir::RegisterPair ah(a->high); lir::Memory bh(b->base, b->offset + 4, b->index, b->scale); moveRM(c, 4, a, 4, b); @@ -486,7 +486,7 @@ void moveAR(Context* c, unsigned aSize, lir::Address* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, vm::TargetBytesPerWord == 8 or (aSize == 4 and bSize == 4)); @@ -539,7 +539,7 @@ void moveCM(Context* c, modrmSibImm(c, 0, b->scale, b->index, b->base, b->offset); c->code.append4(a->value->value()); } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, 8, a, 8, &tmp); moveRM(c, 8, &tmp, 8, b); c->client->releaseTemporary(tmp.low); @@ -562,9 +562,9 @@ void moveCM(Context* c, void moveZRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { switch (aSize) { case 2: @@ -582,7 +582,7 @@ void moveZMR(Context* c, unsigned aSize UNUSED, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, bSize == vm::TargetBytesPerWord); assertT(c, aSize == 2); @@ -592,7 +592,7 @@ void moveZMR(Context* c, modrmSibImm(c, b->low, a->scale, a->index, a->base, a->offset); } -void addCarryRR(Context* c, unsigned size, lir::Register* a, lir::Register* b) +void addCarryRR(Context* c, unsigned size, lir::RegisterPair* a, lir::RegisterPair* b) { assertT(c, vm::TargetBytesPerWord == 8 or size == 4); @@ -603,15 +603,15 @@ void addCarryRR(Context* c, unsigned size, lir::Register* a, lir::Register* b) void addRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); if (vm::TargetBytesPerWord == 4 and aSize == 8) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); addRR(c, 4, a, 4, b); addCarryRR(c, 4, &ah, &bh); @@ -622,7 +622,7 @@ void addRR(Context* c, } } -void addCarryCR(Context* c, unsigned size, lir::Constant* a, lir::Register* b) +void addCarryCR(Context* c, unsigned size, lir::Constant* a, lir::RegisterPair* b) { int64_t v = a->value->value(); maybeRex(c, size, b); @@ -639,7 +639,7 @@ void addCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -652,7 +652,7 @@ void addCR(Context* c, ResolvedPromise low(v & 0xFFFFFFFF); lir::Constant al(&low); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); addCR(c, 4, &al, 4, b); addCarryCR(c, 4, &ah, &bh); @@ -667,7 +667,7 @@ void addCR(Context* c, c->code.append4(v); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, aSize, &tmp); addRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -679,7 +679,7 @@ void addCR(Context* c, void subtractBorrowCR(Context* c, unsigned size UNUSED, lir::Constant* a, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, vm::TargetBytesPerWord == 8 or size == 4); @@ -697,7 +697,7 @@ void subtractCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -710,7 +710,7 @@ void subtractCR(Context* c, ResolvedPromise low(v & 0xFFFFFFFF); lir::Constant al(&low); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); subtractCR(c, 4, &al, 4, b); subtractBorrowCR(c, 4, &ah, &bh); @@ -725,7 +725,7 @@ void subtractCR(Context* c, c->code.append4(v); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, aSize, &tmp); subtractRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -736,8 +736,8 @@ void subtractCR(Context* c, void subtractBorrowRR(Context* c, unsigned size, - lir::Register* a, - lir::Register* b) + lir::RegisterPair* a, + lir::RegisterPair* b) { assertT(c, vm::TargetBytesPerWord == 8 or size == 4); @@ -748,15 +748,15 @@ void subtractBorrowRR(Context* c, void subtractRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); if (vm::TargetBytesPerWord == 4 and aSize == 8) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); subtractRR(c, 4, a, 4, b); subtractBorrowRR(c, 4, &ah, &bh); @@ -769,15 +769,15 @@ void subtractRR(Context* c, void andRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); if (vm::TargetBytesPerWord == 4 and aSize == 8) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); andRR(c, 4, a, 4, b); andRR(c, 4, &ah, 4, &bh); @@ -792,7 +792,7 @@ void andCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -805,7 +805,7 @@ void andCR(Context* c, ResolvedPromise low(v & 0xFFFFFFFF); lir::Constant al(&low); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); andCR(c, 4, &al, 4, b); andCR(c, 4, &ah, 4, &bh); @@ -820,7 +820,7 @@ void andCR(Context* c, c->code.append4(v); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, aSize, &tmp); andRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -830,15 +830,15 @@ void andCR(Context* c, void orRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); if (vm::TargetBytesPerWord == 4 and aSize == 8) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); orRR(c, 4, a, 4, b); orRR(c, 4, &ah, 4, &bh); @@ -853,7 +853,7 @@ void orCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -866,7 +866,7 @@ void orCR(Context* c, ResolvedPromise low(v & 0xFFFFFFFF); lir::Constant al(&low); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); orCR(c, 4, &al, 4, b); orCR(c, 4, &ah, 4, &bh); @@ -881,7 +881,7 @@ void orCR(Context* c, c->code.append4(v); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, aSize, &tmp); orRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -892,13 +892,13 @@ void orCR(Context* c, void xorRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { if (vm::TargetBytesPerWord == 4 and aSize == 8) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); xorRR(c, 4, a, 4, b); xorRR(c, 4, &ah, 4, &bh); @@ -913,7 +913,7 @@ void xorCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -926,7 +926,7 @@ void xorCR(Context* c, ResolvedPromise low(v & 0xFFFFFFFF); lir::Constant al(&low); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); xorCR(c, 4, &al, 4, b); xorCR(c, 4, &ah, 4, &bh); @@ -941,7 +941,7 @@ void xorCR(Context* c, c->code.append4(v); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, aSize, &tmp); xorRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -952,9 +952,9 @@ void xorCR(Context* c, void multiplyRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -966,12 +966,12 @@ void multiplyRR(Context* c, c->client->save(rax); - lir::Register axdx(rax, rdx); - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair axdx(rax, rdx); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); - lir::Register tmp(-1); - lir::Register* scratch; + lir::RegisterPair tmp(-1); + lir::RegisterPair* scratch; if (a->low == b->low) { tmp.low = c->client->acquireTemporary(GeneralRegisterMask & ~(1 << rax)); scratch = &tmp; @@ -1003,9 +1003,9 @@ void multiplyRR(Context* c, void compareRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); assertT(c, aSize <= vm::TargetBytesPerWord); @@ -1019,7 +1019,7 @@ void compareCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); assertT(c, vm::TargetBytesPerWord == 8 or aSize == 4); @@ -1035,7 +1035,7 @@ void compareCR(Context* c, c->code.append4(v); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, aSize, &tmp); compareRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -1044,7 +1044,7 @@ void compareCR(Context* c, void compareRM(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, lir::Memory* b) { @@ -1082,7 +1082,7 @@ void compareCM(Context* c, abort(c); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, bSize, &tmp); compareRM(c, bSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -1091,9 +1091,9 @@ void compareCM(Context* c, void compareFloatRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -1192,16 +1192,16 @@ void branchLong(Context* c, void branchRR(Context* c, lir::TernaryOperation op, unsigned size, - lir::Register* a, - lir::Register* b, + lir::RegisterPair* a, + lir::RegisterPair* b, lir::Constant* target) { if (isFloatBranch(op)) { compareFloatRR(c, size, a, size, b); branchFloat(c, op, target); } else if (size > vm::TargetBytesPerWord) { - lir::Register ah(a->high); - lir::Register bh(b->high); + lir::RegisterPair ah(a->high); + lir::RegisterPair bh(b->high); branchLong(c, op, a, &ah, b, &bh, target, CAST2(compareRR)); } else { @@ -1214,7 +1214,7 @@ void branchCR(Context* c, lir::TernaryOperation op, unsigned size, lir::Constant* a, - lir::Register* b, + lir::RegisterPair* b, lir::Constant* target) { assertT(c, not isFloatBranch(op)); @@ -1228,7 +1228,7 @@ void branchCR(Context* c, ResolvedPromise high((v >> 32) & ~static_cast(0)); lir::Constant ah(&high); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); branchLong(c, op, &al, &ah, b, &bh, target, CAST2(compareCR)); } else { @@ -1240,7 +1240,7 @@ void branchCR(Context* c, void branchRM(Context* c, lir::TernaryOperation op, unsigned size, - lir::Register* a, + lir::RegisterPair* a, lir::Memory* b, lir::Constant* target) { @@ -1269,13 +1269,13 @@ void multiplyCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); if (vm::TargetBytesPerWord == 4 and aSize == 8) { const RegisterMask mask = GeneralRegisterMask & ~((1 << rax) | (1 << rdx)); - lir::Register tmp(c->client->acquireTemporary(mask), + lir::RegisterPair tmp(c->client->acquireTemporary(mask), c->client->acquireTemporary(mask)); moveCR(c, aSize, a, aSize, &tmp); @@ -1297,7 +1297,7 @@ void multiplyCR(Context* c, c->code.append4(v); } } else { - lir::Register tmp(c->client->acquireTemporary(GeneralRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(GeneralRegisterMask)); moveCR(c, aSize, a, aSize, &tmp); multiplyRR(c, aSize, &tmp, bSize, b); c->client->releaseTemporary(tmp.low); @@ -1308,9 +1308,9 @@ void multiplyCR(Context* c, void divideRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b UNUSED) + lir::RegisterPair* b UNUSED) { assertT(c, aSize == bSize); @@ -1327,9 +1327,9 @@ void divideRR(Context* c, void remainderRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, aSize == bSize); @@ -1343,28 +1343,28 @@ void remainderRR(Context* c, maybeRex(c, aSize, b, a); opcode(c, 0xf7, 0xf8 + regCode(a)); - lir::Register dx(rdx); + lir::RegisterPair dx(rdx); moveRR(c, vm::TargetBytesPerWord, &dx, vm::TargetBytesPerWord, b); } void doShift(Context* c, UNUSED void (*shift)(Context*, unsigned, - lir::Register*, + lir::RegisterPair*, unsigned, - lir::Register*), + lir::RegisterPair*), int type, UNUSED unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { int64_t v = a->value->value(); if (vm::TargetBytesPerWord == 4 and bSize == 8) { c->client->save(rcx); - lir::Register cx(rcx); + lir::RegisterPair cx(rcx); ResolvedPromise promise(v & 0x3F); lir::Constant masked(&promise); moveCR(c, 4, &masked, 4, &cx); @@ -1384,12 +1384,12 @@ void doShift(Context* c, void shiftLeftRR(Context* c, UNUSED unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { if (vm::TargetBytesPerWord == 4 and bSize == 8) { - lir::Register cx(rcx); + lir::RegisterPair cx(rcx); if (a->low != rcx) { c->client->save(rcx); ResolvedPromise promise(0x3F); @@ -1413,7 +1413,7 @@ void shiftLeftRR(Context* c, opcode(c, 0x7c); // jl c->code.append(2 + 2); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); moveRR(c, 4, b, 4, &bh); // 2 bytes xorRR(c, 4, b, 4, b); // 2 bytes } else { @@ -1428,19 +1428,19 @@ void shiftLeftCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { doShift(c, shiftLeftRR, 0xe0, aSize, a, bSize, b); } void shiftRightRR(Context* c, UNUSED unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { if (vm::TargetBytesPerWord == 4 and bSize == 8) { - lir::Register cx(rcx); + lir::RegisterPair cx(rcx); if (a->low != rcx) { c->client->save(rcx); ResolvedPromise promise(0x3F); @@ -1464,7 +1464,7 @@ void shiftRightRR(Context* c, opcode(c, 0x7c); // jl c->code.append(2 + 3); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); moveRR(c, 4, &bh, 4, b); // 2 bytes // sar 31,high @@ -1482,19 +1482,19 @@ void shiftRightCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { doShift(c, shiftRightRR, 0xf8, aSize, a, bSize, b); } void unsignedShiftRightRR(Context* c, UNUSED unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { if (vm::TargetBytesPerWord == 4 and bSize == 8) { - lir::Register cx(rcx); + lir::RegisterPair cx(rcx); if (a->low != rcx) { c->client->save(rcx); ResolvedPromise promise(0x3F); @@ -1518,7 +1518,7 @@ void unsignedShiftRightRR(Context* c, opcode(c, 0x7c); // jl c->code.append(2 + 2); - lir::Register bh(b->high); + lir::RegisterPair bh(b->high); moveRR(c, 4, &bh, 4, b); // 2 bytes xorRR(c, 4, &bh, 4, &bh); // 2 bytes } else { @@ -1533,16 +1533,16 @@ void unsignedShiftRightCR(Context* c, unsigned aSize UNUSED, lir::Constant* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { doShift(c, unsignedShiftRightRR, 0xe8, aSize, a, bSize, b); } void floatSqrtRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatRegOp(c, aSize, a, 4, b, 0x51); } @@ -1551,16 +1551,16 @@ void floatSqrtMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, aSize, a, 4, b, 0x51); } void floatAddRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatRegOp(c, aSize, a, 4, b, 0x58); } @@ -1569,16 +1569,16 @@ void floatAddMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, aSize, a, 4, b, 0x58); } void floatSubtractRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatRegOp(c, aSize, a, 4, b, 0x5c); } @@ -1587,16 +1587,16 @@ void floatSubtractMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, aSize, a, 4, b, 0x5c); } void floatMultiplyRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatRegOp(c, aSize, a, 4, b, 0x59); } @@ -1605,16 +1605,16 @@ void floatMultiplyMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, aSize, a, 4, b, 0x59); } void floatDivideRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatRegOp(c, aSize, a, 4, b, 0x5e); } @@ -1623,16 +1623,16 @@ void floatDivideMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, aSize, a, 4, b, 0x5e); } void float2FloatRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatRegOp(c, aSize, a, 4, b, 0x5a); } @@ -1641,16 +1641,16 @@ void float2FloatMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, aSize, a, 4, b, 0x5a); } void float2IntRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, not isFloatReg(b)); floatRegOp(c, aSize, a, bSize, b, 0x2c); @@ -1660,16 +1660,16 @@ void float2IntMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, aSize, a, bSize, b, 0x2c); } void int2FloatRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { floatRegOp(c, bSize, a, aSize, b, 0x2a); } @@ -1678,16 +1678,16 @@ void int2FloatMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b) + lir::RegisterPair* b) { floatMemOp(c, bSize, a, aSize, b, 0x2a); } void floatNegateRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, isFloatReg(a) and isFloatReg(b)); // unlike most of the other floating point code, this does NOT @@ -1696,7 +1696,7 @@ void floatNegateRR(Context* c, ResolvedPromise pcon(0x80000000); lir::Constant con(&pcon); if (a->low == b->low) { - lir::Register tmp(c->client->acquireTemporary(FloatRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(FloatRegisterMask)); moveCR(c, 4, &con, 4, &tmp); maybeRex(c, 4, a, &tmp); opcode(c, 0x0f, 0x57); @@ -1714,9 +1714,9 @@ void floatNegateRR(Context* c, void floatAbsoluteRR(Context* c, unsigned aSize UNUSED, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b) + lir::RegisterPair* b) { assertT(c, isFloatReg(a) and isFloatReg(b)); // unlike most of the other floating point code, this does NOT @@ -1725,7 +1725,7 @@ void floatAbsoluteRR(Context* c, ResolvedPromise pcon(0x7fffffff); lir::Constant con(&pcon); if (a->low == b->low) { - lir::Register tmp(c->client->acquireTemporary(FloatRegisterMask)); + lir::RegisterPair tmp(c->client->acquireTemporary(FloatRegisterMask)); moveCR(c, 4, &con, 4, &tmp); maybeRex(c, 4, a, &tmp); opcode(c, 0x0f, 0x54); @@ -1741,12 +1741,12 @@ void floatAbsoluteRR(Context* c, void absoluteRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b UNUSED) + lir::RegisterPair* b UNUSED) { assertT(c, aSize == bSize and a->low == rax and b->low == rax); - lir::Register d(c->client->acquireTemporary(static_cast(1) << rdx)); + lir::RegisterPair d(c->client->acquireTemporary(static_cast(1) << rdx)); maybeRex(c, aSize, a, b); opcode(c, 0x99); xorRR(c, aSize, &d, aSize, a); diff --git a/src/codegen/target/x86/operations.h b/src/codegen/target/x86/operations.h index 80f985f042..1b322788e8 100644 --- a/src/codegen/target/x86/operations.h +++ b/src/codegen/target/x86/operations.h @@ -33,7 +33,7 @@ void callC(Context* c, unsigned size UNUSED, lir::Constant* a); void longCallC(Context* c, unsigned size, lir::Constant* a); -void jumpR(Context* c, unsigned size UNUSED, lir::Register* a); +void jumpR(Context* c, unsigned size UNUSED, lir::RegisterPair* a); void jumpC(Context* c, unsigned size UNUSED, lir::Constant* a); @@ -41,7 +41,7 @@ void jumpM(Context* c, unsigned size UNUSED, lir::Memory* a); void longJumpC(Context* c, unsigned size, lir::Constant* a); -void callR(Context* c, unsigned size UNUSED, lir::Register* a); +void callR(Context* c, unsigned size UNUSED, lir::RegisterPair* a); void callM(Context* c, unsigned size UNUSED, lir::Memory* a); @@ -53,51 +53,51 @@ void alignedJumpC(Context* c, unsigned size, lir::Constant* a); void alignedLongJumpC(Context* c, unsigned size, lir::Constant* a); -void pushR(Context* c, unsigned size, lir::Register* a); +void pushR(Context* c, unsigned size, lir::RegisterPair* a); -void popR(Context* c, unsigned size, lir::Register* a); +void popR(Context* c, unsigned size, lir::RegisterPair* a); -void negateR(Context* c, unsigned size, lir::Register* a); +void negateR(Context* c, unsigned size, lir::RegisterPair* a); void negateRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b UNUSED); + lir::RegisterPair* b UNUSED); void moveCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void moveZCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void swapRR(Context* c, unsigned aSize UNUSED, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void moveRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, UNUSED unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void moveMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void moveRM(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, lir::Memory* b); @@ -105,7 +105,7 @@ void moveAR(Context* c, unsigned aSize, lir::Address* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void moveCM(Context* c, unsigned aSize UNUSED, @@ -115,111 +115,111 @@ void moveCM(Context* c, void moveZRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void moveZMR(Context* c, unsigned aSize UNUSED, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); -void addCarryRR(Context* c, unsigned size, lir::Register* a, lir::Register* b); +void addCarryRR(Context* c, unsigned size, lir::RegisterPair* a, lir::RegisterPair* b); void addRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); -void addCarryCR(Context* c, unsigned size, lir::Constant* a, lir::Register* b); +void addCarryCR(Context* c, unsigned size, lir::Constant* a, lir::RegisterPair* b); void addCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void subtractBorrowCR(Context* c, unsigned size UNUSED, lir::Constant* a, - lir::Register* b); + lir::RegisterPair* b); void subtractCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void subtractBorrowRR(Context* c, unsigned size, - lir::Register* a, - lir::Register* b); + lir::RegisterPair* a, + lir::RegisterPair* b); void subtractRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void andRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void andCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void orRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void orCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void xorRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void xorCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void multiplyRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void compareRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void compareCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void compareRM(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, lir::Memory* b); @@ -231,9 +231,9 @@ void compareCM(Context* c, void compareFloatRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void branchLong(Context* c, lir::TernaryOperation op, @@ -247,21 +247,21 @@ void branchLong(Context* c, void branchRR(Context* c, lir::TernaryOperation op, unsigned size, - lir::Register* a, - lir::Register* b, + lir::RegisterPair* a, + lir::RegisterPair* b, lir::Constant* target); void branchCR(Context* c, lir::TernaryOperation op, unsigned size, lir::Constant* a, - lir::Register* b, + lir::RegisterPair* b, lir::Constant* target); void branchRM(Context* c, lir::TernaryOperation op, unsigned size, - lir::Register* a, + lir::RegisterPair* a, lir::Memory* b, lir::Constant* target); @@ -276,181 +276,181 @@ void multiplyCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void divideRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b UNUSED); + lir::RegisterPair* b UNUSED); void remainderRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void doShift(Context* c, UNUSED void (*shift)(Context*, unsigned, - lir::Register*, + lir::RegisterPair*, unsigned, - lir::Register*), + lir::RegisterPair*), int type, UNUSED unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void shiftLeftRR(Context* c, UNUSED unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void shiftLeftCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void shiftRightRR(Context* c, UNUSED unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void shiftRightCR(Context* c, unsigned aSize, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void unsignedShiftRightRR(Context* c, UNUSED unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void unsignedShiftRightCR(Context* c, unsigned aSize UNUSED, lir::Constant* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void floatSqrtRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatSqrtMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatAddRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatAddMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatSubtractRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatSubtractMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatMultiplyRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatMultiplyMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatDivideRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatDivideMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void float2FloatRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void float2FloatMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void float2IntRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void float2IntMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void int2FloatRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void int2FloatMR(Context* c, unsigned aSize, lir::Memory* a, unsigned bSize, - lir::Register* b); + lir::RegisterPair* b); void floatNegateRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void floatAbsoluteRR(Context* c, unsigned aSize UNUSED, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b); + lir::RegisterPair* b); void absoluteRR(Context* c, unsigned aSize, - lir::Register* a, + lir::RegisterPair* a, unsigned bSize UNUSED, - lir::Register* b UNUSED); + lir::RegisterPair* b UNUSED); } // namespace x86 } // namespace codegen diff --git a/src/compile.cpp b/src/compile.cpp index a3f6e47cae..47b55574e7 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -9783,7 +9783,7 @@ void compileCall(MyThread* t, Context* c, ThunkIndex index, bool call = true) if (processor(t)->bootImage) { lir::Memory table(t->arch->thread(), TARGET_THREAD_THUNKTABLE); - lir::Register scratch(t->arch->scratch()); + lir::RegisterPair scratch(t->arch->scratch()); a->apply(lir::Move, OperandInfo(TargetBytesPerWord, lir::Operand::Type::Memory, &table), OperandInfo(TargetBytesPerWord, lir::Operand::Type::RegisterPair, &scratch)); @@ -9814,14 +9814,14 @@ void compileThunks(MyThread* t, FixedAllocator* allocator) p->thunks.default_.frameSavedOffset = a->length(); - lir::Register thread(t->arch->thread()); + lir::RegisterPair thread(t->arch->thread()); a->pushFrame(1, TargetBytesPerWord, lir::Operand::Type::RegisterPair, &thread); compileCall(t, &context, compileMethodIndex); a->popFrame(t->arch->alignFrameSize(1)); - lir::Register result(t->arch->returnLow()); + lir::RegisterPair result(t->arch->returnLow()); a->apply(lir::Jump, OperandInfo(TargetBytesPerWord, lir::Operand::Type::RegisterPair, &result)); @@ -9835,7 +9835,7 @@ void compileThunks(MyThread* t, FixedAllocator* allocator) Context context(t); avian::codegen::Assembler* a = context.assembler; - lir::Register class_(t->arch->virtualCallTarget()); + lir::RegisterPair class_(t->arch->virtualCallTarget()); lir::Memory virtualCallTargetSrc( t->arch->stack(), (t->arch->frameFooterSize() + t->arch->frameReturnAddressSize()) @@ -9855,7 +9855,7 @@ void compileThunks(MyThread* t, FixedAllocator* allocator) OperandInfo( TargetBytesPerWord, lir::Operand::Type::Memory, &virtualCallTargetDst)); - lir::Register index(t->arch->virtualCallIndex()); + lir::RegisterPair index(t->arch->virtualCallIndex()); lir::Memory virtualCallIndex(t->arch->thread(), TARGET_THREAD_VIRTUALCALLINDEX); @@ -9868,14 +9868,14 @@ void compileThunks(MyThread* t, FixedAllocator* allocator) p->thunks.defaultVirtual.frameSavedOffset = a->length(); - lir::Register thread(t->arch->thread()); + lir::RegisterPair thread(t->arch->thread()); a->pushFrame(1, TargetBytesPerWord, lir::Operand::Type::RegisterPair, &thread); compileCall(t, &context, compileVirtualMethodIndex); a->popFrame(t->arch->alignFrameSize(1)); - lir::Register result(t->arch->returnLow()); + lir::RegisterPair result(t->arch->returnLow()); a->apply(lir::Jump, OperandInfo(TargetBytesPerWord, lir::Operand::Type::RegisterPair, &result)); @@ -9893,7 +9893,7 @@ void compileThunks(MyThread* t, FixedAllocator* allocator) p->thunks.native.frameSavedOffset = a->length(); - lir::Register thread(t->arch->thread()); + lir::RegisterPair thread(t->arch->thread()); a->pushFrame(1, TargetBytesPerWord, lir::Operand::Type::RegisterPair, &thread); compileCall(t, &context, invokeNativeIndex); @@ -9915,7 +9915,7 @@ void compileThunks(MyThread* t, FixedAllocator* allocator) p->thunks.aioob.frameSavedOffset = a->length(); - lir::Register thread(t->arch->thread()); + lir::RegisterPair thread(t->arch->thread()); a->pushFrame(1, TargetBytesPerWord, lir::Operand::Type::RegisterPair, &thread); compileCall(t, &context, throwArrayIndexOutOfBoundsIndex); @@ -9934,7 +9934,7 @@ void compileThunks(MyThread* t, FixedAllocator* allocator) p->thunks.stackOverflow.frameSavedOffset = a->length(); - lir::Register thread(t->arch->thread()); + lir::RegisterPair thread(t->arch->thread()); a->pushFrame(1, TargetBytesPerWord, lir::Operand::Type::RegisterPair, &thread); compileCall(t, &context, throwStackOverflowIndex); @@ -10058,7 +10058,7 @@ uintptr_t compileVirtualThunk(MyThread* t, unsigned index, unsigned* size) avian::codegen::ResolvedPromise indexPromise(index); lir::Constant indexConstant(&indexPromise); - lir::Register indexRegister(t->arch->virtualCallIndex()); + lir::RegisterPair indexRegister(t->arch->virtualCallIndex()); a->apply( lir::Move, OperandInfo(TargetBytesPerWord, lir::Operand::Type::Constant, &indexConstant),