8255838: Use 32-bit immediate movslq in macro assembler if 64-bit value fits in 32 bits on x86_64

Reviewed-by: azeemj, kvn, redestad, thartmann
This commit is contained in:
Jorn Vernee 2020-11-04 18:10:23 +00:00
parent 94ace035a5
commit 160759ceef

View File

@ -714,8 +714,12 @@ void MacroAssembler::movptr(Register dst, ArrayAddress src) {
// src should NEVER be a real pointer. Use AddressLiteral for true pointers
void MacroAssembler::movptr(Address dst, intptr_t src) {
mov64(rscratch1, src);
movq(dst, rscratch1);
if (is_simm32(src)) {
movptr(dst, checked_cast<int32_t>(src));
} else {
mov64(rscratch1, src);
movq(dst, rscratch1);
}
}
// These are mostly for initializing NULL