Skip to content

Commit fa28fbd

Browse files
committed
Backport 38bb8adf4f632b08af15f2d8530b35f05f86a020
1 parent 626cb3b commit fa28fbd

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/hotspot/cpu/aarch64/assembler_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ void Assembler::add_sub_immediate(Register Rd, Register Rn, unsigned uimm, int o
17021702
}
17031703

17041704
bool Assembler::operand_valid_for_add_sub_immediate(int64_t imm) {
1705-
uint64_t uimm = (uint64_t)uabs((jlong)imm);
1705+
uint64_t uimm = (uint64_t)g_uabs((jlong)imm);
17061706
if (uimm < (1 << 12))
17071707
return true;
17081708
if (uimm < (1 << 24)

src/hotspot/cpu/aarch64/assembler_aarch64.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ class Assembler : public AbstractAssembler {
854854
static const uint64_t branch_range = NOT_DEBUG(128 * M) DEBUG_ONLY(2 * M);
855855

856856
static bool reachable_from_branch_at(address branch, address target) {
857-
return uabs(target - branch) < branch_range;
857+
return g_uabs(target - branch) < branch_range;
858858
}
859859

860860
// Unconditional branch (immediate)

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2206,7 +2206,7 @@ void MacroAssembler::wrap_add_sub_imm_insn(Register Rd, Register Rn, unsigned im
22062206
if (operand_valid_for_add_sub_immediate((int)imm)) {
22072207
(this->*insn1)(Rd, Rn, imm);
22082208
} else {
2209-
if (uabs(imm) < (1 << 24)) {
2209+
if (g_uabs(imm) < (1 << 24)) {
22102210
(this->*insn1)(Rd, Rn, imm & -(1 << 12));
22112211
(this->*insn1)(Rd, Rd, imm & ((1 << 12)-1));
22122212
} else {

src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ class StubGenerator: public StubCodeGenerator {
10091009

10101010
void copy_memory_small(Register s, Register d, Register count, Register tmp, int step) {
10111011
bool is_backwards = step < 0;
1012-
size_t granularity = uabs(step);
1012+
size_t granularity = g_uabs(step);
10131013
int direction = is_backwards ? -1 : 1;
10141014
int unit = wordSize * direction;
10151015

@@ -1065,7 +1065,7 @@ class StubGenerator: public StubCodeGenerator {
10651065
Register count, Register tmp, int step) {
10661066
copy_direction direction = step < 0 ? copy_backwards : copy_forwards;
10671067
bool is_backwards = step < 0;
1068-
unsigned int granularity = uabs(step);
1068+
unsigned int granularity = g_uabs(step);
10691069
const Register t0 = r3, t1 = r4;
10701070

10711071
// <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always

src/hotspot/share/opto/mulnode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Node *MulINode::Ideal(PhaseGVN *phase, bool can_reshape) {
194194
// Check for negative constant; if so negate the final result
195195
bool sign_flip = false;
196196

197-
unsigned int abs_con = uabs(con);
197+
unsigned int abs_con = g_uabs(con);
198198
if (abs_con != (unsigned int)con) {
199199
sign_flip = true;
200200
}
@@ -290,7 +290,7 @@ Node *MulLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
290290

291291
// Check for negative constant; if so negate the final result
292292
bool sign_flip = false;
293-
julong abs_con = uabs(con);
293+
julong abs_con = g_uabs(con);
294294
if (abs_con != (julong)con) {
295295
sign_flip = true;
296296
}

src/hotspot/share/utilities/globalDefinitions.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ inline bool is_even(intx x) { return !is_odd(x); }
11661166

11671167
// abs methods which cannot overflow and so are well-defined across
11681168
// the entire domain of integer types.
1169-
static inline unsigned int uabs(unsigned int n) {
1169+
static inline unsigned int g_uabs(unsigned int n) {
11701170
union {
11711171
unsigned int result;
11721172
int value;
@@ -1175,7 +1175,7 @@ static inline unsigned int uabs(unsigned int n) {
11751175
if (value < 0) result = 0-result;
11761176
return result;
11771177
}
1178-
static inline julong uabs(julong n) {
1178+
static inline julong g_uabs(julong n) {
11791179
union {
11801180
julong result;
11811181
jlong value;
@@ -1184,8 +1184,8 @@ static inline julong uabs(julong n) {
11841184
if (value < 0) result = 0-result;
11851185
return result;
11861186
}
1187-
static inline julong uabs(jlong n) { return uabs((julong)n); }
1188-
static inline unsigned int uabs(int n) { return uabs((unsigned int)n); }
1187+
static inline julong g_uabs(jlong n) { return g_uabs((julong)n); }
1188+
static inline unsigned int g_uabs(int n) { return g_uabs((unsigned int)n); }
11891189

11901190
// "to" should be greater than "from."
11911191
inline intx byte_size(void* from, void* to) {

0 commit comments

Comments
 (0)