Skip to content

Commit dbc763e

Browse files
committed
Cover most RVC instructions by using CompressibleRegion to cover minimal functions in C2
1 parent 6ea36d2 commit dbc763e

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
@@ -970,6 +970,7 @@ int MacroAssembler::bitset_to_regs(unsigned int bitset, unsigned char* regs) {
970970
// Return the number of words pushed
971971
int MacroAssembler::push_reg(unsigned int bitset, Register stack) {
972972
DEBUG_ONLY(int words_pushed = 0;)
973+
CompressibleRegion cr(this);
973974

974975
unsigned char regs[32];
975976
int count = bitset_to_regs(bitset, regs);
@@ -991,6 +992,7 @@ int MacroAssembler::push_reg(unsigned int bitset, Register stack) {
991992

992993
int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
993994
DEBUG_ONLY(int words_popped = 0;)
995+
CompressibleRegion cr(this);
994996

995997
unsigned char regs[32];
996998
int count = bitset_to_regs(bitset, regs);
@@ -1013,6 +1015,7 @@ int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
10131015
// Push float registers in the bitset, except sp.
10141016
// Return the number of heapwords pushed.
10151017
int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
1018+
CompressibleRegion cr(this);
10161019
int words_pushed = 0;
10171020
unsigned char regs[32];
10181021
int count = bitset_to_regs(bitset, regs);
@@ -1032,6 +1035,7 @@ int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
10321035
}
10331036

10341037
int MacroAssembler::pop_fp(unsigned int bitset, Register stack) {
1038+
CompressibleRegion cr(this);
10351039
int words_popped = 0;
10361040
unsigned char regs[32];
10371041
int count = bitset_to_regs(bitset, regs);
@@ -1052,6 +1056,7 @@ int MacroAssembler::pop_fp(unsigned int bitset, Register stack) {
10521056

10531057
#ifdef COMPILER2
10541058
int MacroAssembler::push_vp(unsigned int bitset, Register stack) {
1059+
CompressibleRegion cr(this);
10551060
int vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
10561061

10571062
// Scan bitset to accumulate register pairs
@@ -1073,6 +1078,7 @@ int MacroAssembler::push_vp(unsigned int bitset, Register stack) {
10731078
}
10741079

10751080
int MacroAssembler::pop_vp(unsigned int bitset, Register stack) {
1081+
CompressibleRegion cr(this);
10761082
int vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
10771083

10781084
// Scan bitset to accumulate register pairs
@@ -1095,6 +1101,7 @@ int MacroAssembler::pop_vp(unsigned int bitset, Register stack) {
10951101
#endif // COMPILER2
10961102

10971103
void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
1104+
CompressibleRegion cr(this);
10981105
// Push integer registers x7, x10-x17, x28-x31.
10991106
push_reg(RegSet::of(x7) + RegSet::range(x10, x17) + RegSet::range(x28, x31) - exclude, sp);
11001107

@@ -1109,6 +1116,7 @@ void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
11091116
}
11101117

11111118
void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
1119+
CompressibleRegion cr(this);
11121120
int offset = 0;
11131121
for (int i = 0; i < 32; i++) {
11141122
if (i <= f7->encoding() || i >= f28->encoding() || (i >= f10->encoding() && i <= f17->encoding())) {
@@ -1122,15 +1130,18 @@ void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
11221130

11231131
// Push all the integer registers, except zr(x0) & sp(x2) & gp(x3) & tp(x4).
11241132
void MacroAssembler::pusha() {
1133+
CompressibleRegion cr(this);
11251134
push_reg(0xffffffe2, sp);
11261135
}
11271136

11281137
// Pop all the integer registers, except zr(x0) & sp(x2) & gp(x3) & tp(x4).
11291138
void MacroAssembler::popa() {
1139+
CompressibleRegion cr(this);
11301140
pop_reg(0xffffffe2, sp);
11311141
}
11321142

11331143
void MacroAssembler::push_CPU_state(bool save_vectors, int vector_size_in_bytes) {
1144+
CompressibleRegion cr(this);
11341145
// integer registers, except zr(x0) & ra(x1) & sp(x2) & gp(x3) & tp(x4)
11351146
push_reg(0xffffffe0, sp);
11361147

@@ -1152,6 +1163,7 @@ void MacroAssembler::push_CPU_state(bool save_vectors, int vector_size_in_bytes)
11521163
}
11531164

11541165
void MacroAssembler::pop_CPU_state(bool restore_vectors, int vector_size_in_bytes) {
1166+
CompressibleRegion cr(this);
11551167
// vector registers
11561168
if (restore_vectors) {
11571169
vsetvli(t0, x0, Assembler::e64, Assembler::m8);

0 commit comments

Comments
 (0)