src/share/vm/adlc/archDesc.hpp

Tue, 08 Aug 2017 15:57:29 +0800

author
aoqi
date
Tue, 08 Aug 2017 15:57:29 +0800
changeset 6876
710a3c8b516e
parent 6499
ad3b94907eed
parent 0
f90c822e73f8
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef SHARE_VM_ADLC_ARCHDESC_HPP
aoqi@0 26 #define SHARE_VM_ADLC_ARCHDESC_HPP
aoqi@0 27
aoqi@0 28 // Definitions for Error Flags
aoqi@0 29 #define WARN 0
aoqi@0 30 #define SYNERR 1
aoqi@0 31 #define SEMERR 2
aoqi@0 32 #define INTERNAL_ERR 3
aoqi@0 33
aoqi@0 34 // Minimal declarations for include files
aoqi@0 35 class OutputMap;
aoqi@0 36 class ProductionState;
aoqi@0 37 class Expr;
aoqi@0 38
aoqi@0 39 // STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES
aoqi@0 40 typedef BufferedFile ADLFILE;
aoqi@0 41
aoqi@0 42 //---------------------------ChainList-----------------------------------------
aoqi@0 43 class ChainList {
aoqi@0 44 NameList _name;
aoqi@0 45 NameList _cost;
aoqi@0 46 NameList _rule;
aoqi@0 47
aoqi@0 48 public:
aoqi@0 49 void insert(const char *name, const char *cost, const char *rule);
aoqi@0 50 bool search(const char *name);
aoqi@0 51
aoqi@0 52 void reset();
aoqi@0 53 bool iter(const char * &name, const char * &cost, const char * &rule);
aoqi@0 54
aoqi@0 55 void dump();
aoqi@0 56 void output(FILE *fp);
aoqi@0 57
aoqi@0 58 ChainList();
aoqi@0 59 ~ChainList();
aoqi@0 60 };
aoqi@0 61
aoqi@0 62 //---------------------------MatchList-----------------------------------------
aoqi@0 63 class MatchList {
aoqi@0 64 private:
aoqi@0 65 MatchList *_next;
aoqi@0 66 Predicate *_pred; // Predicate which applies to this match rule
aoqi@0 67 const char *_cost;
aoqi@0 68
aoqi@0 69 public:
aoqi@0 70 const char *_opcode;
aoqi@0 71 const char *_resultStr;
aoqi@0 72 const char *_lchild;
aoqi@0 73 const char *_rchild;
aoqi@0 74
aoqi@0 75 MatchList(MatchList *nxt, Predicate *prd): _next(nxt), _pred(prd), _cost(NULL){
aoqi@0 76 _resultStr = _lchild = _rchild = _opcode = NULL; }
aoqi@0 77
aoqi@0 78 MatchList(MatchList *nxt, Predicate *prd, const char *cost,
aoqi@0 79 const char *opcode, const char *resultStr, const char *lchild,
aoqi@0 80 const char *rchild)
aoqi@0 81 : _next(nxt), _pred(prd), _cost(cost), _opcode(opcode),
aoqi@0 82 _resultStr(resultStr), _lchild(lchild), _rchild(rchild) { }
aoqi@0 83
aoqi@0 84 MatchList *get_next(void) { return _next; }
aoqi@0 85 char *get_pred(void) { return (_pred?_pred->_pred:NULL); }
aoqi@0 86 Predicate *get_pred_obj(void) { return _pred; }
aoqi@0 87 const char *get_cost(void) { return _cost == NULL ? "0" :_cost; }
aoqi@0 88 bool search(const char *opc, const char *res, const char *lch,
aoqi@0 89 const char *rch, Predicate *pr);
aoqi@0 90
aoqi@0 91 void dump();
aoqi@0 92 void output(FILE *fp);
aoqi@0 93 };
aoqi@0 94
aoqi@0 95 //---------------------------ArchDesc------------------------------------------
aoqi@0 96 class ArchDesc {
aoqi@0 97 private:
aoqi@0 98 FormDict _globalNames; // Global names
aoqi@0 99 Dict _idealIndex; // Map ideal names to index in enumeration
aoqi@0 100 ExprDict _globalDefs; // Global definitions, #defines
aoqi@0 101 int _internalOpCounter; // Internal Operand Counter
aoqi@0 102
aoqi@0 103 FormList _header; // List of Source Code Forms for hpp file
aoqi@0 104 FormList _pre_header; // ditto for the very top of the hpp file
aoqi@0 105 FormList _source; // List of Source Code Forms for output
aoqi@0 106 FormList _instructions; // List of Instruction Forms for output
aoqi@0 107 FormList _machnodes; // List of Node Classes (special for pipelining)
aoqi@0 108 FormList _operands; // List of Operand Forms for output
aoqi@0 109 FormList _opclass; // List of Operand Class Forms for output
aoqi@0 110 FormList _attributes; // List of Attribute Forms for parsing
aoqi@0 111 RegisterForm *_register; // Only one Register Form allowed
aoqi@0 112 FrameForm *_frame; // Describe stack-frame layout
aoqi@0 113 EncodeForm *_encode; // Only one Encode Form allowed
aoqi@0 114 PipelineForm *_pipeline; // Pipeline Form for output
aoqi@0 115
aoqi@0 116 bool _has_match_rule[_last_opcode]; // found AD rule for ideal node in <arch>.ad
aoqi@0 117
aoqi@0 118 MatchList *_mlistab[_last_opcode]; // Array of MatchLists
aoqi@0 119
aoqi@0 120 // The Architecture Description identifies which user-defined operand can be used
aoqi@0 121 // to access [stack_pointer + offset]
aoqi@0 122 OperandForm *_cisc_spill_operand;
aoqi@0 123
aoqi@0 124 // If a Call node uses $constanttablebase, it gets MachConstantBaseNode
aoqi@0 125 // by the matcher and the matcher will modify the jvms. If so, jvm states
aoqi@0 126 // always have to be cloned when a node is cloned. Adlc generates
aoqi@0 127 // Compile::needs_clone_jvms() accordingly.
aoqi@0 128 bool _needs_clone_jvms;
aoqi@0 129
aoqi@0 130 // Methods for outputting the DFA
aoqi@0 131 void gen_match(FILE *fp, MatchList &mlist, ProductionState &status, Dict &operands_chained_from);
aoqi@0 132 void chain_rule(FILE *fp, const char *indent, const char *ideal,
aoqi@0 133 const Expr *icost, const char *irule,
aoqi@0 134 Dict &operands_chained_from, ProductionState &status);
aoqi@0 135 void expand_opclass(FILE *fp, const char *indent, const Expr *cost,
aoqi@0 136 const char *result_type, ProductionState &status);
aoqi@0 137 Expr *calc_cost(FILE *fp, const char *spaces, MatchList &mList, ProductionState &status);
aoqi@0 138 void prune_matchlist(Dict &minimize, MatchList &mlist);
aoqi@0 139
aoqi@0 140 // Helper function that outputs code to generate an instruction in MachNodeGenerator
aoqi@0 141 void buildMachNode(FILE *fp_cpp, InstructForm *inst, const char *indent);
aoqi@0 142
aoqi@0 143 public:
aoqi@0 144 ArchDesc();
aoqi@0 145 ~ArchDesc();
aoqi@0 146
aoqi@0 147 // Option flags which control miscellaneous behaviors throughout the code
aoqi@0 148 int _TotalLines; // Line Counter
aoqi@0 149 int _no_output; // Flag to disable output of DFA, etc.
aoqi@0 150 int _quiet_mode; // Do not output banner messages, etc.
aoqi@0 151 int _disable_warnings; // Do not output warning messages
aoqi@0 152 int _dfa_debug; // Debug Flag for generated DFA
aoqi@0 153 int _dfa_small; // Debug Flag for generated DFA
aoqi@0 154 int _adl_debug; // Debug Flag for ADLC
aoqi@0 155 int _adlocation_debug; // Debug Flag to use ad file locations
aoqi@0 156 bool _cisc_spill_debug; // Debug Flag to see cisc-spill-instructions
aoqi@0 157 bool _short_branch_debug; // Debug Flag to see short branch instructions
aoqi@0 158
aoqi@0 159 // Error/Warning Counts
aoqi@0 160 int _syntax_errs; // Count of syntax errors
aoqi@0 161 int _semantic_errs; // Count of semantic errors
aoqi@0 162 int _warnings; // Count warnings
aoqi@0 163 int _internal_errs; // Count of internal errors
aoqi@0 164
aoqi@0 165 // Accessor for private data.
aoqi@0 166 void has_match_rule(int opc, const bool b) { _has_match_rule[opc] = b; }
aoqi@0 167
aoqi@0 168 // I/O Files
aoqi@0 169 ADLFILE _ADL_file; // Input Architecture Description File
aoqi@0 170 // Machine dependent files, built from architecture definition
aoqi@0 171 ADLFILE _DFA_file; // File for definition of Matcher::DFA
aoqi@0 172 ADLFILE _HPP_file; // File for ArchNode class declarations
aoqi@0 173 ADLFILE _CPP_file; // File for ArchNode class defintions
aoqi@0 174 ADLFILE _CPP_CLONE_file; // File for MachNode/Oper clone defintions
aoqi@0 175 ADLFILE _CPP_EXPAND_file; // File for MachNode expand methods
aoqi@0 176 ADLFILE _CPP_FORMAT_file; // File for MachNode/Oper format defintions
aoqi@0 177 ADLFILE _CPP_GEN_file; // File for MachNode/Oper generator methods
aoqi@0 178 ADLFILE _CPP_MISC_file; // File for miscellaneous MachNode/Oper tables & methods
aoqi@0 179 ADLFILE _CPP_PEEPHOLE_file; // File for MachNode peephole methods
aoqi@0 180 ADLFILE _CPP_PIPELINE_file; // File for MachNode pipeline defintions
aoqi@0 181 ADLFILE _VM_file; // File for constants needed in VM code
aoqi@0 182 ADLFILE _bug_file; // DFA debugging file
aoqi@0 183
aoqi@0 184 // I/O helper methods
aoqi@0 185 int open_file(bool required, ADLFILE & adf, const char *action);
aoqi@0 186 void close_file(int delete_out, ADLFILE & adf);
aoqi@0 187 int open_files(void);
aoqi@0 188 void close_files(int delete_out);
aoqi@0 189
aoqi@0 190 Dict _chainRules; // Maps user operand names to ChainRules
aoqi@0 191 Dict _internalOps; // Maps match strings to internal operand names
aoqi@0 192 NameList _internalOpNames; // List internal operand names
aoqi@0 193 Dict _internalMatch; // Map internal name to its MatchNode
aoqi@0 194
aoqi@0 195 NameList _preproc_list; // Preprocessor flag names
aoqi@0 196 FormDict _preproc_table;// Preprocessor flag bindings
aoqi@0 197 char* get_preproc_def(const char* flag);
aoqi@0 198 void set_preproc_def(const char* flag, const char* def);
aoqi@0 199
aoqi@0 200 FormDict& globalNames() {return _globalNames;} // map global names to forms
aoqi@0 201 void initKeywords(FormDict& globals); // Add keywords to global name table
aoqi@0 202
aoqi@0 203 ExprDict& globalDefs() {return _globalDefs;} // map global names to expressions
aoqi@0 204
aoqi@0 205 OperandForm *constructOperand(const char *ident, bool ideal_only);
aoqi@0 206 void initBaseOpTypes(); // Import predefined base types.
aoqi@0 207
aoqi@0 208 void addForm(PreHeaderForm *ptr); // Add objects to pre-header list
aoqi@0 209 void addForm(HeaderForm *ptr); // Add objects to header list
aoqi@0 210 void addForm(SourceForm *ptr); // Add objects to source list
aoqi@0 211 void addForm(EncodeForm *ptr); // Add objects to encode list
aoqi@0 212 void addForm(InstructForm *ptr); // Add objects to the instruct list
aoqi@0 213 void addForm(OperandForm *ptr); // Add objects to the operand list
aoqi@0 214 void addForm(OpClassForm *ptr); // Add objects to the opclasss list
aoqi@0 215 void addForm(AttributeForm *ptr); // Add objects to the attributes list
aoqi@0 216 void addForm(RegisterForm *ptr); // Add objects to the register list
aoqi@0 217 void addForm(FrameForm *ptr); // Add objects to the frame list
aoqi@0 218 void addForm(PipelineForm *ptr); // Add objects to the pipeline list
aoqi@0 219 void addForm(MachNodeForm *ptr); // Add objects to the machnode list
aoqi@0 220
aoqi@0 221 int operandFormCount(); // Count number of OperandForms defined
aoqi@0 222 int opclassFormCount(); // Count number of OpClassForms defined
aoqi@0 223 int instructFormCount(); // Count number of InstructForms defined
aoqi@0 224
aoqi@0 225 inline void getForm(EncodeForm **ptr) { *ptr = _encode; }
aoqi@0 226
aoqi@0 227 bool verify();
aoqi@0 228 void dump();
aoqi@0 229
aoqi@0 230 // Helper utility that gets MatchList components from inside MatchRule
aoqi@0 231 void check_optype(MatchRule *mrule);
aoqi@0 232 void build_chain_rule(OperandForm *oper);
aoqi@0 233 void add_chain_rule_entry(const char *src, const char *cost,
aoqi@0 234 const char *result);
aoqi@0 235 const char *getMatchListIndex(MatchRule &mrule);
aoqi@0 236 void generateMatchLists(); // Build MatchList array and populate it
aoqi@0 237 void inspectOperands(); // Build MatchLists for all operands
aoqi@0 238 void inspectOpClasses(); // Build MatchLists for all operands
aoqi@0 239 void inspectInstructions(); // Build MatchLists for all operands
aoqi@0 240 void buildDFA(FILE *fp); // Driver for constructing the DFA
aoqi@0 241 void gen_dfa_state_body(FILE *fp, Dict &minmize, ProductionState &status, Dict &chained, int i); // Driver for constructing the DFA state bodies
aoqi@0 242
aoqi@0 243 // Helper utilities to generate reduction maps for internal operands
aoqi@0 244 const char *reduceLeft (char *internalName);
aoqi@0 245 const char *reduceRight(char *internalName);
aoqi@0 246
aoqi@0 247 // Build enumerations, (1) dense operand index, (2) operands and opcodes
aoqi@0 248 const char *machOperEnum(const char *opName); // create dense index names using static function
aoqi@0 249 static const char *getMachOperEnum(const char *opName);// create dense index name
aoqi@0 250 void buildMachOperEnum(FILE *fp_hpp);// dense enumeration for operands
aoqi@0 251 void buildMachOpcodesEnum(FILE *fp_hpp);// enumeration for MachOpers & MachNodes
aoqi@0 252
aoqi@0 253 // Helper utilities to generate Register Masks
aoqi@0 254 RegisterForm *get_registers() { return _register; }
aoqi@0 255 const char *reg_mask(OperandForm &opForm);
aoqi@0 256 const char *reg_mask(InstructForm &instForm);
aoqi@0 257 const char *reg_class_to_reg_mask(const char *reg_class);
aoqi@0 258 char *stack_or_reg_mask(OperandForm &opForm); // name of cisc_spillable version
aoqi@0 259 // This register class should also generate a stack_or_reg_mask
aoqi@0 260 void set_stack_or_reg(const char *reg_class_name); // for cisc-spillable reg classes
aoqi@0 261 // Generate an enumeration of register mask names and the RegMask objects.
aoqi@0 262 void declare_register_masks(FILE *fp_cpp);
aoqi@0 263 void build_register_masks(FILE *fp_cpp);
aoqi@0 264 // Generate enumeration of machine register numbers
aoqi@0 265 void buildMachRegisterNumbers(FILE *fp_hpp);
aoqi@0 266 // Generate enumeration of machine register encodings
aoqi@0 267 void buildMachRegisterEncodes(FILE *fp_hpp);
aoqi@0 268 // Generate Regsiter Size Array
aoqi@0 269 void declareRegSizes(FILE *fp_hpp);
aoqi@0 270 // Generate Pipeline Class information
aoqi@0 271 void declare_pipe_classes(FILE *fp_hpp);
aoqi@0 272 // Generate Pipeline definitions
aoqi@0 273 void build_pipeline_enums(FILE *fp_cpp);
aoqi@0 274 // Generate Pipeline Class information
aoqi@0 275 void build_pipe_classes(FILE *fp_cpp);
aoqi@0 276
aoqi@0 277 // Declare and define mappings from rules to result and input types
aoqi@0 278 void build_map(OutputMap &map);
aoqi@0 279 void buildReduceMaps(FILE *fp_hpp, FILE *fp_cpp);
aoqi@0 280 // build flags for signaling that our machine needs this instruction cloned
aoqi@0 281 void buildMustCloneMap(FILE *fp_hpp, FILE *fp_cpp);
aoqi@0 282
aoqi@0 283 // output SUN copyright info
aoqi@0 284 void addSunCopyright(char* legal, int size, FILE *fp);
aoqi@0 285 // output the start of an include guard.
aoqi@0 286 void addIncludeGuardStart(ADLFILE &adlfile, const char* guardString);
aoqi@0 287 // output the end of an include guard.
aoqi@0 288 void addIncludeGuardEnd(ADLFILE &adlfile, const char* guardString);
aoqi@0 289 // output the #include line for this file.
aoqi@0 290 void addInclude(ADLFILE &adlfile, const char* fileName);
aoqi@0 291 void addInclude(ADLFILE &adlfile, const char* includeDir, const char* fileName);
aoqi@0 292 // Output C preprocessor code to verify the backend compilation environment.
aoqi@0 293 void addPreprocessorChecks(FILE *fp);
aoqi@0 294 // Output C source and header (source_hpp) blocks.
aoqi@0 295 void addPreHeaderBlocks(FILE *fp_hpp);
aoqi@0 296 void addHeaderBlocks(FILE *fp_hpp);
aoqi@0 297 void addSourceBlocks(FILE *fp_cpp);
aoqi@0 298 void generate_needs_clone_jvms(FILE *fp_cpp);
aoqi@0 299 void generate_adlc_verification(FILE *fp_cpp);
aoqi@0 300
aoqi@0 301 // output declaration of class State
aoqi@0 302 void defineStateClass(FILE *fp);
aoqi@0 303
aoqi@0 304 // Generator for MachOper objects given integer type
aoqi@0 305 void buildMachOperGenerator(FILE *fp_cpp);
aoqi@0 306 // Generator for MachNode objects given integer type
aoqi@0 307 void buildMachNodeGenerator(FILE *fp_cpp);
aoqi@0 308
aoqi@0 309 // Generator for Expand methods for instructions with expand rules
aoqi@0 310 void defineExpand (FILE *fp, InstructForm *node);
aoqi@0 311 // Generator for Peephole methods for instructions with peephole rules
aoqi@0 312 void definePeephole (FILE *fp, InstructForm *node);
aoqi@0 313 // Generator for Size methods for instructions
aoqi@0 314 void defineSize (FILE *fp, InstructForm &node);
aoqi@0 315
aoqi@0 316 public:
aoqi@0 317 // Generator for EvalConstantValue methods for instructions
aoqi@0 318 void defineEvalConstant(FILE *fp, InstructForm &node);
aoqi@0 319 // Generator for Emit methods for instructions
aoqi@0 320 void defineEmit (FILE *fp, InstructForm &node);
aoqi@0 321 // Generator for postalloc_expand methods for instructions.
aoqi@0 322 void define_postalloc_expand(FILE *fp, InstructForm &node);
aoqi@0 323
aoqi@0 324 // Define a MachOper encode method
aoqi@0 325 void define_oper_interface(FILE *fp, OperandForm &oper, FormDict &globals,
aoqi@0 326 const char *name, const char *encoding);
aoqi@0 327
aoqi@0 328 // Methods to construct the MachNode class hierarchy
aoqi@0 329 // Return the type signature for the ideal operation
aoqi@0 330 const char *getIdealType(const char *idealOp);
aoqi@0 331 // Declare and define the classes derived from MachOper and MachNode
aoqi@0 332 void declareClasses(FILE *fp_hpp);
aoqi@0 333 void defineClasses(FILE *fp_cpp);
aoqi@0 334
aoqi@0 335 // Emit an ADLC message
aoqi@0 336 void internal_err( const char *fmt, ...);
aoqi@0 337 void syntax_err ( int lineno, const char *fmt, ...);
aoqi@0 338 int emit_msg(int quiet, int flag, int linenum, const char *fmt,
aoqi@0 339 va_list args);
aoqi@0 340
aoqi@0 341 // Generator for has_match_rule methods
aoqi@0 342 void buildInstructMatchCheck(FILE *fp_cpp) const;
aoqi@0 343
aoqi@0 344 // Generator for Frame Methods
aoqi@0 345 void buildFrameMethods(FILE *fp_cpp);
aoqi@0 346
aoqi@0 347 // Generate CISC_spilling oracle and MachNode::cisc_spill() methods
aoqi@0 348 void build_cisc_spill_instructions(FILE *fp_hpp, FILE *fp_cpp);
aoqi@0 349 void identify_cisc_spill_instructions();
aoqi@0 350 void identify_short_branches();
aoqi@0 351 void identify_unique_operands();
aoqi@0 352 void set_cisc_spill_operand(OperandForm *opForm) { _cisc_spill_operand = opForm; }
aoqi@0 353 OperandForm *cisc_spill_operand() { return _cisc_spill_operand; }
aoqi@0 354 bool can_cisc_spill() { return _cisc_spill_operand != NULL; }
aoqi@0 355
aoqi@0 356
aoqi@0 357 protected:
aoqi@0 358 // build MatchList from MatchRule
aoqi@0 359 void buildMatchList(MatchRule *mrule, const char *resultStr,
aoqi@0 360 const char *rootOp, Predicate *pred, const char *cost);
aoqi@0 361
aoqi@0 362 void buildMList(MatchNode *node, const char *rootOp, const char *resultOp,
aoqi@0 363 Predicate *pred, const char *cost);
aoqi@0 364
aoqi@0 365 friend class ADLParser;
aoqi@0 366
aoqi@0 367 };
aoqi@0 368
aoqi@0 369
aoqi@0 370 // -------------------------------- maps ------------------------------------
aoqi@0 371
aoqi@0 372 // Base class for generating a mapping from rule number to value.
aoqi@0 373 // Used with ArchDesc::build_map() for all maps except "enum MachOperands"
aoqi@0 374 // A derived class defines the appropriate output for a specific mapping.
aoqi@0 375 class OutputMap {
aoqi@0 376 protected:
aoqi@0 377 FILE *_hpp;
aoqi@0 378 FILE *_cpp;
aoqi@0 379 FormDict &_globals;
aoqi@0 380 ArchDesc &_AD;
aoqi@0 381 const char *_name;
aoqi@0 382 public:
aoqi@0 383 OutputMap (FILE *decl_file, FILE *def_file, FormDict &globals, ArchDesc &AD, const char *name)
aoqi@0 384 : _hpp(decl_file), _cpp(def_file), _globals(globals), _AD(AD), _name(name) {};
aoqi@0 385 // Access files used by this routine
aoqi@0 386 FILE *decl_file() { return _hpp; }
aoqi@0 387 FILE *def_file() { return _cpp; }
aoqi@0 388 // Positions in iteration that derived class will be told about
aoqi@0 389 enum position { BEGIN_OPERANDS,
aoqi@0 390 BEGIN_OPCLASSES,
aoqi@0 391 BEGIN_INTERNALS,
aoqi@0 392 BEGIN_INSTRUCTIONS,
aoqi@0 393 BEGIN_INST_CHAIN_RULES,
aoqi@0 394 END_INST_CHAIN_RULES,
aoqi@0 395 BEGIN_REMATERIALIZE,
aoqi@0 396 END_REMATERIALIZE,
aoqi@0 397 END_INSTRUCTIONS
aoqi@0 398 };
aoqi@0 399 // Output routines specific to the derived class
aoqi@0 400 virtual void declaration() {}
aoqi@0 401 virtual void definition() {}
aoqi@0 402 virtual void closing() { fprintf(_cpp, "};\n"); }
aoqi@0 403 virtual void map(OperandForm &oper) { }
aoqi@0 404 virtual void map(OpClassForm &opc) { }
aoqi@0 405 virtual void map(char *internal_name) { }
aoqi@0 406 // Allow enum-MachOperands to turn-off instructions
aoqi@0 407 virtual bool do_instructions() { return true; }
aoqi@0 408 virtual void map(InstructForm &inst) { }
aoqi@0 409 // Allow derived class to output name and position specific info
aoqi@0 410 virtual void record_position(OutputMap::position place, int index) {}
aoqi@0 411 };
aoqi@0 412
aoqi@0 413 #endif // SHARE_VM_ADLC_ARCHDESC_HPP

mercurial