Skip to content

Commit ce8866d

Browse files
committed
Cover most RVC instructions by using CompressibleRegion to cover minimal functions in C2
1 parent 4254d3e commit ce8866d

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ int MacroAssembler::bitset_to_regs(unsigned int bitset, unsigned char* regs) {
962962
// Return the number of words pushed
963963
int MacroAssembler::push_reg(unsigned int bitset, Register stack) {
964964
DEBUG_ONLY(int words_pushed = 0;)
965+
CompressibleRegion cr(this);
965966

966967
unsigned char regs[32];
967968
int count = bitset_to_regs(bitset, regs);
@@ -983,6 +984,7 @@ int MacroAssembler::push_reg(unsigned int bitset, Register stack) {
983984

984985
int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
985986
DEBUG_ONLY(int words_popped = 0;)
987+
CompressibleRegion cr(this);
986988

987989
unsigned char regs[32];
988990
int count = bitset_to_regs(bitset, regs);
@@ -1005,6 +1007,7 @@ int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
10051007
// Push float registers in the bitset, except sp.
10061008
// Return the number of heapwords pushed.
10071009
int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
1010+
CompressibleRegion cr(this);
10081011
int words_pushed = 0;
10091012
unsigned char regs[32];
10101013
int count = bitset_to_regs(bitset, regs);
@@ -1024,6 +1027,7 @@ int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
10241027
}
10251028

10261029
int MacroAssembler::pop_fp(unsigned int bitset, Register stack) {
1030+
CompressibleRegion cr(this);
10271031
int words_popped = 0;
10281032
unsigned char regs[32];
10291033
int count = bitset_to_regs(bitset, regs);
@@ -1044,6 +1048,7 @@ int MacroAssembler::pop_fp(unsigned int bitset, Register stack) {
10441048

10451049
#ifdef COMPILER2
10461050
int MacroAssembler::push_vp(unsigned int bitset, Register stack) {
1051+
CompressibleRegion cr(this);
10471052
int vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
10481053

10491054
// Scan bitset to accumulate register pairs
@@ -1065,6 +1070,7 @@ int MacroAssembler::push_vp(unsigned int bitset, Register stack) {
10651070
}
10661071

10671072
int MacroAssembler::pop_vp(unsigned int bitset, Register stack) {
1073+
CompressibleRegion cr(this);
10681074
int vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
10691075

10701076
// Scan bitset to accumulate register pairs
@@ -1087,6 +1093,7 @@ int MacroAssembler::pop_vp(unsigned int bitset, Register stack) {
10871093
#endif // COMPILER2
10881094

10891095
void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
1096+
CompressibleRegion cr(this);
10901097
// Push integer registers x7, x10-x17, x28-x31.
10911098
push_reg(RegSet::of(x7) + RegSet::range(x10, x17) + RegSet::range(x28, x31) - exclude, sp);
10921099

@@ -1101,6 +1108,7 @@ void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
11011108
}
11021109

11031110
void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
1111+
CompressibleRegion cr(this);
11041112
int offset = 0;
11051113
for (int i = 0; i < 32; i++) {
11061114
if (i <= f7->encoding() || i >= f28->encoding() || (i >= f10->encoding() && i <= f17->encoding())) {
@@ -1114,15 +1122,18 @@ void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
11141122

11151123
// Push all the integer registers, except zr(x0) & sp(x2) & gp(x3) & tp(x4).
11161124
void MacroAssembler::pusha() {
1125+
CompressibleRegion cr(this);
11171126
push_reg(0xffffffe2, sp);
11181127
}
11191128

11201129
// Pop all the integer registers, except zr(x0) & sp(x2) & gp(x3) & tp(x4).
11211130
void MacroAssembler::popa() {
1131+
CompressibleRegion cr(this);
11221132
pop_reg(0xffffffe2, sp);
11231133
}
11241134

11251135
void MacroAssembler::push_CPU_state(bool save_vectors, int vector_size_in_bytes) {
1136+
CompressibleRegion cr(this);
11261137
// integer registers, except zr(x0) & ra(x1) & sp(x2) & gp(x3) & tp(x4)
11271138
push_reg(0xffffffe0, sp);
11281139

@@ -1144,6 +1155,7 @@ void MacroAssembler::push_CPU_state(bool save_vectors, int vector_size_in_bytes)
11441155
}
11451156

11461157
void MacroAssembler::pop_CPU_state(bool restore_vectors, int vector_size_in_bytes) {
1158+
CompressibleRegion cr(this);
11471159
// vector registers
11481160
if (restore_vectors) {
11491161
vsetvli(t0, x0, Assembler::e64, Assembler::m8);

0 commit comments

Comments
 (0)