128 // This instruction needs extra nodes for temporary inputs
129 virtual bool has_temps();
130 // This instruction defines or kills more than one object
131 virtual uint num_defs_or_kills();
132 // This instruction has an expand rule?
133 virtual bool expands() const ;
134 // Return this instruction's first peephole rule, or NULL
135 virtual Peephole *peepholes() const;
136 // Add a peephole rule to this instruction
137 virtual void append_peephole(Peephole *peep);
138
139 virtual bool is_pinned(FormDict &globals); // should be pinned inside block
140 virtual bool is_projection(FormDict &globals); // node requires projection
141 virtual bool is_parm(FormDict &globals); // node matches ideal 'Parm'
142 // ideal opcode enumeration
143 virtual const char *ideal_Opcode(FormDict &globals) const;
144 virtual int is_expensive() const; // node matches ideal 'CosD'
145 virtual int is_empty_encoding() const; // _size=0 and/or _insencode empty
146 virtual int is_tls_instruction() const; // tlsLoadP rule or ideal ThreadLocal
147 virtual int is_ideal_copy() const; // node matches ideal 'Copy*'
148 virtual bool is_ideal_unlock() const; // node matches ideal 'Unlock'
149 virtual bool is_ideal_call_leaf() const; // node matches ideal 'CallLeaf'
150 virtual bool is_ideal_if() const; // node matches ideal 'If'
151 virtual bool is_ideal_fastlock() const; // node matches 'FastLock'
152 virtual bool is_ideal_membar() const; // node matches ideal 'MemBarXXX'
153 virtual bool is_ideal_loadPC() const; // node matches ideal 'LoadPC'
154 virtual bool is_ideal_box() const; // node matches ideal 'Box'
155 virtual bool is_ideal_goto() const; // node matches ideal 'Goto'
156 virtual bool is_ideal_branch() const; // "" 'If' | 'Goto' | 'LoopEnd' | 'Jump'
157 virtual bool is_ideal_jump() const; // node matches ideal 'Jump'
158 virtual bool is_ideal_return() const; // node matches ideal 'Return'
159 virtual bool is_ideal_halt() const; // node matches ideal 'Halt'
160 virtual bool is_ideal_safepoint() const; // node matches 'SafePoint'
161 virtual bool is_ideal_nop() const; // node matches 'Nop'
162 virtual bool is_ideal_control() const; // control node
163
164 virtual Form::CallType is_ideal_call() const; // matches ideal 'Call'
165 virtual Form::DataType is_ideal_load() const; // node matches ideal 'LoadXNode'
166 // Should antidep checks be disabled for this Instruct
167 // See definition of MatchRule::skip_antidep_check
168 bool skip_antidep_check() const;
169 virtual Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode'
840 static int _opId; // user-defined operand types
841
842 int id; // hold type for this object
843
844 public:
845 // Public Data
846 char *_attrname; // Name of attribute
847 int _atype; // Either INS_ATTR or OP_ATTR
848 char *_attrdef; // C++ source which evaluates to constant
849
850 // Public Methods
851 AttributeForm(char *attr, int type, char *attrdef);
852 ~AttributeForm();
853
854 // Dynamic type check
855 virtual AttributeForm *is_attribute() const;
856
857 int type() { return id;} // return this object's "id"
858
859 static const char* _ins_cost; // "ins_cost"
860 static const char* _ins_pc_relative; // "ins_pc_relative"
861 static const char* _op_cost; // "op_cost"
862
863 void dump(); // Debug printer
864 void output(FILE *fp); // Write output files
865 };
866
867 //------------------------------Component--------------------------------------
868 class Component : public Form {
869 private:
870
871 public:
872 // Public Data
873 const char *_name; // Name of this component
874 const char *_type; // Type of this component
875 int _usedef; // Value of component
876
877 // Public Methods
878 Component(const char *name, const char *type, int usedef);
879 ~Component();
880
985 MatchRule *_next; // Pointer to next match rule
986
987 // Public Methods
988 MatchRule(ArchDesc &ad);
989 MatchRule(ArchDesc &ad, MatchRule* mRule); // Shallow copy constructor;
990 MatchRule(ArchDesc &ad, MatchNode* mroot, int depth, char* construct, int numleaves);
991 ~MatchRule();
992
993 virtual void append_components(FormDict& locals, ComponentList& components, bool def_flag = false) const;
994 // Recursive call on all operands' match rules in my match rule.
995 bool base_operand(uint &position, FormDict &globals,
996 const char * &result, const char * &name,
997 const char * &opType) const;
998
999
1000 bool is_base_register(FormDict &globals) const;
1001 Form::DataType is_base_constant(FormDict &globals) const;
1002 bool is_chain_rule(FormDict &globals) const;
1003 int is_ideal_copy() const;
1004 int is_expensive() const; // node matches ideal 'CosD'
1005 bool is_ideal_unlock() const;
1006 bool is_ideal_call_leaf() const;
1007 bool is_ideal_if() const; // node matches ideal 'If'
1008 bool is_ideal_fastlock() const; // node matches ideal 'FastLock'
1009 bool is_ideal_jump() const; // node matches ideal 'Jump'
1010 bool is_ideal_membar() const; // node matches ideal 'MemBarXXX'
1011 bool is_ideal_loadPC() const; // node matches ideal 'LoadPC'
1012 bool is_ideal_box() const; // node matches ideal 'Box'
1013 bool is_ideal_goto() const; // node matches ideal 'Goto'
1014 bool is_ideal_loopEnd() const; // node matches ideal 'LoopEnd'
1015 bool is_ideal_bool() const; // node matches ideal 'Bool'
1016 Form::DataType is_ideal_load() const;// node matches ideal 'LoadXNode'
1017 // Should antidep checks be disabled for this rule
1018 // See definition of MatchRule::skip_antidep_check
1019 bool skip_antidep_check() const;
1020 Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode'
1021
1022 // Check if 'mRule2' is a cisc-spill variant of this MatchRule
1023 int matchrule_cisc_spill_match(FormDict &globals, RegisterForm* registers,
1024 MatchRule* mRule2, const char* &operand,
1025 const char* ®_type);
1026
|
128 // This instruction needs extra nodes for temporary inputs
129 virtual bool has_temps();
130 // This instruction defines or kills more than one object
131 virtual uint num_defs_or_kills();
132 // This instruction has an expand rule?
133 virtual bool expands() const ;
134 // Return this instruction's first peephole rule, or NULL
135 virtual Peephole *peepholes() const;
136 // Add a peephole rule to this instruction
137 virtual void append_peephole(Peephole *peep);
138
139 virtual bool is_pinned(FormDict &globals); // should be pinned inside block
140 virtual bool is_projection(FormDict &globals); // node requires projection
141 virtual bool is_parm(FormDict &globals); // node matches ideal 'Parm'
142 // ideal opcode enumeration
143 virtual const char *ideal_Opcode(FormDict &globals) const;
144 virtual int is_expensive() const; // node matches ideal 'CosD'
145 virtual int is_empty_encoding() const; // _size=0 and/or _insencode empty
146 virtual int is_tls_instruction() const; // tlsLoadP rule or ideal ThreadLocal
147 virtual int is_ideal_copy() const; // node matches ideal 'Copy*'
148 virtual bool is_ideal_if() const; // node matches ideal 'If'
149 virtual bool is_ideal_fastlock() const; // node matches 'FastLock'
150 virtual bool is_ideal_membar() const; // node matches ideal 'MemBarXXX'
151 virtual bool is_ideal_loadPC() const; // node matches ideal 'LoadPC'
152 virtual bool is_ideal_box() const; // node matches ideal 'Box'
153 virtual bool is_ideal_goto() const; // node matches ideal 'Goto'
154 virtual bool is_ideal_branch() const; // "" 'If' | 'Goto' | 'LoopEnd' | 'Jump'
155 virtual bool is_ideal_jump() const; // node matches ideal 'Jump'
156 virtual bool is_ideal_return() const; // node matches ideal 'Return'
157 virtual bool is_ideal_halt() const; // node matches ideal 'Halt'
158 virtual bool is_ideal_safepoint() const; // node matches 'SafePoint'
159 virtual bool is_ideal_nop() const; // node matches 'Nop'
160 virtual bool is_ideal_control() const; // control node
161
162 virtual Form::CallType is_ideal_call() const; // matches ideal 'Call'
163 virtual Form::DataType is_ideal_load() const; // node matches ideal 'LoadXNode'
164 // Should antidep checks be disabled for this Instruct
165 // See definition of MatchRule::skip_antidep_check
166 bool skip_antidep_check() const;
167 virtual Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode'
838 static int _opId; // user-defined operand types
839
840 int id; // hold type for this object
841
842 public:
843 // Public Data
844 char *_attrname; // Name of attribute
845 int _atype; // Either INS_ATTR or OP_ATTR
846 char *_attrdef; // C++ source which evaluates to constant
847
848 // Public Methods
849 AttributeForm(char *attr, int type, char *attrdef);
850 ~AttributeForm();
851
852 // Dynamic type check
853 virtual AttributeForm *is_attribute() const;
854
855 int type() { return id;} // return this object's "id"
856
857 static const char* _ins_cost; // "ins_cost"
858 static const char* _op_cost; // "op_cost"
859
860 void dump(); // Debug printer
861 void output(FILE *fp); // Write output files
862 };
863
864 //------------------------------Component--------------------------------------
865 class Component : public Form {
866 private:
867
868 public:
869 // Public Data
870 const char *_name; // Name of this component
871 const char *_type; // Type of this component
872 int _usedef; // Value of component
873
874 // Public Methods
875 Component(const char *name, const char *type, int usedef);
876 ~Component();
877
982 MatchRule *_next; // Pointer to next match rule
983
984 // Public Methods
985 MatchRule(ArchDesc &ad);
986 MatchRule(ArchDesc &ad, MatchRule* mRule); // Shallow copy constructor;
987 MatchRule(ArchDesc &ad, MatchNode* mroot, int depth, char* construct, int numleaves);
988 ~MatchRule();
989
990 virtual void append_components(FormDict& locals, ComponentList& components, bool def_flag = false) const;
991 // Recursive call on all operands' match rules in my match rule.
992 bool base_operand(uint &position, FormDict &globals,
993 const char * &result, const char * &name,
994 const char * &opType) const;
995
996
997 bool is_base_register(FormDict &globals) const;
998 Form::DataType is_base_constant(FormDict &globals) const;
999 bool is_chain_rule(FormDict &globals) const;
1000 int is_ideal_copy() const;
1001 int is_expensive() const; // node matches ideal 'CosD'
1002 bool is_ideal_if() const; // node matches ideal 'If'
1003 bool is_ideal_fastlock() const; // node matches ideal 'FastLock'
1004 bool is_ideal_jump() const; // node matches ideal 'Jump'
1005 bool is_ideal_membar() const; // node matches ideal 'MemBarXXX'
1006 bool is_ideal_loadPC() const; // node matches ideal 'LoadPC'
1007 bool is_ideal_box() const; // node matches ideal 'Box'
1008 bool is_ideal_goto() const; // node matches ideal 'Goto'
1009 bool is_ideal_loopEnd() const; // node matches ideal 'LoopEnd'
1010 bool is_ideal_bool() const; // node matches ideal 'Bool'
1011 Form::DataType is_ideal_load() const;// node matches ideal 'LoadXNode'
1012 // Should antidep checks be disabled for this rule
1013 // See definition of MatchRule::skip_antidep_check
1014 bool skip_antidep_check() const;
1015 Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode'
1016
1017 // Check if 'mRule2' is a cisc-spill variant of this MatchRule
1018 int matchrule_cisc_spill_match(FormDict &globals, RegisterForm* registers,
1019 MatchRule* mRule2, const char* &operand,
1020 const char* ®_type);
1021
|