src/share/vm/adlc/formssel.hpp

changeset 4161
d336b3173277
parent 3882
8c92982cbbc4
child 5221
f15fe46d8c00
equal deleted inserted replaced
4160:f6badecb7ea7 4161:d336b3173277
74 //------------------------------InstructForm----------------------------------- 74 //------------------------------InstructForm-----------------------------------
75 class InstructForm : public Form { 75 class InstructForm : public Form {
76 private: 76 private:
77 bool _ideal_only; // Not a user-defined instruction 77 bool _ideal_only; // Not a user-defined instruction
78 // Members used for tracking CISC-spilling 78 // Members used for tracking CISC-spilling
79 uint _cisc_spill_operand;// Which operand may cisc-spill 79 int _cisc_spill_operand;// Which operand may cisc-spill
80 void set_cisc_spill_operand(uint op_index) { _cisc_spill_operand = op_index; } 80 void set_cisc_spill_operand(uint op_index) { _cisc_spill_operand = op_index; }
81 bool _is_cisc_alternate; 81 bool _is_cisc_alternate;
82 InstructForm *_cisc_spill_alternate;// cisc possible replacement 82 InstructForm *_cisc_spill_alternate;// cisc possible replacement
83 const char *_cisc_reg_mask_name; 83 const char *_cisc_reg_mask_name;
84 InstructForm *_short_branch_form; 84 InstructForm *_short_branch_form;
101 FormDict _effects; // Dictionary of effect rules 101 FormDict _effects; // Dictionary of effect rules
102 ExpandRule *_exprule; // Expand rule for this instruction 102 ExpandRule *_exprule; // Expand rule for this instruction
103 RewriteRule *_rewrule; // Rewrite rule for this instruction 103 RewriteRule *_rewrule; // Rewrite rule for this instruction
104 FormatRule *_format; // Format for assembly generation 104 FormatRule *_format; // Format for assembly generation
105 Peephole *_peephole; // List of peephole rules for instruction 105 Peephole *_peephole; // List of peephole rules for instruction
106 const char *_ins_pipe; // Instruction Scheduline description class 106 const char *_ins_pipe; // Instruction Scheduling description class
107 107
108 uint *_uniq_idx; // Indexes of unique operands 108 uint *_uniq_idx; // Indexes of unique operands
109 int _uniq_idx_length; // Length of _uniq_idx array 109 int _uniq_idx_length; // Length of _uniq_idx array
110 uint _num_uniq; // Number of unique operands 110 uint _num_uniq; // Number of unique operands
111 ComponentList _components; // List of Components matches MachNode's 111 ComponentList _components; // List of Components matches MachNode's
196 // Expected use is for pointer vs oop determination for LoadP 196 // Expected use is for pointer vs oop determination for LoadP
197 virtual bool captures_bottom_type(FormDict& globals) const; 197 virtual bool captures_bottom_type(FormDict& globals) const;
198 198
199 virtual const char *cost(); // Access ins_cost attribute 199 virtual const char *cost(); // Access ins_cost attribute
200 virtual uint num_opnds(); // Count of num_opnds for MachNode class 200 virtual uint num_opnds(); // Count of num_opnds for MachNode class
201 // Counts USE_DEF opnds twice. See also num_unique_opnds().
201 virtual uint num_post_match_opnds(); 202 virtual uint num_post_match_opnds();
202 virtual uint num_consts(FormDict &globals) const;// Constants in match rule 203 virtual uint num_consts(FormDict &globals) const;// Constants in match rule
203 // Constants in match rule with specified type 204 // Constants in match rule with specified type
204 virtual uint num_consts(FormDict &globals, Form::DataType type) const; 205 virtual uint num_consts(FormDict &globals, Form::DataType type) const;
205 206
226 virtual int label_position(); 227 virtual int label_position();
227 virtual int method_position(); 228 virtual int method_position();
228 // Return number of relocation entries needed for this instruction. 229 // Return number of relocation entries needed for this instruction.
229 virtual uint reloc(FormDict &globals); 230 virtual uint reloc(FormDict &globals);
230 231
232 const char *opnd_ident(int idx); // Name of operand #idx.
231 const char *reduce_result(); 233 const char *reduce_result();
232 // Return the name of the operand on the right hand side of the binary match 234 // Return the name of the operand on the right hand side of the binary match
233 // Return NULL if there is no right hand side 235 // Return NULL if there is no right hand side
234 const char *reduce_right(FormDict &globals) const; 236 const char *reduce_right(FormDict &globals) const;
235 const char *reduce_left(FormDict &globals) const; 237 const char *reduce_left(FormDict &globals) const;
238 virtual const char *mach_base_class(FormDict &globals) const; 240 virtual const char *mach_base_class(FormDict &globals) const;
239 241
240 // Check if this instruction can cisc-spill to 'alternate' 242 // Check if this instruction can cisc-spill to 'alternate'
241 bool cisc_spills_to(ArchDesc &AD, InstructForm *alternate); 243 bool cisc_spills_to(ArchDesc &AD, InstructForm *alternate);
242 InstructForm *cisc_spill_alternate() { return _cisc_spill_alternate; } 244 InstructForm *cisc_spill_alternate() { return _cisc_spill_alternate; }
243 uint cisc_spill_operand() const { return _cisc_spill_operand; } 245 int cisc_spill_operand() const { return _cisc_spill_operand; }
244 bool is_cisc_alternate() const { return _is_cisc_alternate; } 246 bool is_cisc_alternate() const { return _is_cisc_alternate; }
245 void set_cisc_alternate(bool val) { _is_cisc_alternate = val; } 247 void set_cisc_alternate(bool val) { _is_cisc_alternate = val; }
246 const char *cisc_reg_mask_name() const { return _cisc_reg_mask_name; } 248 const char *cisc_reg_mask_name() const { return _cisc_reg_mask_name; }
247 void set_cisc_reg_mask_name(const char *rm_name) { _cisc_reg_mask_name = rm_name; } 249 void set_cisc_reg_mask_name(const char *rm_name) { _cisc_reg_mask_name = rm_name; }
248 // Output cisc-method prototypes and method bodies 250 // Output cisc-method prototypes and method bodies
275 return _uniq_idx[idx]; 277 return _uniq_idx[idx];
276 } else { 278 } else {
277 return idx; 279 return idx;
278 } 280 }
279 } 281 }
282 const char *unique_opnd_ident(int idx); // Name of operand at unique idx.
280 283
281 // Operands which are only KILLs aren't part of the input array and 284 // Operands which are only KILLs aren't part of the input array and
282 // require special handling in some cases. Their position in this 285 // require special handling in some cases. Their position in this
283 // operand list is higher than the number of unique operands. 286 // operand list is higher than the number of unique operands.
284 bool is_noninput_operand(uint idx) { 287 bool is_noninput_operand(uint idx) {
887 const char *base_type(FormDict &globals); 890 const char *base_type(FormDict &globals);
888 // Form::DataType is_base_constant(FormDict &globals); 891 // Form::DataType is_base_constant(FormDict &globals);
889 892
890 void dump(); // Debug printer 893 void dump(); // Debug printer
891 void output(FILE *fp); // Write to output files 894 void output(FILE *fp); // Write to output files
895 const char* getUsedefName();
892 896
893 public: 897 public:
894 // Implementation depends upon working bit intersection and union. 898 // Implementation depends upon working bit intersection and union.
895 enum use_def_enum { 899 enum use_def_enum {
896 INVALID = 0x0, 900 INVALID = 0x0,
1028 virtual bool equivalent(FormDict& globals, MatchNode* mRule2); 1032 virtual bool equivalent(FormDict& globals, MatchNode* mRule2);
1029 1033
1030 void matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt); 1034 void matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt);
1031 1035
1032 void dump(); 1036 void dump();
1037 void output_short(FILE *fp);
1033 void output(FILE *fp); 1038 void output(FILE *fp);
1034 }; 1039 };
1035 1040
1036 //------------------------------Attribute-------------------------------------- 1041 //------------------------------Attribute--------------------------------------
1037 class Attribute : public Form { 1042 class Attribute : public Form {

mercurial