mirror of
https://github.com/corda/corda.git
synced 2025-06-20 16:10:26 +00:00
fix zero-extension of constants in x86 compiler
scalac may emit a ldc followed by an i2c, whereas javac does the conversion (including zero extension if necessary) at compile time. This commit ensures we handle the i2c case properly.
This commit is contained in:
@ -226,6 +226,19 @@ void moveCR(Context* c, unsigned aSize, lir::Constant* a,
|
||||
}
|
||||
}
|
||||
|
||||
void moveZCR(Context* c, unsigned aSize UNUSED, lir::Constant* a,
|
||||
unsigned bSize UNUSED, lir::Register* b)
|
||||
{
|
||||
assert(c, not isFloatReg(b));
|
||||
assert(c, aSize == 2);
|
||||
assert(c, bSize == vm::TargetBytesPerWord);
|
||||
assert(c, a->value->resolved());
|
||||
|
||||
maybeRex(c, vm::TargetBytesPerWord, b);
|
||||
opcode(c, 0xb8 + regCode(b));
|
||||
c->code.appendTargetAddress(static_cast<uint16_t>(a->value->value()));
|
||||
}
|
||||
|
||||
void swapRR(Context* c, unsigned aSize UNUSED, lir::Register* a,
|
||||
unsigned bSize UNUSED, lir::Register* b)
|
||||
{
|
||||
|
Reference in New Issue
Block a user