Mercurial > hg > graal-compiler
annotate src/share/vm/adlc/formssel.hpp @ 11809:c7769440afd8
improve NodeUtil.cloneNode.
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 25 Sep 2013 17:34:01 +0200 |
parents | 7fa25f5575c9 |
children | c9ccd7b85f20 |
rev | line source |
---|---|
0 | 1 /* |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4120
diff
changeset
|
2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1541
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1541
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1541
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_ADLC_FORMSSEL_HPP |
26 #define SHARE_VM_ADLC_FORMSSEL_HPP | |
27 | |
0 | 28 // FORMSSEL.HPP - ADL Parser Instruction Selection Forms Classes |
29 | |
30 // Class List | |
31 class Form; | |
32 class InstructForm; | |
33 class MachNodeForm; | |
34 class OperandForm; | |
35 class OpClassForm; | |
36 class AttributeForm; | |
37 class RegisterForm; | |
38 class PipelineForm; | |
39 class SourceForm; | |
40 class EncodeForm; | |
41 class Component; | |
42 class Constraint; | |
43 class Predicate; | |
44 class MatchRule; | |
45 class Attribute; | |
46 class Effect; | |
47 class ExpandRule; | |
48 class RewriteRule; | |
49 class ConstructRule; | |
50 class FormatRule; | |
51 class Peephole; | |
52 class EncClass; | |
53 class Interface; | |
54 class RegInterface; | |
55 class ConstInterface; | |
56 class MemInterface; | |
57 class CondInterface; | |
58 class Opcode; | |
59 class InsEncode; | |
60 class RegDef; | |
61 class RegClass; | |
62 class AllocClass; | |
63 class ResourceForm; | |
64 class PipeDesc; | |
65 class PipeClass; | |
66 class PeepMatch; | |
67 class PeepConstraint; | |
68 class PeepReplace; | |
69 class MatchList; | |
70 | |
71 class ArchDesc; | |
72 | |
73 //==============================Instructions=================================== | |
74 //------------------------------InstructForm----------------------------------- | |
75 class InstructForm : public Form { | |
76 private: | |
2008 | 77 bool _ideal_only; // Not a user-defined instruction |
0 | 78 // Members used for tracking CISC-spilling |
6850 | 79 int _cisc_spill_operand;// Which operand may cisc-spill |
0 | 80 void set_cisc_spill_operand(uint op_index) { _cisc_spill_operand = op_index; } |
2008 | 81 bool _is_cisc_alternate; |
0 | 82 InstructForm *_cisc_spill_alternate;// cisc possible replacement |
83 const char *_cisc_reg_mask_name; | |
84 InstructForm *_short_branch_form; | |
85 bool _is_short_branch; | |
2008 | 86 bool _is_mach_constant; // true if Node is a MachConstantNode |
0 | 87 uint _alignment; |
88 | |
89 public: | |
90 // Public Data | |
91 const char *_ident; // Name of this instruction | |
92 NameList _parameters; // Locally defined names | |
93 FormDict _localNames; // Table of operands & their types | |
94 MatchRule *_matrule; // Matching rule for this instruction | |
95 Opcode *_opcode; // Encoding of the opcode for instruction | |
96 char *_size; // Size of instruction | |
97 InsEncode *_insencode; // Encoding class instruction belongs to | |
2008 | 98 InsEncode *_constant; // Encoding class constant value belongs to |
0 | 99 Attribute *_attribs; // List of Attribute rules |
100 Predicate *_predicate; // Predicate test for this instruction | |
101 FormDict _effects; // Dictionary of effect rules | |
102 ExpandRule *_exprule; // Expand rule for this instruction | |
103 RewriteRule *_rewrule; // Rewrite rule for this instruction | |
104 FormatRule *_format; // Format for assembly generation | |
105 Peephole *_peephole; // List of peephole rules for instruction | |
6850 | 106 const char *_ins_pipe; // Instruction Scheduling description class |
0 | 107 |
108 uint *_uniq_idx; // Indexes of unique operands | |
10389 | 109 uint _uniq_idx_length; // Length of _uniq_idx array |
0 | 110 uint _num_uniq; // Number of unique operands |
111 ComponentList _components; // List of Components matches MachNode's | |
112 // operand structure | |
113 | |
4120
f03a3c8bd5e5
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
3842
diff
changeset
|
114 bool _has_call; // contain a call and caller save registers should be saved? |
f03a3c8bd5e5
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
3842
diff
changeset
|
115 |
0 | 116 // Public Methods |
117 InstructForm(const char *id, bool ideal_only = false); | |
118 InstructForm(const char *id, InstructForm *instr, MatchRule *rule); | |
119 ~InstructForm(); | |
120 | |
121 // Dynamic type check | |
122 virtual InstructForm *is_instruction() const; | |
123 | |
124 virtual bool ideal_only() const; | |
125 | |
126 // This instruction sets a result | |
127 virtual bool sets_result() const; | |
128 // This instruction needs projections for additional DEFs or KILLs | |
129 virtual bool needs_projections(); | |
130 // This instruction needs extra nodes for temporary inputs | |
131 virtual bool has_temps(); | |
132 // This instruction defines or kills more than one object | |
133 virtual uint num_defs_or_kills(); | |
134 // This instruction has an expand rule? | |
135 virtual bool expands() const ; | |
136 // Return this instruction's first peephole rule, or NULL | |
137 virtual Peephole *peepholes() const; | |
138 // Add a peephole rule to this instruction | |
139 virtual void append_peephole(Peephole *peep); | |
140 | |
141 virtual bool is_pinned(FormDict &globals); // should be pinned inside block | |
142 virtual bool is_projection(FormDict &globals); // node requires projection | |
143 virtual bool is_parm(FormDict &globals); // node matches ideal 'Parm' | |
144 // ideal opcode enumeration | |
145 virtual const char *ideal_Opcode(FormDict &globals) const; | |
146 virtual int is_expensive() const; // node matches ideal 'CosD' | |
147 virtual int is_empty_encoding() const; // _size=0 and/or _insencode empty | |
148 virtual int is_tls_instruction() const; // tlsLoadP rule or ideal ThreadLocal | |
149 virtual int is_ideal_copy() const; // node matches ideal 'Copy*' | |
11002
7fa25f5575c9
8016157: During CTW: C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
adlertz
parents:
10389
diff
changeset
|
150 virtual bool is_ideal_negD() const; // node matches ideal 'NegD' |
0 | 151 virtual bool is_ideal_if() const; // node matches ideal 'If' |
152 virtual bool is_ideal_fastlock() const; // node matches 'FastLock' | |
153 virtual bool is_ideal_membar() const; // node matches ideal 'MemBarXXX' | |
154 virtual bool is_ideal_loadPC() const; // node matches ideal 'LoadPC' | |
155 virtual bool is_ideal_box() const; // node matches ideal 'Box' | |
156 virtual bool is_ideal_goto() const; // node matches ideal 'Goto' | |
157 virtual bool is_ideal_branch() const; // "" 'If' | 'Goto' | 'LoopEnd' | 'Jump' | |
158 virtual bool is_ideal_jump() const; // node matches ideal 'Jump' | |
159 virtual bool is_ideal_return() const; // node matches ideal 'Return' | |
160 virtual bool is_ideal_halt() const; // node matches ideal 'Halt' | |
161 virtual bool is_ideal_safepoint() const; // node matches 'SafePoint' | |
162 virtual bool is_ideal_nop() const; // node matches 'Nop' | |
163 virtual bool is_ideal_control() const; // control node | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4120
diff
changeset
|
164 virtual bool is_vector() const; // vector instruction |
0 | 165 |
166 virtual Form::CallType is_ideal_call() const; // matches ideal 'Call' | |
167 virtual Form::DataType is_ideal_load() const; // node matches ideal 'LoadXNode' | |
855
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
605
diff
changeset
|
168 // Should antidep checks be disabled for this Instruct |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
605
diff
changeset
|
169 // See definition of MatchRule::skip_antidep_check |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
605
diff
changeset
|
170 bool skip_antidep_check() const; |
0 | 171 virtual Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode' |
172 bool is_ideal_mem() const { return is_ideal_load() != Form::none || is_ideal_store() != Form::none; } | |
173 virtual uint two_address(FormDict &globals); // output reg must match input reg | |
174 // when chaining a constant to an instruction, return 'true' and set opType | |
175 virtual Form::DataType is_chain_of_constant(FormDict &globals); | |
176 virtual Form::DataType is_chain_of_constant(FormDict &globals, const char * &opType); | |
177 virtual Form::DataType is_chain_of_constant(FormDict &globals, const char * &opType, const char * &result_type); | |
178 | |
179 // Check if a simple chain rule | |
180 virtual bool is_simple_chain_rule(FormDict &globals) const; | |
181 | |
182 // check for structural rematerialization | |
183 virtual bool rematerialize(FormDict &globals, RegisterForm *registers); | |
184 | |
185 // loads from memory, so must check for anti-dependence | |
186 virtual bool needs_anti_dependence_check(FormDict &globals) const; | |
187 virtual int memory_operand(FormDict &globals) const; | |
188 bool is_wide_memory_kill(FormDict &globals) const; | |
189 | |
190 enum memory_operand_type { | |
191 NO_MEMORY_OPERAND = -1, | |
192 MANY_MEMORY_OPERANDS = 999999 | |
193 }; | |
194 | |
195 | |
196 // This instruction captures the machine-independent bottom_type | |
197 // Expected use is for pointer vs oop determination for LoadP | |
1541
b5fdf39b9749
6953576: bottom_type for matched AddPNodes doesn't always agree with ideal
never
parents:
855
diff
changeset
|
198 virtual bool captures_bottom_type(FormDict& globals) const; |
0 | 199 |
200 virtual const char *cost(); // Access ins_cost attribute | |
201 virtual uint num_opnds(); // Count of num_opnds for MachNode class | |
6850 | 202 // Counts USE_DEF opnds twice. See also num_unique_opnds(). |
0 | 203 virtual uint num_post_match_opnds(); |
204 virtual uint num_consts(FormDict &globals) const;// Constants in match rule | |
205 // Constants in match rule with specified type | |
206 virtual uint num_consts(FormDict &globals, Form::DataType type) const; | |
207 | |
208 // Return the register class associated with 'leaf'. | |
209 virtual const char *out_reg_class(FormDict &globals); | |
210 | |
211 // number of ideal node inputs to skip | |
212 virtual uint oper_input_base(FormDict &globals); | |
213 | |
214 // Does this instruction need a base-oop edge? | |
215 int needs_base_oop_edge(FormDict &globals) const; | |
216 | |
217 // Build instruction predicates. If the user uses the same operand name | |
218 // twice, we need to check that the operands are pointer-eequivalent in | |
219 // the DFA during the labeling process. | |
220 Predicate *build_predicate(); | |
221 | |
222 virtual void build_components(); // top-level operands | |
223 // Return zero-based position in component list; -1 if not in list. | |
224 virtual int operand_position(const char *name, int usedef); | |
225 virtual int operand_position_format(const char *name); | |
226 | |
227 // Return zero-based position in component list; -1 if not in list. | |
228 virtual int label_position(); | |
229 virtual int method_position(); | |
230 // Return number of relocation entries needed for this instruction. | |
231 virtual uint reloc(FormDict &globals); | |
232 | |
6850 | 233 const char *opnd_ident(int idx); // Name of operand #idx. |
0 | 234 const char *reduce_result(); |
235 // Return the name of the operand on the right hand side of the binary match | |
236 // Return NULL if there is no right hand side | |
237 const char *reduce_right(FormDict &globals) const; | |
238 const char *reduce_left(FormDict &globals) const; | |
239 | |
240 // Base class for this instruction, MachNode except for calls | |
1541
b5fdf39b9749
6953576: bottom_type for matched AddPNodes doesn't always agree with ideal
never
parents:
855
diff
changeset
|
241 virtual const char *mach_base_class(FormDict &globals) const; |
0 | 242 |
243 // Check if this instruction can cisc-spill to 'alternate' | |
244 bool cisc_spills_to(ArchDesc &AD, InstructForm *alternate); | |
245 InstructForm *cisc_spill_alternate() { return _cisc_spill_alternate; } | |
6850 | 246 int cisc_spill_operand() const { return _cisc_spill_operand; } |
0 | 247 bool is_cisc_alternate() const { return _is_cisc_alternate; } |
248 void set_cisc_alternate(bool val) { _is_cisc_alternate = val; } | |
249 const char *cisc_reg_mask_name() const { return _cisc_reg_mask_name; } | |
250 void set_cisc_reg_mask_name(const char *rm_name) { _cisc_reg_mask_name = rm_name; } | |
251 // Output cisc-method prototypes and method bodies | |
252 void declare_cisc_version(ArchDesc &AD, FILE *fp_cpp); | |
253 bool define_cisc_version (ArchDesc &AD, FILE *fp_cpp); | |
254 | |
255 bool check_branch_variant(ArchDesc &AD, InstructForm *short_branch); | |
256 | |
257 bool is_short_branch() { return _is_short_branch; } | |
258 void set_short_branch(bool val) { _is_short_branch = val; } | |
259 | |
2008 | 260 bool is_mach_constant() const { return _is_mach_constant; } |
261 void set_is_mach_constant(bool x) { _is_mach_constant = x; } | |
262 | |
0 | 263 InstructForm *short_branch_form() { return _short_branch_form; } |
264 bool has_short_branch_form() { return _short_branch_form != NULL; } | |
265 // Output short branch prototypes and method bodies | |
266 void declare_short_branch_methods(FILE *fp_cpp); | |
1541
b5fdf39b9749
6953576: bottom_type for matched AddPNodes doesn't always agree with ideal
never
parents:
855
diff
changeset
|
267 bool define_short_branch_methods(ArchDesc &AD, FILE *fp_cpp); |
0 | 268 |
269 uint alignment() { return _alignment; } | |
270 void set_alignment(uint val) { _alignment = val; } | |
271 | |
272 // Seach through operands to determine operands unique positions. | |
273 void set_unique_opnds(); | |
274 uint num_unique_opnds() { return _num_uniq; } | |
275 uint unique_opnds_idx(int idx) { | |
10389 | 276 if (_uniq_idx != NULL && idx > 0) { |
277 assert((uint)idx < _uniq_idx_length, "out of bounds"); | |
278 return _uniq_idx[idx]; | |
279 } else { | |
280 return idx; | |
281 } | |
599
0ad1cb407fa1
6805427: adlc compiler may generate incorrect machnode emission code
never
parents:
470
diff
changeset
|
282 } |
10389 | 283 const char *unique_opnd_ident(uint idx); // Name of operand at unique idx. |
0 | 284 |
285 // Operands which are only KILLs aren't part of the input array and | |
286 // require special handling in some cases. Their position in this | |
287 // operand list is higher than the number of unique operands. | |
288 bool is_noninput_operand(uint idx) { | |
289 return (idx >= num_unique_opnds()); | |
290 } | |
291 | |
292 // --------------------------- FILE *output_routines | |
293 // | |
294 // Generate the format call for the replacement variable | |
295 void rep_var_format(FILE *fp, const char *rep_var); | |
605 | 296 // Generate index values needed for determining the operand position |
0 | 297 void index_temps (FILE *fp, FormDict &globals, const char *prefix = "", const char *receiver = ""); |
298 // --------------------------- | |
299 | |
300 virtual bool verify(); // Check consistency after parsing | |
301 | |
302 virtual void dump(); // Debug printer | |
303 virtual void output(FILE *fp); // Write to output files | |
304 }; | |
305 | |
306 //------------------------------EncodeForm------------------------------------- | |
307 class EncodeForm : public Form { | |
308 private: | |
309 | |
310 public: | |
311 // Public Data | |
312 NameList _eclasses; // List of encode class names | |
313 Dict _encClass; // Map encode class names to EncClass objects | |
314 | |
315 // Public Methods | |
316 EncodeForm(); | |
317 ~EncodeForm(); | |
318 | |
319 EncClass *add_EncClass(const char *className); | |
320 EncClass *encClass(const char *className); | |
321 | |
322 const char *encClassPrototype(const char *className); | |
323 const char *encClassBody(const char *className); | |
324 | |
325 void dump(); // Debug printer | |
326 void output(FILE *fp); // Write info to output files | |
327 }; | |
328 | |
329 //------------------------------EncClass--------------------------------------- | |
330 class EncClass : public Form { | |
331 public: | |
332 // NameList for parameter type and name | |
333 NameList _parameter_type; | |
334 NameList _parameter_name; | |
335 | |
336 // Breakdown the encoding into strings separated by $replacement_variables | |
337 // There is an entry in _strings, perhaps NULL, that precedes each _rep_vars | |
338 NameList _code; // Strings passed through to tty->print | |
339 NameList _rep_vars; // replacement variables | |
340 | |
341 NameList _parameters; // Locally defined names | |
342 FormDict _localNames; // Table of components & their types | |
343 | |
344 public: | |
345 // Public Data | |
346 const char *_name; // encoding class name | |
347 | |
348 // Public Methods | |
349 EncClass(const char *name); | |
350 ~EncClass(); | |
351 | |
352 // --------------------------- Parameters | |
353 // Add a parameter <type,name> pair | |
354 void add_parameter(const char *parameter_type, const char *parameter_name); | |
355 // Verify operand types in parameter list | |
356 bool check_parameter_types(FormDict &globals); | |
357 // Obtain the zero-based index corresponding to a replacement variable | |
358 int rep_var_index(const char *rep_var); | |
359 int num_args() { return _parameter_name.count(); } | |
360 | |
361 // --------------------------- Code Block | |
362 // Add code | |
605 | 363 void add_code(const char *string_preceding_replacement_var); |
0 | 364 // Add a replacement variable or one of its subfields |
365 // Subfields are stored with a leading '$' | |
366 void add_rep_var(char *replacement_var); | |
367 | |
368 bool verify(); | |
369 void dump(); | |
370 void output(FILE *fp); | |
371 }; | |
372 | |
373 //------------------------------MachNode--------------------------------------- | |
374 class MachNodeForm: public Form { | |
375 private: | |
376 | |
377 public: | |
378 char *_ident; // Name of this instruction | |
379 const char *_machnode_pipe; // Instruction Scheduline description class | |
380 | |
381 // Public Methods | |
382 MachNodeForm(char *id); | |
383 ~MachNodeForm(); | |
384 | |
385 virtual MachNodeForm *is_machnode() const; | |
386 | |
387 void dump(); // Debug printer | |
388 void output(FILE *fp); // Write info to output files | |
389 }; | |
390 | |
391 //------------------------------Opcode----------------------------------------- | |
392 class Opcode : public Form { | |
393 private: | |
394 | |
395 public: | |
396 // Public Data | |
397 // Strings representing instruction opcodes, user defines placement in emit | |
398 char *_primary; | |
399 char *_secondary; | |
400 char *_tertiary; | |
401 | |
402 enum opcode_type { | |
403 NOT_AN_OPCODE = -1, | |
404 PRIMARY = 1, | |
405 SECONDARY = 2, | |
406 TERTIARY = 3 | |
407 }; | |
408 | |
409 // Public Methods | |
410 Opcode(char *primary, char *secondary, char *tertiary); | |
411 ~Opcode(); | |
412 | |
413 static Opcode::opcode_type as_opcode_type(const char *designator); | |
414 | |
415 void dump(); | |
416 void output(FILE *fp); | |
417 | |
418 // --------------------------- FILE *output_routines | |
415
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
419 bool print_opcode(FILE *fp, Opcode::opcode_type desired_opcode); |
0 | 420 }; |
421 | |
422 //------------------------------InsEncode-------------------------------------- | |
423 class InsEncode : public Form { | |
424 private: | |
425 // Public Data (access directly only for reads) | |
426 // The encodings can only have the values predefined by the ADLC: | |
427 // blank, RegReg, RegMem, MemReg, ... | |
428 NameList _encoding; | |
429 // NameList _parameter; | |
430 // The parameters for each encoding are preceeded by a NameList::_signal | |
431 // and follow the parameters for the previous encoding. | |
432 | |
433 // char *_encode; // Type of instruction encoding | |
434 | |
435 public: | |
436 // Public Methods | |
437 InsEncode(); | |
438 ~InsEncode(); | |
439 | |
440 // Add "encode class name" and its parameters | |
441 NameAndList *add_encode(char *encode_method_name); | |
442 // Parameters are added to the returned "NameAndList" by the parser | |
443 | |
444 // Access the list of encodings | |
445 void reset(); | |
446 const char *encode_class_iter(); | |
447 | |
448 // Returns the number of arguments to the current encoding in the iteration | |
449 int current_encoding_num_args() { | |
450 return ((NameAndList*)_encoding.current())->count(); | |
451 } | |
452 | |
453 // --------------------------- Parameters | |
454 // The following call depends upon position within encode_class_iteration | |
455 // | |
456 // Obtain parameter name from zero based index | |
457 const char *rep_var_name(InstructForm &inst, uint param_no); | |
458 // --------------------------- | |
459 | |
460 void dump(); | |
461 void output(FILE *fp); | |
462 }; | |
463 | |
464 //------------------------------Effect----------------------------------------- | |
465 class Effect : public Form { | |
466 private: | |
467 | |
468 public: | |
469 // Public Data | |
470 const char *_name; // Pre-defined name for effect | |
471 int _use_def; // Enumeration value of effect | |
472 | |
473 // Public Methods | |
474 Effect(const char *name); // Constructor | |
475 ~Effect(); // Destructor | |
476 | |
477 // Dynamic type check | |
478 virtual Effect *is_effect() const; | |
479 | |
480 // Return 'true' if this use def info equals the parameter | |
481 bool is(int use_def_kill_enum) const; | |
482 // Return 'true' if this use def info is a superset of parameter | |
483 bool isa(int use_def_kill_enum) const; | |
484 | |
485 void dump(); // Debug printer | |
486 void output(FILE *fp); // Write info to output files | |
487 }; | |
488 | |
489 //------------------------------ExpandRule------------------------------------- | |
490 class ExpandRule : public Form { | |
491 private: | |
492 NameList _expand_instrs; // ordered list of instructions and operands | |
493 | |
494 public: | |
495 // Public Data | |
496 NameList _newopers; // List of newly created operands | |
497 Dict _newopconst; // Map new operands to their constructors | |
498 | |
499 void add_instruction(NameAndList *instruction_name_and_operand_list); | |
500 void reset_instructions(); | |
501 NameAndList *iter_instructions(); | |
502 | |
503 // Public Methods | |
504 ExpandRule(); // Constructor | |
505 ~ExpandRule(); // Destructor | |
506 | |
507 void dump(); // Debug printer | |
508 void output(FILE *fp); // Write info to output files | |
509 }; | |
510 | |
511 //------------------------------RewriteRule------------------------------------ | |
512 class RewriteRule : public Form { | |
513 private: | |
514 | |
515 public: | |
516 // Public Data | |
517 SourceForm *_condition; // Rewrite condition code | |
518 InstructForm *_instrs; // List of instructions to expand to | |
519 OperandForm *_opers; // List of operands generated by expand | |
520 char *_tempParams; // Hold string until parser is finished. | |
521 char *_tempBlock; // Hold string until parser is finished. | |
522 | |
523 // Public Methods | |
524 RewriteRule(char* params, char* block) ; | |
525 ~RewriteRule(); // Destructor | |
526 void dump(); // Debug printer | |
527 void output(FILE *fp); // Write info to output files | |
528 }; | |
529 | |
530 | |
531 //==============================Operands======================================= | |
532 //------------------------------OpClassForm------------------------------------ | |
533 class OpClassForm : public Form { | |
534 public: | |
535 // Public Data | |
536 const char *_ident; // Name of this operand | |
537 NameList _oplst; // List of operand forms included in class | |
538 | |
539 // Public Methods | |
540 OpClassForm(const char *id); | |
541 ~OpClassForm(); | |
542 | |
543 // dynamic type check | |
544 virtual OpClassForm *is_opclass() const; | |
545 virtual Form::InterfaceType interface_type(FormDict &globals) const; | |
546 virtual bool stack_slots_only(FormDict &globals) const; | |
547 | |
548 virtual bool is_cisc_mem(FormDict &globals) const; | |
549 | |
550 | |
551 // Min and Max opcodes of operands in this operand class | |
552 int _minCode; | |
553 int _maxCode; | |
554 | |
555 virtual bool ideal_only() const; | |
556 virtual void dump(); // Debug printer | |
557 virtual void output(FILE *fp); // Write to output files | |
558 }; | |
559 | |
560 //------------------------------OperandForm------------------------------------ | |
561 class OperandForm : public OpClassForm { | |
562 private: | |
563 bool _ideal_only; // Not a user-defined instruction | |
564 | |
565 public: | |
566 // Public Data | |
567 NameList _parameters; // Locally defined names | |
568 FormDict _localNames; // Table of components & their types | |
569 MatchRule *_matrule; // Matching rule for this operand | |
570 Interface *_interface; // Encoding interface for this operand | |
571 Attribute *_attribs; // List of Attribute rules | |
572 Predicate *_predicate; // Predicate test for this operand | |
573 Constraint *_constraint; // Constraint Rule for this operand | |
574 ConstructRule *_construct; // Construction of operand data after matching | |
575 FormatRule *_format; // Format for assembly generation | |
576 NameList _classes; // List of opclasses which contain this oper | |
577 | |
578 ComponentList _components; // | |
579 | |
580 // Public Methods | |
581 OperandForm(const char *id); | |
582 OperandForm(const char *id, bool ideal_only); | |
583 ~OperandForm(); | |
584 | |
585 // Dynamic type check | |
586 virtual OperandForm *is_operand() const; | |
587 | |
588 virtual bool ideal_only() const; | |
589 virtual Form::InterfaceType interface_type(FormDict &globals) const; | |
590 virtual bool stack_slots_only(FormDict &globals) const; | |
591 | |
592 virtual const char *cost(); // Access ins_cost attribute | |
593 virtual uint num_leaves() const;// Leaves in complex operand | |
594 // Constants in operands' match rules | |
595 virtual uint num_consts(FormDict &globals) const; | |
596 // Constants in operand's match rule with specified type | |
597 virtual uint num_consts(FormDict &globals, Form::DataType type) const; | |
598 // Pointer Constants in operands' match rules | |
599 virtual uint num_const_ptrs(FormDict &globals) const; | |
600 // The number of input edges in the machine world == num_leaves - num_consts | |
601 virtual uint num_edges(FormDict &globals) const; | |
602 | |
603 // Check if this operand is usable for cisc-spilling | |
604 virtual bool is_cisc_reg(FormDict &globals) const; | |
605 | |
606 // node matches ideal 'Bool', grab condition codes from the ideal world | |
607 virtual bool is_ideal_bool() const; | |
608 | |
609 // Has an integer constant suitable for spill offsets | |
610 bool has_conI(FormDict &globals) const { | |
611 return (num_consts(globals,idealI) == 1) && !is_ideal_bool(); } | |
612 bool has_conL(FormDict &globals) const { | |
613 return (num_consts(globals,idealL) == 1) && !is_ideal_bool(); } | |
614 | |
615 // Node is user-defined operand for an sRegX | |
616 virtual Form::DataType is_user_name_for_sReg() const; | |
617 | |
618 // Return ideal type, if there is a single ideal type for this operand | |
619 virtual const char *ideal_type(FormDict &globals, RegisterForm *registers = NULL) const; | |
620 // If there is a single ideal type for this interface field, return it. | |
621 virtual const char *interface_ideal_type(FormDict &globals, | |
622 const char *field_name) const; | |
623 | |
624 // Return true if this operand represents a bound register class | |
625 bool is_bound_register() const; | |
626 | |
627 // Return the Register class for this operand. Returns NULL if | |
628 // operand isn't a register form. | |
629 RegClass* get_RegClass() const; | |
630 | |
631 virtual bool is_interface_field(const char *field_name, | |
632 const char * &value) const; | |
633 | |
634 // If this operand has a single ideal type, return its type | |
635 virtual Form::DataType simple_type(FormDict &globals) const; | |
636 // If this operand is an ideal constant, return its type | |
637 virtual Form::DataType is_base_constant(FormDict &globals) const; | |
638 | |
639 // "true" if this operand is a simple type that is swallowed | |
640 virtual bool swallowed(FormDict &globals) const; | |
641 | |
642 // Return register class name if a constraint specifies the register class. | |
643 virtual const char *constrained_reg_class() const; | |
644 // Return the register class associated with 'leaf'. | |
645 virtual const char *in_reg_class(uint leaf, FormDict &globals); | |
646 | |
647 // Build component list from MatchRule and operand's parameter list | |
648 virtual void build_components(); // top-level operands | |
649 | |
650 // Return zero-based position in component list; -1 if not in list. | |
651 virtual int operand_position(const char *name, int usedef); | |
652 | |
653 // Return zero-based position in component list; -1 if not in list. | |
654 virtual int constant_position(FormDict &globals, const Component *comp); | |
655 virtual int constant_position(FormDict &globals, const char *local_name); | |
656 // Return the operand form corresponding to the given index, else NULL. | |
657 virtual OperandForm *constant_operand(FormDict &globals, uint const_index); | |
658 | |
659 // Return zero-based position in component list; -1 if not in list. | |
660 virtual int register_position(FormDict &globals, const char *regname); | |
661 | |
662 const char *reduce_result() const; | |
663 // Return the name of the operand on the right hand side of the binary match | |
664 // Return NULL if there is no right hand side | |
665 const char *reduce_right(FormDict &globals) const; | |
666 const char *reduce_left(FormDict &globals) const; | |
667 | |
668 | |
669 // --------------------------- FILE *output_routines | |
670 // | |
671 // Output code for disp_is_oop, if true. | |
672 void disp_is_oop(FILE *fp, FormDict &globals); | |
673 // Generate code for internal and external format methods | |
674 void int_format(FILE *fp, FormDict &globals, uint index); | |
675 void ext_format(FILE *fp, FormDict &globals, uint index); | |
676 void format_constant(FILE *fp, uint con_index, uint con_type); | |
677 // Output code to access the value of the index'th constant | |
678 void access_constant(FILE *fp, FormDict &globals, | |
679 uint con_index); | |
680 // --------------------------- | |
681 | |
682 | |
683 virtual void dump(); // Debug printer | |
684 virtual void output(FILE *fp); // Write to output files | |
685 }; | |
686 | |
687 //------------------------------Constraint------------------------------------- | |
688 class Constraint : public Form { | |
689 private: | |
690 | |
691 public: | |
692 const char *_func; // Constraint function | |
693 const char *_arg; // function's argument | |
694 | |
695 // Public Methods | |
696 Constraint(const char *func, const char *arg); // Constructor | |
697 ~Constraint(); | |
698 | |
699 bool stack_slots_only() const; | |
700 | |
701 void dump(); // Debug printer | |
702 void output(FILE *fp); // Write info to output files | |
703 }; | |
704 | |
705 //------------------------------Predicate-------------------------------------- | |
706 class Predicate : public Form { | |
707 private: | |
708 | |
709 public: | |
710 // Public Data | |
711 char *_pred; // C++ source string for predicate | |
712 | |
713 // Public Methods | |
714 Predicate(char *pr); | |
715 ~Predicate(); | |
716 | |
717 void dump(); | |
718 void output(FILE *fp); | |
719 }; | |
720 | |
721 //------------------------------Interface-------------------------------------- | |
722 class Interface : public Form { | |
723 private: | |
724 | |
725 public: | |
726 // Public Data | |
727 const char *_name; // String representing the interface name | |
728 | |
729 // Public Methods | |
730 Interface(const char *name); | |
731 ~Interface(); | |
732 | |
733 virtual Form::InterfaceType interface_type(FormDict &globals) const; | |
734 | |
735 RegInterface *is_RegInterface(); | |
736 MemInterface *is_MemInterface(); | |
737 ConstInterface *is_ConstInterface(); | |
738 CondInterface *is_CondInterface(); | |
739 | |
740 | |
741 void dump(); | |
742 void output(FILE *fp); | |
743 }; | |
744 | |
745 //------------------------------RegInterface----------------------------------- | |
746 class RegInterface : public Interface { | |
747 private: | |
748 | |
749 public: | |
750 // Public Methods | |
751 RegInterface(); | |
752 ~RegInterface(); | |
753 | |
754 void dump(); | |
755 void output(FILE *fp); | |
756 }; | |
757 | |
758 //------------------------------ConstInterface--------------------------------- | |
759 class ConstInterface : public Interface { | |
760 private: | |
761 | |
762 public: | |
763 // Public Methods | |
764 ConstInterface(); | |
765 ~ConstInterface(); | |
766 | |
767 void dump(); | |
768 void output(FILE *fp); | |
769 }; | |
770 | |
771 //------------------------------MemInterface----------------------------------- | |
772 class MemInterface : public Interface { | |
773 private: | |
774 | |
775 public: | |
776 // Public Data | |
777 char *_base; // Base address | |
778 char *_index; // index | |
779 char *_scale; // scaling factor | |
780 char *_disp; // displacement | |
781 | |
782 // Public Methods | |
783 MemInterface(char *base, char *index, char *scale, char *disp); | |
784 ~MemInterface(); | |
785 | |
786 void dump(); | |
787 void output(FILE *fp); | |
788 }; | |
789 | |
790 //------------------------------CondInterface---------------------------------- | |
791 class CondInterface : public Interface { | |
792 private: | |
793 | |
794 public: | |
795 const char *_equal; | |
796 const char *_not_equal; | |
797 const char *_less; | |
798 const char *_greater_equal; | |
799 const char *_less_equal; | |
800 const char *_greater; | |
415
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
801 const char *_equal_format; |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
802 const char *_not_equal_format; |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
803 const char *_less_format; |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
804 const char *_greater_equal_format; |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
805 const char *_less_equal_format; |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
806 const char *_greater_format; |
0 | 807 |
808 // Public Methods | |
415
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
809 CondInterface(const char* equal, const char* equal_format, |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
810 const char* not_equal, const char* not_equal_format, |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
811 const char* less, const char* less_format, |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
812 const char* greater_equal, const char* greater_equal_format, |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
813 const char* less_equal, const char* less_equal_format, |
4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
never
parents:
0
diff
changeset
|
814 const char* greater, const char* greater_format); |
0 | 815 ~CondInterface(); |
816 | |
817 void dump(); | |
818 void output(FILE *fp); | |
819 }; | |
820 | |
821 //------------------------------ConstructRule---------------------------------- | |
822 class ConstructRule : public Form { | |
823 private: | |
824 | |
825 public: | |
826 // Public Data | |
827 char *_expr; // String representing the match expression | |
828 char *_construct; // String representing C++ constructor code | |
829 | |
830 // Public Methods | |
831 ConstructRule(char *cnstr); | |
832 ~ConstructRule(); | |
833 | |
834 void dump(); | |
835 void output(FILE *fp); | |
836 }; | |
837 | |
838 | |
839 //==============================Shared========================================= | |
840 //------------------------------AttributeForm---------------------------------- | |
841 class AttributeForm : public Form { | |
842 private: | |
843 // counters for unique instruction or operand ID | |
844 static int _insId; // user-defined machine instruction types | |
845 static int _opId; // user-defined operand types | |
846 | |
847 int id; // hold type for this object | |
848 | |
849 public: | |
850 // Public Data | |
851 char *_attrname; // Name of attribute | |
852 int _atype; // Either INS_ATTR or OP_ATTR | |
853 char *_attrdef; // C++ source which evaluates to constant | |
854 | |
855 // Public Methods | |
856 AttributeForm(char *attr, int type, char *attrdef); | |
857 ~AttributeForm(); | |
858 | |
859 // Dynamic type check | |
860 virtual AttributeForm *is_attribute() const; | |
861 | |
862 int type() { return id;} // return this object's "id" | |
863 | |
864 static const char* _ins_cost; // "ins_cost" | |
865 static const char* _op_cost; // "op_cost" | |
866 | |
867 void dump(); // Debug printer | |
868 void output(FILE *fp); // Write output files | |
869 }; | |
870 | |
871 //------------------------------Component-------------------------------------- | |
872 class Component : public Form { | |
873 private: | |
874 | |
875 public: | |
876 // Public Data | |
877 const char *_name; // Name of this component | |
878 const char *_type; // Type of this component | |
879 int _usedef; // Value of component | |
880 | |
881 // Public Methods | |
882 Component(const char *name, const char *type, int usedef); | |
883 ~Component(); | |
884 | |
885 | |
886 // Return 'true' if this use def info equals the parameter | |
887 bool is(int use_def_kill_enum) const; | |
888 // Return 'true' if this use def info is a superset of parameter | |
889 bool isa(int use_def_kill_enum) const; | |
890 int promote_use_def_info(int new_use_def); | |
891 const char *base_type(FormDict &globals); | |
892 // Form::DataType is_base_constant(FormDict &globals); | |
893 | |
894 void dump(); // Debug printer | |
895 void output(FILE *fp); // Write to output files | |
6850 | 896 const char* getUsedefName(); |
0 | 897 |
898 public: | |
899 // Implementation depends upon working bit intersection and union. | |
900 enum use_def_enum { | |
901 INVALID = 0x0, | |
902 USE = 0x1, | |
903 DEF = 0x2, USE_DEF = 0x3, | |
904 KILL = 0x4, USE_KILL = 0x5, | |
905 SYNTHETIC = 0x8, | |
4120
f03a3c8bd5e5
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
3842
diff
changeset
|
906 TEMP = USE | SYNTHETIC, |
f03a3c8bd5e5
7077312: Provide a CALL effect for instruct declaration in the ad file
roland
parents:
3842
diff
changeset
|
907 CALL = 0x10 |
0 | 908 }; |
909 }; | |
910 | |
911 | |
912 //------------------------------MatchNode-------------------------------------- | |
913 class MatchNode : public Form { | |
914 private: | |
915 | |
916 public: | |
917 // Public Data | |
918 const char *_result; // The name of the output of this node | |
919 const char *_name; // The name that appeared in the match rule | |
920 const char *_opType; // The Operation/Type matched | |
921 MatchNode *_lChild; // Left child in expression tree | |
922 MatchNode *_rChild; // Right child in expression tree | |
923 int _numleaves; // Sum of numleaves for all direct children | |
924 ArchDesc &_AD; // Reference to ArchDesc object | |
925 char *_internalop; // String representing internal operand | |
926 int _commutative_id; // id of commutative operation | |
927 | |
928 // Public Methods | |
929 MatchNode(ArchDesc &ad, const char *result = 0, const char *expr = 0, | |
930 const char *opType=0, MatchNode *lChild=NULL, | |
931 MatchNode *rChild=NULL); | |
932 MatchNode(ArchDesc &ad, MatchNode& mNode); // Shallow copy constructor; | |
933 MatchNode(ArchDesc &ad, MatchNode& mNode, int clone); // Construct clone | |
934 ~MatchNode(); | |
935 | |
936 // return 0 if not found: | |
937 // return 1 if found and position is incremented by operand offset in rule | |
938 bool find_name(const char *str, int &position) const; | |
939 bool find_type(const char *str, int &position) const; | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
940 virtual void append_components(FormDict& locals, ComponentList& components, |
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
941 bool def_flag = false) const; |
0 | 942 bool base_operand(uint &position, FormDict &globals, |
943 const char * &result, const char * &name, | |
944 const char * &opType) const; | |
945 // recursive count on operands | |
946 uint num_consts(FormDict &globals) const; | |
947 uint num_const_ptrs(FormDict &globals) const; | |
948 // recursive count of constants with specified type | |
949 uint num_consts(FormDict &globals, Form::DataType type) const; | |
950 // uint num_consts() const; // Local inspection only | |
951 int needs_ideal_memory_edge(FormDict &globals) const; | |
952 int needs_base_oop_edge() const; | |
953 | |
954 // Help build instruction predicates. Search for operand names. | |
955 void count_instr_names( Dict &names ); | |
956 int build_instr_pred( char *buf, const char *name, int cnt ); | |
957 void build_internalop( ); | |
958 | |
959 // Return the name of the operands associated with reducing to this operand: | |
960 // The result type, plus the left and right sides of the binary match | |
961 // Return NULL if there is no left or right hand side | |
962 bool sets_result() const; // rule "Set"s result of match | |
963 const char *reduce_right(FormDict &globals) const; | |
964 const char *reduce_left (FormDict &globals) const; | |
965 | |
966 // Recursive version of check in MatchRule | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
967 int cisc_spill_match(FormDict& globals, RegisterForm* registers, |
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
968 MatchNode* mRule2, const char* &operand, |
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
969 const char* ®_type); |
0 | 970 int cisc_spill_merge(int left_result, int right_result); |
971 | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
972 virtual bool equivalent(FormDict& globals, MatchNode* mNode2); |
0 | 973 |
974 void count_commutative_op(int& count); | |
975 void swap_commutative_op(bool atroot, int count); | |
976 | |
977 void dump(); | |
978 void output(FILE *fp); | |
979 }; | |
980 | |
981 //------------------------------MatchRule-------------------------------------- | |
982 class MatchRule : public MatchNode { | |
983 private: | |
984 | |
985 public: | |
986 // Public Data | |
987 const char *_machType; // Machine type index | |
988 int _depth; // Expression tree depth | |
989 char *_construct; // String representing C++ constructor code | |
990 int _numchilds; // Number of direct children | |
991 MatchRule *_next; // Pointer to next match rule | |
992 | |
993 // Public Methods | |
994 MatchRule(ArchDesc &ad); | |
995 MatchRule(ArchDesc &ad, MatchRule* mRule); // Shallow copy constructor; | |
996 MatchRule(ArchDesc &ad, MatchNode* mroot, int depth, char* construct, int numleaves); | |
997 ~MatchRule(); | |
998 | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
999 virtual void append_components(FormDict& locals, ComponentList& components, bool def_flag = false) const; |
0 | 1000 // Recursive call on all operands' match rules in my match rule. |
1001 bool base_operand(uint &position, FormDict &globals, | |
1002 const char * &result, const char * &name, | |
1003 const char * &opType) const; | |
1004 | |
1005 | |
1006 bool is_base_register(FormDict &globals) const; | |
1007 Form::DataType is_base_constant(FormDict &globals) const; | |
1008 bool is_chain_rule(FormDict &globals) const; | |
1009 int is_ideal_copy() const; | |
1010 int is_expensive() const; // node matches ideal 'CosD' | |
1011 bool is_ideal_if() const; // node matches ideal 'If' | |
1012 bool is_ideal_fastlock() const; // node matches ideal 'FastLock' | |
1013 bool is_ideal_jump() const; // node matches ideal 'Jump' | |
1014 bool is_ideal_membar() const; // node matches ideal 'MemBarXXX' | |
1015 bool is_ideal_loadPC() const; // node matches ideal 'LoadPC' | |
1016 bool is_ideal_box() const; // node matches ideal 'Box' | |
1017 bool is_ideal_goto() const; // node matches ideal 'Goto' | |
1018 bool is_ideal_loopEnd() const; // node matches ideal 'LoopEnd' | |
1019 bool is_ideal_bool() const; // node matches ideal 'Bool' | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4120
diff
changeset
|
1020 bool is_vector() const; // vector instruction |
0 | 1021 Form::DataType is_ideal_load() const;// node matches ideal 'LoadXNode' |
855
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
605
diff
changeset
|
1022 // Should antidep checks be disabled for this rule |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
605
diff
changeset
|
1023 // See definition of MatchRule::skip_antidep_check |
f9094a5e1c8a
6857159: local schedule failed with checkcast of Thread.currentThread()
never
parents:
605
diff
changeset
|
1024 bool skip_antidep_check() const; |
0 | 1025 Form::DataType is_ideal_store() const;// node matches ideal 'StoreXNode' |
1026 | |
1027 // Check if 'mRule2' is a cisc-spill variant of this MatchRule | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
1028 int matchrule_cisc_spill_match(FormDict &globals, RegisterForm* registers, |
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
1029 MatchRule* mRule2, const char* &operand, |
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
1030 const char* ®_type); |
0 | 1031 |
1032 // Check if 'mRule2' is equivalent to this MatchRule | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
1033 virtual bool equivalent(FormDict& globals, MatchNode* mRule2); |
0 | 1034 |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
599
diff
changeset
|
1035 void matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt); |
0 | 1036 |
1037 void dump(); | |
6850 | 1038 void output_short(FILE *fp); |
0 | 1039 void output(FILE *fp); |
1040 }; | |
1041 | |
1042 //------------------------------Attribute-------------------------------------- | |
1043 class Attribute : public Form { | |
1044 private: | |
1045 | |
1046 public: | |
1047 // Public Data | |
1048 char *_ident; // Name of predefined attribute | |
1049 char *_val; // C++ source which evaluates to constant | |
1050 int _atype; // Either INS_ATTR or OP_ATTR | |
1051 int int_val(ArchDesc &ad); // Return atoi(_val), ensuring syntax. | |
1052 | |
1053 // Public Methods | |
1054 Attribute(char *id, char* val, int type); | |
1055 ~Attribute(); | |
1056 | |
1057 void dump(); | |
1058 void output(FILE *fp); | |
1059 }; | |
1060 | |
1061 //------------------------------FormatRule------------------------------------- | |
1062 class FormatRule : public Form { | |
1063 private: | |
1064 | |
1065 public: | |
1066 // Public Data | |
1067 // There is an entry in _strings, perhaps NULL, that precedes each _rep_vars | |
1068 NameList _strings; // Strings passed through to tty->print | |
1069 NameList _rep_vars; // replacement variables | |
1070 char *_temp; // String representing the assembly code | |
1071 | |
1072 // Public Methods | |
1073 FormatRule(char *temp); | |
1074 ~FormatRule(); | |
1075 | |
1076 void dump(); | |
1077 void output(FILE *fp); | |
1078 }; | |
1972 | 1079 |
1080 #endif // SHARE_VM_ADLC_FORMSSEL_HPP |