mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +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:
parent
f38c4e25c6
commit
d8729a7a8d
@ -107,7 +107,7 @@ void populateTables(ArchitectureContext* c) {
|
||||
|
||||
bo[index(c, lir::MoveZ, R, R)] = CAST2(moveZRR);
|
||||
bo[index(c, lir::MoveZ, M, R)] = CAST2(moveZMR);
|
||||
bo[index(c, lir::MoveZ, C, R)] = CAST2(moveCR);
|
||||
bo[index(c, lir::MoveZ, C, R)] = CAST2(moveZCR);
|
||||
|
||||
bo[index(c, lir::Add, R, R)] = CAST2(addRR);
|
||||
bo[index(c, lir::Add, C, R)] = CAST2(addCR);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -65,6 +65,9 @@ void negateRR(Context* c, unsigned aSize, lir::Register* a,
|
||||
void moveCR(Context* c, unsigned aSize, lir::Constant* a,
|
||||
unsigned bSize, lir::Register* b);
|
||||
|
||||
void moveZCR(Context* c, unsigned aSize, lir::Constant* a,
|
||||
unsigned bSize, lir::Register* b);
|
||||
|
||||
void swapRR(Context* c, unsigned aSize UNUSED, lir::Register* a,
|
||||
unsigned bSize UNUSED, lir::Register* b);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user