diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 88296656485..ba4b089c7aa 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -2568,7 +2568,9 @@ void MacroAssembler::movptr(Register dst, Address src) { // src should NEVER be a real pointer. Use AddressLiteral for true pointers void MacroAssembler::movptr(Register dst, intptr_t src) { #ifdef _LP64 - if (is_simm32(src)) { + if (is_uimm32(src)) { + movl(dst, checked_cast(src)); + } else if (is_simm32(src)) { movq(dst, checked_cast(src)); } else { mov64(dst, src); diff --git a/src/hotspot/share/asm/assembler.hpp b/src/hotspot/share/asm/assembler.hpp index 7b7dbd4ede7..a533b963844 100644 --- a/src/hotspot/share/asm/assembler.hpp +++ b/src/hotspot/share/asm/assembler.hpp @@ -359,6 +359,7 @@ class AbstractAssembler : public ResourceObj { } static bool is_uimm12(uint64_t x) { return is_uimm(x, 12); } + static bool is_uimm32(uint64_t x) { return is_uimm(x, 32); } // Accessors CodeSection* code_section() const { return _code_section; }