Skip to content

Commit dc022be

Browse files
committed
Remove useless and polish comments
1 parent 7340ecc commit dc022be

File tree

4 files changed

+19
-41
lines changed

4 files changed

+19
-41
lines changed

src/hotspot/cpu/riscv/assembler_riscv.hpp

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,19 +2023,19 @@ enum Nf {
20232023
// RISC-V Compressed Instructions Extension
20242024
// ========================================
20252025
// Note:
2026-
// 1. When UseRVC is enabled, 32-bit instructions under 'CompressibleRegion's will be
2027-
// transformed to 16-bit instructions if compressible.
2028-
// 2. RVC instructions in Assembler always begin with 'c_' prefix, as 'c_li',
2029-
// but most of time we have no need to explicitly use these instructions.
2030-
// 3. We introduce 'CompressibleRegion' to hint instructions in this Region's RTTI range
2031-
// are qualified to change to their 2-byte versions.
2032-
// An example:
2026+
// 1. When UseRVC is enabled, 32-bit instructions under 'CompressibleRegion's will be
2027+
// transformed to 16-bit instructions if compressible.
2028+
// 2. RVC instructions in Assembler always begin with 'c_' prefix, as 'c_li',
2029+
// but most of time we have no need to explicitly use these instructions.
2030+
// 3. We introduce 'CompressibleRegion' to hint instructions in this Region's RTTI range
2031+
// are qualified to change to their 2-byte versions.
2032+
// An example:
20332033
//
2034-
// CompressibleRegion cr(_masm);
2035-
// __ andr(...); // this instruction could change to c.and if able to
2034+
// CompressibleRegion cr(_masm);
2035+
// __ andr(...); // this instruction could change to c.and if able to
20362036
//
2037-
// 4. Using -XX:PrintAssemblyOptions=no-aliases could print RVC instructions instead of
2038-
// normal ones.
2037+
// 4. Using -XX:PrintAssemblyOptions=no-aliases could print RVC instructions instead of
2038+
// normal ones.
20392039
//
20402040

20412041
private:
@@ -2061,23 +2061,6 @@ enum Nf {
20612061
}
20622062
};
20632063

2064-
// RVC: extract a 16-bit instruction.
2065-
static inline uint16_t c_extract(uint16_t val, unsigned msb, unsigned lsb) {
2066-
assert_cond(msb >= lsb && msb <= 15);
2067-
unsigned nbits = msb - lsb + 1;
2068-
uint16_t mask = (1U << nbits) - 1;
2069-
uint16_t result = val >> lsb;
2070-
result &= mask;
2071-
return result;
2072-
}
2073-
2074-
static inline int16_t c_sextract(uint16_t val, unsigned msb, unsigned lsb) {
2075-
assert_cond(msb >= lsb && msb <= 15);
2076-
int16_t result = val << (15 - msb);
2077-
result >>= (15 - msb + lsb);
2078-
return result;
2079-
}
2080-
20812064
// RVC: patch a 16-bit instruction.
20822065
static void c_patch(address a, unsigned msb, unsigned lsb, uint16_t val) {
20832066
assert_cond(a != NULL);

src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Op
13251325
void LIR_Assembler::align_call(LIR_Code code) {
13261326
// RVC: With RVC a call may get 2-byte aligned.
13271327
// the address of jal itself (which will be patched later) should not span the cache line.
1328-
// See CallDynamicJavaDirectNode::compute_padding() for more info.
1328+
// See CallStaticJavaDirectNode::compute_padding() for more info.
13291329
__ align(4);
13301330
}
13311331

src/hotspot/cpu/riscv/riscv.ad

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ int MachCallNativeNode::ret_addr_offset() {
11911191
}
11921192

11931193
// RVC: With RVC a call may get 2-byte aligned.
1194-
// The offset encoding in jal ranges bits [12, 31], which could span the cache line.
1194+
// The offset encoding in jal ranges bits [12, 31] could span the cache line.
11951195
// Patching this unaligned address will make the write operation not atomic.
11961196
// Other threads may be running the same piece of code at full speed, causing concurrency issues.
11971197
// So we must ensure that it does not span a cache line so that it can be patched.
@@ -1201,11 +1201,7 @@ int CallStaticJavaDirectNode::compute_padding(int current_offset) const
12011201
return align_up(current_offset, alignment_required()) - current_offset;
12021202
}
12031203

1204-
// RVC: With RVC a call may get 2-byte aligned.
1205-
// The offset encoding in jal ranges bits [12, 31], which could span the cache line.
1206-
// Patching this unaligned address will make the write operation not atomic.
1207-
// Other threads may be running the same piece of code at full speed, causing concurrency issues.
1208-
// So we must ensure that it does not span a cache line so that it can be patched.
1204+
// RVC: See CallStaticJavaDirectNode::compute_padding() for more info.
12091205
int CallDynamicJavaDirectNode::compute_padding(int current_offset) const
12101206
{
12111207
// skip the movptr in MacroAssembler::ic_call():

src/hotspot/cpu/riscv/vm_version_riscv.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@ void VM_Version::initialize() {
101101
FLAG_SET_DEFAULT(UseMD5Intrinsics, false);
102102
}
103103

104-
// compressed instruction extension
105-
if (UseRVC && !(_features & CPU_C)) {
106-
warning("RVC is not supported on this CPU");
107-
FLAG_SET_DEFAULT(UseRVC, false);
108-
}
109-
110104
if (UseRVV) {
111105
if (!(_features & CPU_V)) {
112106
warning("RVV is not supported on this CPU");
@@ -122,6 +116,11 @@ void VM_Version::initialize() {
122116
FLAG_SET_DEFAULT(UseRVB, false);
123117
}
124118

119+
if (UseRVC && !(_features & CPU_C)) {
120+
warning("RVC is not supported on this CPU");
121+
FLAG_SET_DEFAULT(UseRVC, false);
122+
}
123+
125124
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) {
126125
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true);
127126
}

0 commit comments

Comments
 (0)