mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
fix moveCM for 64-bit constants on 64-bit machines
This commit is contained in:
parent
f05318b787
commit
51256f3cc2
41
src/x86.cpp
41
src/x86.cpp
@ -648,7 +648,23 @@ moveCM(Context* c, unsigned size, Assembler::Constant* a,
|
||||
{
|
||||
int64_t v = a->value->value();
|
||||
|
||||
if (BytesPerWord == 4 and size == 8) {
|
||||
switch (size) {
|
||||
case 1:
|
||||
encode(c, 0xc6, 0, b, false);
|
||||
c->code.append(a->value->value());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
encode2(c, 0x66c7, 0, b, false);
|
||||
c->code.append2(a->value->value());
|
||||
break;
|
||||
|
||||
case 4:
|
||||
encode(c, 0xc7, 0, b, true);
|
||||
c->code.append4(a->value->value());
|
||||
break;
|
||||
|
||||
case 8: {
|
||||
ResolvedPromise high((v >> 32) & 0xFFFFFFFF);
|
||||
Assembler::Constant ah(&high);
|
||||
|
||||
@ -659,28 +675,9 @@ moveCM(Context* c, unsigned size, Assembler::Constant* a,
|
||||
|
||||
moveCM(c, 4, &al, b);
|
||||
moveCM(c, 4, &ah, &bh);
|
||||
} else if (BytesPerWord == 8 and size == 4) {
|
||||
encode(c, 0xc7, 0, b, false);
|
||||
c->code.append4(a->value->value());
|
||||
} else {
|
||||
switch (size) {
|
||||
case 1:
|
||||
encode(c, 0xc6, 0, b, false);
|
||||
c->code.append(a->value->value());
|
||||
break;
|
||||
} break;
|
||||
|
||||
case 2:
|
||||
encode2(c, 0x66c7, 0, b, false);
|
||||
c->code.append2(a->value->value());
|
||||
break;
|
||||
|
||||
case BytesPerWord:
|
||||
encode(c, 0xc7, 0, b, true);
|
||||
c->code.append4(a->value->value());
|
||||
break;
|
||||
|
||||
default: abort(c);
|
||||
}
|
||||
default: abort(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user