Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Apr 18, 2024
1 parent b331b8a commit f509161
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ void MacroAssembler::super_call_VM_leaf(address entry_point, Register arg_0, Reg

void MacroAssembler::la(Register Rd, const address addr) {
int64_t offset = addr - pc();
if (is_valid_auipc_offset(offset)) {
if (is_valid_32bit_offset(offset)) {
auipc(Rd, (int32_t)offset + 0x800); //0x800, Note:the 11th sign bit
addi(Rd, Rd, ((int64_t)offset << 52) >> 52);
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ class MacroAssembler: public Assembler {
int pop_v(unsigned int bitset, Register stack);
#endif // COMPILER2

bool is_valid_auipc_offset(int64_t x) {
bool is_valid_32bit_offset(int64_t x) {
constexpr int64_t twoG = (2 * G);
constexpr int64_t twoK = (2 * K);
return x < (twoG - twoK) && x >= (-twoG - twoK);
Expand Down Expand Up @@ -839,7 +839,7 @@ class MacroAssembler: public Assembler {
void NAME(Register Rd, address dest) { \
assert_cond(dest != nullptr); \
int64_t distance = dest - pc(); \
if (is_valid_auipc_offset(distance)) { \
if (is_valid_32bit_offset(distance)) { \
auipc(Rd, (int32_t)distance + 0x800); \
Assembler::NAME(Rd, Rd, ((int32_t)distance << 20) >> 20); \
} else { \
Expand Down Expand Up @@ -896,7 +896,7 @@ class MacroAssembler: public Assembler {
void NAME(FloatRegister Rd, address dest, Register temp = t0) { \
assert_cond(dest != nullptr); \
int64_t distance = dest - pc(); \
if (is_valid_auipc_offset(distance)) { \
if (is_valid_32bit_offset(distance)) { \
auipc(temp, (int32_t)distance + 0x800); \
Assembler::NAME(Rd, temp, ((int32_t)distance << 20) >> 20); \
} else { \
Expand Down Expand Up @@ -957,7 +957,7 @@ class MacroAssembler: public Assembler {
assert_cond(dest != nullptr); \
assert_different_registers(Rs, temp); \
int64_t distance = dest - pc(); \
if (is_valid_auipc_offset(distance)) { \
if (is_valid_32bit_offset(distance)) { \
auipc(temp, (int32_t)distance + 0x800); \
Assembler::NAME(Rs, temp, ((int32_t)distance << 20) >> 20); \
} else { \
Expand Down Expand Up @@ -1002,7 +1002,7 @@ class MacroAssembler: public Assembler {
void NAME(FloatRegister Rs, address dest, Register temp = t0) { \
assert_cond(dest != nullptr); \
int64_t distance = dest - pc(); \
if (is_valid_auipc_offset(distance)) { \
if (is_valid_32bit_offset(distance)) { \
auipc(temp, (int32_t)distance + 0x800); \
Assembler::NAME(Rs, temp, ((int32_t)distance << 20) >> 20); \
} else { \
Expand Down

0 comments on commit f509161

Please sign in to comment.