154 if( reg_def->register_num() == 0 ) ++num_register_zero;
155 }
156 if( num_register_zero > 1 ) {
157 fprintf(stderr,
158 "ERROR: More than one register has been assigned register-number 0.\n"
159 "Probably because a register has not been entered into an allocation class.\n");
160 }
161
162 return valid;
163 }
164
165 // Compute RegMask size
166 int RegisterForm::RegMask_Size() {
167 // Need at least this many words
168 int words_for_regs = (_reg_ctr + 31)>>5;
169 // The array of Register Mask bits should be large enough to cover
170 // all the machine registers and all parameters that need to be passed
171 // on the stack (stack registers) up to some interesting limit. Methods
172 // that need more parameters will NOT be compiled. On Intel, the limit
173 // is something like 90+ parameters.
174 // Add a few (3 words == 96 bits) for incoming & outgoing arguments to calls.
175 // Round up to the next doubleword size.
176 return (words_for_regs + 3 + 1) & ~1;
177 }
178
179 void RegisterForm::dump() { // Debug printer
180 output(stderr);
181 }
182
183 void RegisterForm::output(FILE *fp) { // Write info to output files
184 const char *name;
185 fprintf(fp,"\n");
186 fprintf(fp,"-------------------- Dump RegisterForm --------------------\n");
187 for(_rdefs.reset(); (name = _rdefs.iter()) != nullptr;) {
188 ((RegDef*)_regDef[name])->output(fp);
189 }
190 fprintf(fp,"\n");
191 for (_rclasses.reset(); (name = _rclasses.iter()) != nullptr;) {
192 ((RegClass*)_regClass[name])->output(fp);
193 }
194 fprintf(fp,"\n");
195 for (_aclasses.reset(); (name = _aclasses.iter()) != nullptr;) {
196 ((AllocClass*)_allocClass[name])->output(fp);
|
154 if( reg_def->register_num() == 0 ) ++num_register_zero;
155 }
156 if( num_register_zero > 1 ) {
157 fprintf(stderr,
158 "ERROR: More than one register has been assigned register-number 0.\n"
159 "Probably because a register has not been entered into an allocation class.\n");
160 }
161
162 return valid;
163 }
164
165 // Compute RegMask size
166 int RegisterForm::RegMask_Size() {
167 // Need at least this many words
168 int words_for_regs = (_reg_ctr + 31)>>5;
169 // The array of Register Mask bits should be large enough to cover
170 // all the machine registers and all parameters that need to be passed
171 // on the stack (stack registers) up to some interesting limit. Methods
172 // that need more parameters will NOT be compiled. On Intel, the limit
173 // is something like 90+ parameters.
174 // - Add a few (3 words == 96 bits) for incoming & outgoing arguments to
175 // calls.
176 // - Round up to the next doubleword size.
177 // - Add one more word to accommodate a reasonable number of stack locations
178 // in the register mask regardless of how much slack is created by rounding.
179 // This was found necessary after adding 16 new registers for APX.
180 return (words_for_regs + 3 + 1 + 1) & ~1;
181 }
182
183 void RegisterForm::dump() { // Debug printer
184 output(stderr);
185 }
186
187 void RegisterForm::output(FILE *fp) { // Write info to output files
188 const char *name;
189 fprintf(fp,"\n");
190 fprintf(fp,"-------------------- Dump RegisterForm --------------------\n");
191 for(_rdefs.reset(); (name = _rdefs.iter()) != nullptr;) {
192 ((RegDef*)_regDef[name])->output(fp);
193 }
194 fprintf(fp,"\n");
195 for (_rclasses.reset(); (name = _rclasses.iter()) != nullptr;) {
196 ((RegClass*)_regClass[name])->output(fp);
197 }
198 fprintf(fp,"\n");
199 for (_aclasses.reset(); (name = _aclasses.iter()) != nullptr;) {
200 ((AllocClass*)_allocClass[name])->output(fp);
|