Skip to content

Commit 160759c

Browse files
committed
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
1 parent 94ace03 commit 160759c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,12 @@ void MacroAssembler::movptr(Register dst, ArrayAddress src) {
714714

715715
// src should NEVER be a real pointer. Use AddressLiteral for true pointers
716716
void MacroAssembler::movptr(Address dst, intptr_t src) {
717-
mov64(rscratch1, src);
718-
movq(dst, rscratch1);
717+
if (is_simm32(src)) {
718+
movptr(dst, checked_cast<int32_t>(src));
719+
} else {
720+
mov64(rscratch1, src);
721+
movq(dst, rscratch1);
722+
}
719723
}
720724

721725
// These are mostly for initializing NULL

0 commit comments

Comments
 (0)