mirror of
https://github.com/corda/corda.git
synced 2025-01-23 12:58:35 +00:00
handle overlap cases in moveRR
This commit is contained in:
parent
5fc9ad058b
commit
81d532c4f0
33
src/x86.cpp
33
src/x86.cpp
@ -642,6 +642,18 @@ negateRR(Context* c, unsigned aSize, Assembler::Register* a,
|
||||
negateR(c, aSize, a);
|
||||
}
|
||||
|
||||
void
|
||||
swapRR(Context* c, unsigned aSize UNUSED, Assembler::Register* a,
|
||||
unsigned bSize UNUSED, Assembler::Register* b)
|
||||
{
|
||||
assert(c, aSize == bSize);
|
||||
assert(c, aSize == BytesPerWord);
|
||||
|
||||
rex(c);
|
||||
c->code.append(0x87);
|
||||
c->code.append(0xc0 | (b->low << 3) | a->low);
|
||||
}
|
||||
|
||||
void
|
||||
moveRR(Context* c, unsigned aSize, Assembler::Register* a,
|
||||
unsigned bSize, Assembler::Register* b)
|
||||
@ -650,8 +662,17 @@ moveRR(Context* c, unsigned aSize, Assembler::Register* a,
|
||||
Assembler::Register ah(a->high);
|
||||
Assembler::Register bh(b->high);
|
||||
|
||||
if (a->high == b->low) {
|
||||
if (a->low == b->high) {
|
||||
swapRR(c, 4, a, 4, b);
|
||||
} else {
|
||||
moveRR(c, 4, &ah, 4, &bh);
|
||||
moveRR(c, 4, a, 4, b);
|
||||
}
|
||||
} else {
|
||||
moveRR(c, 4, a, 4, b);
|
||||
moveRR(c, 4, &ah, 4, &bh);
|
||||
}
|
||||
} else {
|
||||
switch (aSize) {
|
||||
case 1:
|
||||
@ -937,18 +958,6 @@ moveZMR(Context* c, unsigned aSize UNUSED, Assembler::Memory* a,
|
||||
encode2(c, 0x0fb7, b->low, a, true);
|
||||
}
|
||||
|
||||
void
|
||||
swapRR(Context* c, unsigned aSize UNUSED, Assembler::Register* a,
|
||||
unsigned bSize UNUSED, Assembler::Register* b)
|
||||
{
|
||||
assert(c, aSize == bSize);
|
||||
assert(c, aSize == BytesPerWord);
|
||||
|
||||
rex(c);
|
||||
c->code.append(0x87);
|
||||
c->code.append(0xc0 | (b->low << 3) | a->low);
|
||||
}
|
||||
|
||||
void
|
||||
compareRR(Context* c, unsigned aSize, Assembler::Register* a,
|
||||
unsigned bSize UNUSED, Assembler::Register* b)
|
||||
|
Loading…
Reference in New Issue
Block a user