< prev index next >

src/hotspot/cpu/riscv/register_riscv.hpp

Print this page

 89       return raw_encoding() >= compressed_register_base &&
 90              raw_encoding() <= compressed_register_top;
 91     }
 92 
 93     // derived registers, offsets, and addresses
 94     inline Register successor() const;
 95 
 96     VMReg as_VMReg() const;
 97 
 98     const char* name() const;
 99   };
100 
101   inline friend constexpr Register as_Register(int encoding);
102 
103   constexpr Register() : _encoding(-1) {} // noreg
104 
105   int operator==(const Register r) const { return _encoding == r._encoding; }
106   int operator!=(const Register r) const { return _encoding != r._encoding; }
107 
108   constexpr const RegisterImpl* operator->() const { return RegisterImpl::first() + _encoding; }





109 };
110 
111 extern Register::RegisterImpl all_RegisterImpls[Register::number_of_registers + 1] INTERNAL_VISIBILITY;
112 
113 inline constexpr const Register::RegisterImpl* Register::RegisterImpl::first() {
114   return all_RegisterImpls + 1;
115 }
116 
117 constexpr Register noreg = Register();
118 
119 inline constexpr Register as_Register(int encoding) {
120   if (0 <= encoding && encoding < Register::number_of_registers) {
121     return Register(encoding);
122   }
123   return noreg;
124 }
125 
126 inline Register Register::RegisterImpl::successor() const {
127   assert(is_valid(), "sanity");
128   return as_Register(encoding() + 1);

 89       return raw_encoding() >= compressed_register_base &&
 90              raw_encoding() <= compressed_register_top;
 91     }
 92 
 93     // derived registers, offsets, and addresses
 94     inline Register successor() const;
 95 
 96     VMReg as_VMReg() const;
 97 
 98     const char* name() const;
 99   };
100 
101   inline friend constexpr Register as_Register(int encoding);
102 
103   constexpr Register() : _encoding(-1) {} // noreg
104 
105   int operator==(const Register r) const { return _encoding == r._encoding; }
106   int operator!=(const Register r) const { return _encoding != r._encoding; }
107 
108   constexpr const RegisterImpl* operator->() const { return RegisterImpl::first() + _encoding; }
109 
110   // Actually available GP registers for use, depending on actual CPU capabilities and flags.
111   static int available_gp_registers() {
112     return number_of_registers;
113   }
114 };
115 
116 extern Register::RegisterImpl all_RegisterImpls[Register::number_of_registers + 1] INTERNAL_VISIBILITY;
117 
118 inline constexpr const Register::RegisterImpl* Register::RegisterImpl::first() {
119   return all_RegisterImpls + 1;
120 }
121 
122 constexpr Register noreg = Register();
123 
124 inline constexpr Register as_Register(int encoding) {
125   if (0 <= encoding && encoding < Register::number_of_registers) {
126     return Register(encoding);
127   }
128   return noreg;
129 }
130 
131 inline Register Register::RegisterImpl::successor() const {
132   assert(is_valid(), "sanity");
133   return as_Register(encoding() + 1);
< prev index next >