Skip to content

Commit 5df07a1

Browse files
committed
Cover most RVC instructions by using CompressibleRegion to cover minimal functions in C2
1 parent a8a3491 commit 5df07a1

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ int MacroAssembler::bitset_to_regs(unsigned int bitset, unsigned char* regs) {
974974
// Return the number of words pushed
975975
int MacroAssembler::push_reg(unsigned int bitset, Register stack) {
976976
DEBUG_ONLY(int words_pushed = 0;)
977+
CompressibleRegion cr(this);
977978

978979
unsigned char regs[32];
979980
int count = bitset_to_regs(bitset, regs);
@@ -995,6 +996,7 @@ int MacroAssembler::push_reg(unsigned int bitset, Register stack) {
995996

996997
int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
997998
DEBUG_ONLY(int words_popped = 0;)
999+
CompressibleRegion cr(this);
9981000

9991001
unsigned char regs[32];
10001002
int count = bitset_to_regs(bitset, regs);
@@ -1017,6 +1019,7 @@ int MacroAssembler::pop_reg(unsigned int bitset, Register stack) {
10171019
// Push float registers in the bitset, except sp.
10181020
// Return the number of heapwords pushed.
10191021
int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
1022+
CompressibleRegion cr(this);
10201023
int words_pushed = 0;
10211024
unsigned char regs[32];
10221025
int count = bitset_to_regs(bitset, regs);
@@ -1036,6 +1039,7 @@ int MacroAssembler::push_fp(unsigned int bitset, Register stack) {
10361039
}
10371040

10381041
int MacroAssembler::pop_fp(unsigned int bitset, Register stack) {
1042+
CompressibleRegion cr(this);
10391043
int words_popped = 0;
10401044
unsigned char regs[32];
10411045
int count = bitset_to_regs(bitset, regs);
@@ -1056,6 +1060,7 @@ int MacroAssembler::pop_fp(unsigned int bitset, Register stack) {
10561060

10571061
#ifdef COMPILER2
10581062
int MacroAssembler::push_vp(unsigned int bitset, Register stack) {
1063+
CompressibleRegion cr(this);
10591064
int vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
10601065

10611066
// Scan bitset to accumulate register pairs
@@ -1077,6 +1082,7 @@ int MacroAssembler::push_vp(unsigned int bitset, Register stack) {
10771082
}
10781083

10791084
int MacroAssembler::pop_vp(unsigned int bitset, Register stack) {
1085+
CompressibleRegion cr(this);
10801086
int vector_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
10811087

10821088
// Scan bitset to accumulate register pairs
@@ -1099,6 +1105,7 @@ int MacroAssembler::pop_vp(unsigned int bitset, Register stack) {
10991105
#endif // COMPILER2
11001106

11011107
void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
1108+
CompressibleRegion cr(this);
11021109
// Push integer registers x7, x10-x17, x28-x31.
11031110
push_reg(RegSet::of(x7) + RegSet::range(x10, x17) + RegSet::range(x28, x31) - exclude, sp);
11041111

@@ -1113,6 +1120,7 @@ void MacroAssembler::push_call_clobbered_registers_except(RegSet exclude) {
11131120
}
11141121

11151122
void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
1123+
CompressibleRegion cr(this);
11161124
int offset = 0;
11171125
for (int i = 0; i < 32; i++) {
11181126
if (i <= f7->encoding() || i >= f28->encoding() || (i >= f10->encoding() && i <= f17->encoding())) {
@@ -1126,15 +1134,18 @@ void MacroAssembler::pop_call_clobbered_registers_except(RegSet exclude) {
11261134

11271135
// Push all the integer registers, except zr(x0) & sp(x2) & gp(x3) & tp(x4).
11281136
void MacroAssembler::pusha() {
1137+
CompressibleRegion cr(this);
11291138
push_reg(0xffffffe2, sp);
11301139
}
11311140

11321141
// Pop all the integer registers, except zr(x0) & sp(x2) & gp(x3) & tp(x4).
11331142
void MacroAssembler::popa() {
1143+
CompressibleRegion cr(this);
11341144
pop_reg(0xffffffe2, sp);
11351145
}
11361146

11371147
void MacroAssembler::push_CPU_state(bool save_vectors, int vector_size_in_bytes) {
1148+
CompressibleRegion cr(this);
11381149
// integer registers, except zr(x0) & ra(x1) & sp(x2) & gp(x3) & tp(x4)
11391150
push_reg(0xffffffe0, sp);
11401151

@@ -1156,6 +1167,7 @@ void MacroAssembler::push_CPU_state(bool save_vectors, int vector_size_in_bytes)
11561167
}
11571168

11581169
void MacroAssembler::pop_CPU_state(bool restore_vectors, int vector_size_in_bytes) {
1170+
CompressibleRegion cr(this);
11591171
// vector registers
11601172
if (restore_vectors) {
11611173
vsetvli(t0, x0, Assembler::e64, Assembler::m8);

0 commit comments

Comments
 (0)