@@ -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
20412041private:
@@ -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 );
0 commit comments