8285802: AArch64: Consistently handle offsets in MacroAssembler as 64-bit quantities
Reviewed-by: ngasson, adinn
This commit is contained in:
parent
694556e137
commit
df4d5cf5f5
@ -2192,11 +2192,11 @@ void MacroAssembler::unimplemented(const char* what) {
|
||||
|
||||
// If a constant does not fit in an immediate field, generate some
|
||||
// number of MOV instructions and then perform the operation.
|
||||
void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm,
|
||||
void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t imm,
|
||||
add_sub_imm_insn insn1,
|
||||
add_sub_reg_insn insn2) {
|
||||
assert(Rd != zr, "Rd = zr and not setting flags?");
|
||||
if (operand_valid_for_add_sub_immediate((int)imm)) {
|
||||
if (operand_valid_for_add_sub_immediate(imm)) {
|
||||
(this->*insn1)(Rd, Rn, imm);
|
||||
} else {
|
||||
if (uabs(imm) < (1 << 24)) {
|
||||
@ -2204,7 +2204,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned im
|
||||
(this->*insn1)(Rd, Rd, imm & ((1 << 12)-1));
|
||||
} else {
|
||||
assert_different_registers(Rd, Rn);
|
||||
mov(Rd, (uint64_t)imm);
|
||||
mov(Rd, imm);
|
||||
(this->*insn2)(Rd, Rn, Rd, LSL, 0);
|
||||
}
|
||||
}
|
||||
@ -2212,15 +2212,15 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned im
|
||||
|
||||
// Separate vsn which sets the flags. Optimisations are more restricted
|
||||
// because we must set the flags correctly.
|
||||
void MacroAssembler::wrap_adds_subs_imm_insn(Register Rd, Register Rn, unsigned imm,
|
||||
void MacroAssembler::wrap_adds_subs_imm_insn(Register Rd, Register Rn, uint64_t imm,
|
||||
add_sub_imm_insn insn1,
|
||||
add_sub_reg_insn insn2) {
|
||||
if (operand_valid_for_add_sub_immediate((int)imm)) {
|
||||
if (operand_valid_for_add_sub_immediate(imm)) {
|
||||
(this->*insn1)(Rd, Rn, imm);
|
||||
} else {
|
||||
assert_different_registers(Rd, Rn);
|
||||
assert(Rd != zr, "overflow in immediate operand");
|
||||
mov(Rd, (uint64_t)imm);
|
||||
mov(Rd, imm);
|
||||
(this->*insn2)(Rd, Rn, Rd, LSL, 0);
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ class MacroAssembler: public Assembler {
|
||||
|
||||
inline void movw(Register Rd, Register Rn) {
|
||||
if (Rd == sp || Rn == sp) {
|
||||
addw(Rd, Rn, 0U);
|
||||
Assembler::addw(Rd, Rn, 0U);
|
||||
} else {
|
||||
orrw(Rd, zr, Rn);
|
||||
}
|
||||
@ -221,7 +221,7 @@ class MacroAssembler: public Assembler {
|
||||
assert(Rd != r31_sp && Rn != r31_sp, "should be");
|
||||
if (Rd == Rn) {
|
||||
} else if (Rd == sp || Rn == sp) {
|
||||
add(Rd, Rn, 0U);
|
||||
Assembler::add(Rd, Rn, 0U);
|
||||
} else {
|
||||
orr(Rd, zr, Rn);
|
||||
}
|
||||
@ -1144,16 +1144,16 @@ public:
|
||||
|
||||
// If a constant does not fit in an immediate field, generate some
|
||||
// number of MOV instructions and then perform the operation
|
||||
void wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm,
|
||||
void wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t imm,
|
||||
add_sub_imm_insn insn1,
|
||||
add_sub_reg_insn insn2);
|
||||
// Separate vsn which sets the flags
|
||||
void wrap_adds_subs_imm_insn(Register Rd, Register Rn, unsigned imm,
|
||||
void wrap_adds_subs_imm_insn(Register Rd, Register Rn, uint64_t imm,
|
||||
add_sub_imm_insn insn1,
|
||||
add_sub_reg_insn insn2);
|
||||
|
||||
#define WRAP(INSN) \
|
||||
void INSN(Register Rd, Register Rn, unsigned imm) { \
|
||||
void INSN(Register Rd, Register Rn, uint64_t imm) { \
|
||||
wrap_add_sub_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN); \
|
||||
} \
|
||||
\
|
||||
@ -1175,7 +1175,7 @@ public:
|
||||
|
||||
#undef WRAP
|
||||
#define WRAP(INSN) \
|
||||
void INSN(Register Rd, Register Rn, unsigned imm) { \
|
||||
void INSN(Register Rd, Register Rn, uint64_t imm) { \
|
||||
wrap_adds_subs_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN); \
|
||||
} \
|
||||
\
|
||||
|
@ -6521,7 +6521,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
assert(is_even(framesize/2), "sp not 16-byte aligned");
|
||||
|
||||
// lr and fp are already in place
|
||||
__ sub(sp, rfp, ((unsigned)framesize-4) << LogBytesPerInt); // prolog
|
||||
__ sub(sp, rfp, ((uint64_t)framesize-4) << LogBytesPerInt); // prolog
|
||||
|
||||
int frame_complete = __ pc() - start;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user