Skip to content

Commit 23f022b

Browse files
author
Daniel D. Daugherty
committedApr 29, 2022
8285945: [BACKOUT] JDK-8285802 AArch64: Consistently handle offsets in MacroAssembler as 64-bit quantities
Reviewed-by: kvn
1 parent 116763c commit 23f022b

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed
 

‎src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -2192,35 +2192,35 @@ void MacroAssembler::unimplemented(const char* what) {
21922192

21932193
// If a constant does not fit in an immediate field, generate some
21942194
// number of MOV instructions and then perform the operation.
2195-
void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t imm,
2195+
void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm,
21962196
add_sub_imm_insn insn1,
21972197
add_sub_reg_insn insn2) {
21982198
assert(Rd != zr, "Rd = zr and not setting flags?");
2199-
if (operand_valid_for_add_sub_immediate(imm)) {
2199+
if (operand_valid_for_add_sub_immediate((int)imm)) {
22002200
(this->*insn1)(Rd, Rn, imm);
22012201
} else {
22022202
if (uabs(imm) < (1 << 24)) {
22032203
(this->*insn1)(Rd, Rn, imm & -(1 << 12));
22042204
(this->*insn1)(Rd, Rd, imm & ((1 << 12)-1));
22052205
} else {
22062206
assert_different_registers(Rd, Rn);
2207-
mov(Rd, imm);
2207+
mov(Rd, (uint64_t)imm);
22082208
(this->*insn2)(Rd, Rn, Rd, LSL, 0);
22092209
}
22102210
}
22112211
}
22122212

22132213
// Separate vsn which sets the flags. Optimisations are more restricted
22142214
// because we must set the flags correctly.
2215-
void MacroAssembler::wrap_adds_subs_imm_insn(Register Rd, Register Rn, uint64_t imm,
2215+
void MacroAssembler::wrap_adds_subs_imm_insn(Register Rd, Register Rn, unsigned imm,
22162216
add_sub_imm_insn insn1,
22172217
add_sub_reg_insn insn2) {
2218-
if (operand_valid_for_add_sub_immediate(imm)) {
2218+
if (operand_valid_for_add_sub_immediate((int)imm)) {
22192219
(this->*insn1)(Rd, Rn, imm);
22202220
} else {
22212221
assert_different_registers(Rd, Rn);
22222222
assert(Rd != zr, "overflow in immediate operand");
2223-
mov(Rd, imm);
2223+
mov(Rd, (uint64_t)imm);
22242224
(this->*insn2)(Rd, Rn, Rd, LSL, 0);
22252225
}
22262226
}

‎src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class MacroAssembler: public Assembler {
212212

213213
inline void movw(Register Rd, Register Rn) {
214214
if (Rd == sp || Rn == sp) {
215-
Assembler::addw(Rd, Rn, 0U);
215+
addw(Rd, Rn, 0U);
216216
} else {
217217
orrw(Rd, zr, Rn);
218218
}
@@ -221,7 +221,7 @@ class MacroAssembler: public Assembler {
221221
assert(Rd != r31_sp && Rn != r31_sp, "should be");
222222
if (Rd == Rn) {
223223
} else if (Rd == sp || Rn == sp) {
224-
Assembler::add(Rd, Rn, 0U);
224+
add(Rd, Rn, 0U);
225225
} else {
226226
orr(Rd, zr, Rn);
227227
}
@@ -1144,16 +1144,16 @@ class MacroAssembler: public Assembler {
11441144

11451145
// If a constant does not fit in an immediate field, generate some
11461146
// number of MOV instructions and then perform the operation
1147-
void wrap_add_sub_imm_insn(Register Rd, Register Rn, uint64_t imm,
1147+
void wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned imm,
11481148
add_sub_imm_insn insn1,
11491149
add_sub_reg_insn insn2);
11501150
// Separate vsn which sets the flags
1151-
void wrap_adds_subs_imm_insn(Register Rd, Register Rn, uint64_t imm,
1151+
void wrap_adds_subs_imm_insn(Register Rd, Register Rn, unsigned imm,
11521152
add_sub_imm_insn insn1,
11531153
add_sub_reg_insn insn2);
11541154

11551155
#define WRAP(INSN) \
1156-
void INSN(Register Rd, Register Rn, uint64_t imm) { \
1156+
void INSN(Register Rd, Register Rn, unsigned imm) { \
11571157
wrap_add_sub_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN); \
11581158
} \
11591159
\
@@ -1175,7 +1175,7 @@ class MacroAssembler: public Assembler {
11751175

11761176
#undef WRAP
11771177
#define WRAP(INSN) \
1178-
void INSN(Register Rd, Register Rn, uint64_t imm) { \
1178+
void INSN(Register Rd, Register Rn, unsigned imm) { \
11791179
wrap_adds_subs_imm_insn(Rd, Rn, imm, &Assembler::INSN, &Assembler::INSN); \
11801180
} \
11811181
\

‎src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6521,7 +6521,7 @@ class StubGenerator: public StubCodeGenerator {
65216521
assert(is_even(framesize/2), "sp not 16-byte aligned");
65226522

65236523
// lr and fp are already in place
6524-
__ sub(sp, rfp, ((uint64_t)framesize-4) << LogBytesPerInt); // prolog
6524+
__ sub(sp, rfp, ((unsigned)framesize-4) << LogBytesPerInt); // prolog
65256525

65266526
int frame_complete = __ pc() - start;
65276527

0 commit comments

Comments
 (0)
Please sign in to comment.