mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-09 07:35:49 +00:00
8379231: Assembler::mov64 always emits 10-byte movabs even for small immediates
Reviewed-by: qamai, dlong
This commit is contained in:
parent
7e5acdc6fa
commit
b159addb80
@ -961,7 +961,7 @@ void MacroAssembler::call(AddressLiteral entry, Register rscratch) {
|
||||
void MacroAssembler::ic_call(address entry, jint method_index) {
|
||||
RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index);
|
||||
// Needs full 64-bit immediate for later patching.
|
||||
mov64(rax, (int64_t)Universe::non_oop_word());
|
||||
Assembler::mov64(rax, (int64_t)Universe::non_oop_word());
|
||||
call(AddressLiteral(entry, rh));
|
||||
}
|
||||
|
||||
@ -1961,6 +1961,20 @@ void MacroAssembler::movflt(XMMRegister dst, AddressLiteral src, Register rscrat
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::mov64(Register dst, int64_t imm64) {
|
||||
if (is_uimm32(imm64)) {
|
||||
movl(dst, checked_cast<uint32_t>(imm64));
|
||||
} else if (is_simm32(imm64)) {
|
||||
movq(dst, checked_cast<int32_t>(imm64));
|
||||
} else {
|
||||
Assembler::mov64(dst, imm64);
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::mov64(Register dst, int64_t imm64, relocInfo::relocType rtype, int format) {
|
||||
Assembler::mov64(dst, imm64, rtype, format);
|
||||
}
|
||||
|
||||
void MacroAssembler::movptr(Register dst, Register src) {
|
||||
movq(dst, src);
|
||||
}
|
||||
@ -1971,13 +1985,7 @@ 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) {
|
||||
if (is_uimm32(src)) {
|
||||
movl(dst, checked_cast<uint32_t>(src));
|
||||
} else if (is_simm32(src)) {
|
||||
movq(dst, checked_cast<int32_t>(src));
|
||||
} else {
|
||||
mov64(dst, src);
|
||||
}
|
||||
mov64(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::movptr(Address dst, Register src) {
|
||||
|
||||
@ -1869,6 +1869,9 @@ public:
|
||||
void mov_metadata(Register dst, Metadata* obj);
|
||||
void mov_metadata(Address dst, Metadata* obj, Register rscratch);
|
||||
|
||||
void mov64(Register dst, int64_t imm64);
|
||||
void mov64(Register dst, int64_t imm64, relocInfo::relocType rtype, int format);
|
||||
|
||||
void movptr(Register dst, Register src);
|
||||
void movptr(Register dst, Address src);
|
||||
void movptr(Register dst, AddressLiteral src);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user