mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
support 64-bit operands on 32-bit systems in compareCR
This commit is contained in:
parent
a07a189ddb
commit
7791b1df80
22
src/x86.cpp
22
src/x86.cpp
@ -1563,10 +1563,27 @@ void
|
||||
compareCR(Context* c, unsigned size UNUSED, Assembler::Constant* a,
|
||||
Assembler::Register* b)
|
||||
{
|
||||
assert(c, BytesPerWord == 8 or size == 4);
|
||||
|
||||
int64_t v = a->value->value();
|
||||
|
||||
if (BytesPerWord == 4 and size == 8) {
|
||||
ResolvedPromise low(v & 0xFFFFFFFF);
|
||||
Assembler::Constant al(&low);
|
||||
|
||||
ResolvedPromise high((v >> 32) & 0xFFFFFFFF);
|
||||
Assembler::Constant ah(&high);
|
||||
|
||||
Assembler::Register bh(b->high);
|
||||
|
||||
compareCR(c, 4, &ah, &bh);
|
||||
|
||||
// if the high order bits are equal, we compare the low order
|
||||
// bits; otherwise, we jump past that comparison
|
||||
c->code.append(0x0f);
|
||||
c->code.append(0x85); // jne
|
||||
c->code.append4(2);
|
||||
|
||||
compareCR(c, 4, &al, b);
|
||||
} else {
|
||||
if (isInt32(v)) {
|
||||
if (size == 8) rex(c);
|
||||
if (isInt8(v)) {
|
||||
@ -1585,6 +1602,7 @@ compareCR(Context* c, unsigned size UNUSED, Assembler::Constant* a,
|
||||
c->client->releaseTemporary(tmp.low);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
compareCM(Context* c, unsigned size, Assembler::Constant* a,
|
||||
|
Loading…
Reference in New Issue
Block a user