Skip to content

Commit e7d712c

Browse files
feilongjiangRealFYang
authored andcommitted
8278531: riscv: Remove duplicate code bitset_to_fregs
Reviewed-by: fyang
1 parent f29745d commit e7d712c

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ void MacroAssembler::pop_reg(Register Rd)
955955
int MacroAssembler::bitset_to_regs(unsigned int bitset, unsigned char* regs) {
956956
int count = 0;
957957
// Scan bitset to accumulate register pairs
958-
for (int reg = 31; reg >= 0; reg --) {
958+
for (int reg = 31; reg >= 0; reg--) {
959959
if ((1U << 31) & bitset) {
960960
regs[count++] = reg;
961961
}
@@ -1008,25 +1008,12 @@ int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
10081008
return count;
10091009
}
10101010

1011-
int MacroAssembler::bitset_to_fregs(unsigned int bitset, unsigned char* regs) {
1012-
int count = 0;
1013-
// Scan bitset to accumulate register pairs
1014-
for (int reg = 31; reg >= 0; reg--) {
1015-
if ((1U << 31) & bitset) {
1016-
regs[count++] = reg;
1017-
}
1018-
bitset <<= 1;
1019-
}
1020-
1021-
return count;
1022-
}
1023-
10241011
// Push float registers in the bitset, except sp.
10251012
// Return the number of heapwords pushed.
10261013
int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
10271014
int words_pushed = 0;
10281015
unsigned char regs[32];
1029-
int count = bitset_to_fregs(bitset, regs);
1016+
int count = bitset_to_regs(bitset, regs);
10301017
int push_slots = count + (count & 1);
10311018

10321019
if (count) {
@@ -1045,7 +1032,7 @@ int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
10451032
int MacroAssembler::pop_fp(unsigned int bitset, Register stack) {
10461033
int words_popped = 0;
10471034
unsigned char regs[32];
1048-
int count = bitset_to_fregs(bitset, regs);
1035+
int count = bitset_to_regs(bitset, regs);
10491036
int pop_slots = count + (count & 1);
10501037

10511038
for (int i = count - 1; i >= 0; i--) {

src/hotspot/cpu/riscv/macroAssembler_riscv.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ class MacroAssembler: public Assembler {
796796
}
797797
}
798798

799-
int bitset_to_fregs(unsigned int bitset, unsigned char* regs);
800799
int bitset_to_regs(unsigned int bitset, unsigned char* regs);
801800
Address add_memory_helper(const Address dst);
802801

0 commit comments

Comments
 (0)