-struct gcc_target
-{
- /* Functions that output assembler for the target. */
- struct asm_out
- {
- /* Opening and closing parentheses for asm expression grouping. */
- const char *open_paren, *close_paren;
-
- /* Assembler instructions for creating various kinds of integer object. */
- const char *byte_op;
- struct asm_int_op
- {
- const char *hi;
- const char *si;
- const char *di;
- const char *ti;
- } aligned_op, unaligned_op;
-
- /* Try to output the assembler code for an integer object whose
- value is given by X. SIZE is the size of the object in bytes and
- ALIGNED_P indicates whether it is aligned. Return true if
- successful. Only handles cases for which BYTE_OP, ALIGNED_OP
- and UNALIGNED_OP are NULL. */
- bool (* integer) (rtx x, unsigned int size, int aligned_p);
-
- /* Output code that will globalize a label. */
- void (* globalize_label) (FILE *, const char *);
-
- /* Output code that will globalize a declaration. */
- void (* globalize_decl_name) (FILE *, tree);
-
- /* Output code that will emit a label for unwind info, if this
- target requires such labels. Second argument is the decl the
- unwind info is associated with, third is a boolean: true if
- this is for exception handling, fourth is a boolean: true if
- this is only a placeholder for an omitted FDE. */
- void (* unwind_label) (FILE *, tree, int, int);
-
- /* Output code that will emit a label to divide up the exception
- table. */
- void (* except_table_label) (FILE *);
-
- /* Emit any directives required to unwind this instruction. */
- void (* unwind_emit) (FILE *, rtx);
-
- /* Output an internal label. */
- void (* internal_label) (FILE *, const char *, unsigned long);
-
- /* Emit a ttype table reference to a typeinfo object. */
- bool (* ttype) (rtx);
-
- /* Emit an assembler directive to set visibility for the symbol
- associated with the tree decl. */
- void (* visibility) (tree, int);
-
- /* Output the assembler code for entry to a function. */
- void (* function_prologue) (FILE *, HOST_WIDE_INT);
-
- /* Output the assembler code for end of prologue. */
- void (* function_end_prologue) (FILE *);
-
- /* Output the assembler code for start of epilogue. */
- void (* function_begin_epilogue) (FILE *);
-
- /* Output the assembler code for function exit. */
- void (* function_epilogue) (FILE *, HOST_WIDE_INT);
-
- /* Initialize target-specific sections. */
- void (* init_sections) (void);
-
- /* Tell assembler to change to section NAME with attributes FLAGS.
- If DECL is non-NULL, it is the VAR_DECL or FUNCTION_DECL with
- which this section is associated. */
- void (* named_section) (const char *name, unsigned int flags, tree decl);
-
- /* Return a mask describing how relocations should be treated when
- selecting sections. Bit 1 should be set if global relocations
- should be placed in a read-write section; bit 0 should be set if
- local relocations should be placed in a read-write section. */
- int (*reloc_rw_mask) (void);
-
- /* Return a section for EXP. It may be a DECL or a constant. RELOC
- is nonzero if runtime relocations must be applied; bit 1 will be
- set if the runtime relocations require non-local name resolution.
- ALIGN is the required alignment of the data. */
- section *(* select_section) (tree, int, unsigned HOST_WIDE_INT);
-
- /* Return a section for X. MODE is X's mode and ALIGN is its
- alignment in bits. */
- section *(* select_rtx_section) (enum machine_mode, rtx,
- unsigned HOST_WIDE_INT);
-
- /* Select a unique section name for DECL. RELOC is the same as
- for SELECT_SECTION. */
- void (* unique_section) (tree, int);
-
- /* Return the readonly data section associated with function DECL. */
- section *(* function_rodata_section) (tree);
-
- /* Output a constructor for a symbol with a given priority. */
- void (* constructor) (rtx, int);
-
- /* Output a destructor for a symbol with a given priority. */
- void (* destructor) (rtx, int);
-
- /* Output the assembler code for a thunk function. THUNK_DECL is the
- declaration for the thunk function itself, FUNCTION is the decl for
- the target function. DELTA is an immediate constant offset to be
- added to THIS. If VCALL_OFFSET is nonzero, the word at
- *(*this + vcall_offset) should be added to THIS. */
- void (* output_mi_thunk) (FILE *file, tree thunk_decl,
- HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
- tree function_decl);
-
- /* Determine whether output_mi_thunk would succeed. */
- /* ??? Ideally, this hook would not exist, and success or failure
- would be returned from output_mi_thunk directly. But there's
- too much undo-able setup involved in invoking output_mi_thunk.
- Could be fixed by making output_mi_thunk emit rtl instead of
- text to the output file. */
- bool (* can_output_mi_thunk) (const_tree thunk_decl, HOST_WIDE_INT delta,
- HOST_WIDE_INT vcall_offset,
- const_tree function_decl);
-
- /* Output any boilerplate text needed at the beginning of a
- translation unit. */
- void (*file_start) (void);
-
- /* Output any boilerplate text needed at the end of a
- translation unit. */
- void (*file_end) (void);
-
- /* Output an assembler pseudo-op to declare a library function name
- external. */
- void (*external_libcall) (rtx);
-
- /* Output an assembler directive to mark decl live. This instructs
- linker to not dead code strip this symbol. */
- void (*mark_decl_preserved) (const char *);
-
- /* Output a record of the command line switches that have been passed. */
- print_switch_fn_type record_gcc_switches;
- /* The name of the section that the example ELF implementation of
- record_gcc_switches will use to store the information. Target
- specific versions of record_gcc_switches may or may not use
- this information. */
- const char * record_gcc_switches_section;
-
- /* Output the definition of a section anchor. */
- void (*output_anchor) (rtx);
-
- /* Output a DTP-relative reference to a TLS symbol. */
- void (*output_dwarf_dtprel) (FILE *file, int size, rtx x);
-
- } asm_out;
-
- /* Functions relating to instruction scheduling. */
- struct sched
- {
- /* Given the current cost, COST, of an insn, INSN, calculate and
- return a new cost based on its relationship to DEP_INSN through
- the dependence LINK. The default is to make no adjustment. */
- int (* adjust_cost) (rtx insn, rtx link, rtx dep_insn, int cost);
-
- /* Adjust the priority of an insn as you see fit. Returns the new
- priority. */
- int (* adjust_priority) (rtx, int);
-
- /* Function which returns the maximum number of insns that can be
- scheduled in the same machine cycle. This must be constant
- over an entire compilation. The default is 1. */
- int (* issue_rate) (void);
-
- /* Calculate how much this insn affects how many more insns we
- can emit this cycle. Default is they all cost the same. */
- int (* variable_issue) (FILE *, int, rtx, int);
-
- /* Initialize machine-dependent scheduling code. */
- void (* md_init) (FILE *, int, int);
-
- /* Finalize machine-dependent scheduling code. */
- void (* md_finish) (FILE *, int);
-
- /* Initialize machine-dependent function wide scheduling code. */
- void (* md_init_global) (FILE *, int, int);
-
- /* Finalize machine-dependent function wide scheduling code. */
- void (* md_finish_global) (FILE *, int);
-
- /* Reorder insns in a machine-dependent fashion, in two different
- places. Default does nothing. */
- int (* reorder) (FILE *, int, rtx *, int *, int);
- int (* reorder2) (FILE *, int, rtx *, int *, int);
-
- /* The following member value is a pointer to a function called
- after evaluation forward dependencies of insns in chain given
- by two parameter values (head and tail correspondingly). */
- void (* dependencies_evaluation_hook) (rtx, rtx);
-
- /* The values of the following four members are pointers to
- functions used to simplify the automaton descriptions.
- dfa_pre_cycle_insn and dfa_post_cycle_insn give functions
- returning insns which are used to change the pipeline hazard
- recognizer state when the new simulated processor cycle
- correspondingly starts and finishes. The function defined by
- init_dfa_pre_cycle_insn and init_dfa_post_cycle_insn are used
- to initialize the corresponding insns. The default values of
- the members result in not changing the automaton state when
- the new simulated processor cycle correspondingly starts and
- finishes. */
- void (* init_dfa_pre_cycle_insn) (void);
- rtx (* dfa_pre_cycle_insn) (void);
- void (* init_dfa_post_cycle_insn) (void);
- rtx (* dfa_post_cycle_insn) (void);
-
- /* The values of the following two members are pointers to
- functions used to simplify the automaton descriptions.
- dfa_pre_advance_cycle and dfa_post_advance_cycle are getting called
- immediately before and after cycle is advanced. */
- void (* dfa_pre_advance_cycle) (void);
- void (* dfa_post_advance_cycle) (void);
-
- /* The following member value is a pointer to a function returning value
- which defines how many insns in queue `ready' will we try for
- multi-pass scheduling. If the member value is nonzero and the
- function returns positive value, the DFA based scheduler will make
- multi-pass scheduling for the first cycle. In other words, we will
- try to choose ready insn which permits to start maximum number of
- insns on the same cycle. */
- int (* first_cycle_multipass_dfa_lookahead) (void);
-
- /* The following member value is pointer to a function controlling
- what insns from the ready insn queue will be considered for the
- multipass insn scheduling. If the hook returns zero for insn
- passed as the parameter, the insn will be not chosen to be
- issued. */
- int (* first_cycle_multipass_dfa_lookahead_guard) (rtx);
-
- /* The following member value is pointer to a function called by
- the insn scheduler before issuing insn passed as the third
- parameter on given cycle. If the hook returns nonzero, the
- insn is not issued on given processors cycle. Instead of that,
- the processor cycle is advanced. If the value passed through
- the last parameter is zero, the insn ready queue is not sorted
- on the new cycle start as usually. The first parameter passes
- file for debugging output. The second one passes the scheduler
- verbose level of the debugging output. The forth and the fifth
- parameter values are correspondingly processor cycle on which
- the previous insn has been issued and the current processor
- cycle. */
- int (* dfa_new_cycle) (FILE *, int, rtx, int, int, int *);
-
- /* The following member value is a pointer to a function called by the
- insn scheduler. It should return true if there exists a dependence
- which is considered costly by the target, between the insn
- DEP_PRO (&_DEP), and the insn DEP_CON (&_DEP). The first parameter is
- the dep that represents the dependence between the two insns. The
- second argument is the cost of the dependence as estimated by
- the scheduler. The last argument is the distance in cycles
- between the already scheduled insn (first parameter) and the
- second insn (second parameter). */
- bool (* is_costly_dependence) (struct _dep *_dep, int, int);
-
- /* Given the current cost, COST, of an insn, INSN, calculate and
- return a new cost based on its relationship to DEP_INSN through the
- dependence of type DEP_TYPE. The default is to make no adjustment. */
- int (* adjust_cost_2) (rtx insn, int, rtx dep_insn, int cost, int dw);
-
- /* The following member value is a pointer to a function called
- by the insn scheduler. This hook is called to notify the backend
- that new instructions were emitted. */
- void (* h_i_d_extended) (void);
-
- /* Next 5 functions are for multi-point scheduling. */
-
- /* Allocate memory for scheduler context. */
- void *(* alloc_sched_context) (void);
-
- /* Fills the context from the local machine scheduler context. */
- void (* init_sched_context) (void *, bool);
-
- /* Sets local machine scheduler context to a saved value. */
- void (* set_sched_context) (void *);
-
- /* Clears a scheduler context so it becomes like after init. */
- void (* clear_sched_context) (void *);
-
- /* Frees the scheduler context. */
- void (* free_sched_context) (void *);
-
- /* The following member value is a pointer to a function called
- by the insn scheduler.
- The first parameter is an instruction, the second parameter is the type
- of the requested speculation, and the third parameter is a pointer to the
- speculative pattern of the corresponding type (set if return value == 1).
- It should return
- -1, if there is no pattern, that will satisfy the requested speculation
- type,
- 0, if current pattern satisfies the requested speculation type,
- 1, if pattern of the instruction should be changed to the newly
- generated one. */
- int (* speculate_insn) (rtx, int, rtx *);
-
- /* The following member value is a pointer to a function called
- by the insn scheduler. It should return true if the check instruction
- passed as the parameter needs a recovery block. */
- bool (* needs_block_p) (int);
-
- /* The following member value is a pointer to a function called
- by the insn scheduler. It should return a pattern for the check
- instruction.
- The first parameter is a speculative instruction, the second parameter
- is the label of the corresponding recovery block (or null, if it is a
- simple check). If the mutation of the check is requested (e.g. from
- ld.c to chk.a), the third parameter is true - in this case the first
- parameter is the previous check. */
- rtx (* gen_spec_check) (rtx, rtx, int);
-
- /* The following member value is a pointer to a function controlling
- what insns from the ready insn queue will be considered for the
- multipass insn scheduling. If the hook returns zero for the insn
- passed as the parameter, the insn will not be chosen to be
- issued. This hook is used to discard speculative instructions,
- that stand at the first position of the ready list. */
- bool (* first_cycle_multipass_dfa_lookahead_guard_spec) (const_rtx);
-
- /* The following member value is a pointer to a function that provides
- information about the speculation capabilities of the target.
- The parameter is a pointer to spec_info variable. */
- void (* set_sched_flags) (struct spec_info_def *);
-
- /* Return speculation types of the instruction passed as the parameter. */
- int (* get_insn_spec_ds) (rtx);
-
- /* Return speculation types that are checked for the instruction passed as
- the parameter. */
- int (* get_insn_checked_ds) (rtx);
-
- /* Return bool if rtx scanning should just skip current layer and
- advance to the inner rtxes. */
- bool (* skip_rtx_p) (const_rtx);
-
- /* The following member value is a pointer to a function that provides
- information about the target resource-based lower bound which is
- used by the swing modulo scheduler. The parameter is a pointer
- to ddg variable. */
- int (* sms_res_mii) (struct ddg *);
- } sched;
-
- /* Functions relating to vectorization. */
- struct vectorize
- {
- /* The following member value is a pointer to a function called
- by the vectorizer, and return the decl of the target builtin
- function. */
- tree (* builtin_mask_for_load) (void);
-
- /* Returns a code for builtin that realizes vectorized version of
- function, or NULL_TREE if not available. */
- tree (* builtin_vectorized_function) (unsigned, tree, tree);
-
- /* Returns a code for builtin that realizes vectorized version of
- conversion, or NULL_TREE if not available. */
- tree (* builtin_conversion) (unsigned, tree);
-
- /* Target builtin that implements vector widening multiplication.
- builtin_mul_widen_eve computes the element-by-element products
- for the even elements, and builtin_mul_widen_odd computes the
- element-by-element products for the odd elements. */
- tree (* builtin_mul_widen_even) (tree);
- tree (* builtin_mul_widen_odd) (tree);
-
- /* Returns the cost to be added to the overheads involved with
- executing the vectorized version of a loop. */
- int (*builtin_vectorization_cost) (bool);
-
- /* Return true if vector alignment is reachable (by peeling N
- iterations) for the given type. */
- bool (* vector_alignment_reachable) (const_tree, bool);
-
- /* Target builtin that implements vector permute. */
- tree (* builtin_vec_perm) (tree, tree*);
-} vectorize;
-
- /* The initial value of target_flags. */
- int default_target_flags;
-
- /* Handle target switch CODE (an OPT_* value). ARG is the argument
- passed to the switch; it is NULL if no argument was. VALUE is the
- value of ARG if CODE specifies a UInteger option, otherwise it is
- 1 if the positive form of the switch was used and 0 if the negative
- form was. Return true if the switch was valid. */
- bool (* handle_option) (size_t code, const char *arg, int value);
-
- /* Display extra, target specific information in response to a
- --target-help switch. */
- void (* target_help) (void);
-
- /* Return machine mode for filter value. */
- enum machine_mode (* eh_return_filter_mode) (void);
-
- /* Return machine mode for libgcc expanded cmp instructions. */
- enum machine_mode (* libgcc_cmp_return_mode) (void);
-
- /* Return machine mode for libgcc expanded shift instructions. */
- enum machine_mode (* libgcc_shift_count_mode) (void);
-
- /* Return machine mode to be used for _Unwind_Word type. */
- enum machine_mode (* unwind_word_mode) (void);
-
- /* Given two decls, merge their attributes and return the result. */
- tree (* merge_decl_attributes) (tree, tree);
-
- /* Given two types, merge their attributes and return the result. */
- tree (* merge_type_attributes) (tree, tree);
-
- /* Table of machine attributes and functions to handle them.
- Ignored if NULL. */
- const struct attribute_spec *attribute_table;
-
- /* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
- one if they are compatible and two if they are nearly compatible
- (which causes a warning to be generated). */
- int (* comp_type_attributes) (const_tree type1, const_tree type2);
-
- /* Assign default attributes to the newly defined TYPE. */
- void (* set_default_type_attributes) (tree type);
-
- /* Insert attributes on the newly created DECL. */
- void (* insert_attributes) (tree decl, tree *attributes);
-
- /* Return true if FNDECL (which has at least one machine attribute)
- can be inlined despite its machine attributes, false otherwise. */
- bool (* function_attribute_inlinable_p) (const_tree fndecl);
-
- /* Return true if bitfields in RECORD_TYPE should follow the
- Microsoft Visual C++ bitfield layout rules. */
- bool (* ms_bitfield_layout_p) (const_tree record_type);
-
- /* True if the target supports decimal floating point. */
- bool (* decimal_float_supported_p) (void);
-
- /* True if the target supports fixed-point. */
- bool (* fixed_point_supported_p) (void);
-
- /* Return true if anonymous bitfields affect structure alignment. */
- bool (* align_anon_bitfield) (void);
-
- /* Return true if volatile bitfields should use the narrowest type possible.
- Return false if they should use the container type. */
- bool (* narrow_volatile_bitfield) (void);
-
- /* Set up target-specific built-in functions. */
- void (* init_builtins) (void);
-
- /* Expand a target-specific builtin. */
- rtx (* expand_builtin) (tree exp, rtx target, rtx subtarget,
- enum machine_mode mode, int ignore);
-
- /* Select a replacement for a target-specific builtin. This is done
- *before* regular type checking, and so allows the target to implement
- a crude form of function overloading. The result is a complete
- expression that implements the operation. */
- tree (*resolve_overloaded_builtin) (tree decl, tree params);
-
- /* Fold a target-specific builtin. */
- tree (* fold_builtin) (tree fndecl, tree arglist, bool ignore);
-
- /* Returns a code for a target-specific builtin that implements
- reciprocal of the function, or NULL_TREE if not available. */
- tree (* builtin_reciprocal) (unsigned, bool, bool);
-
- /* For a vendor-specific TYPE, return a pointer to a statically-allocated
- string containing the C++ mangling for TYPE. In all other cases, return
- NULL. */
- const char * (* mangle_type) (const_tree type);
-
- /* Make any adjustments to libfunc names needed for this target. */
- void (* init_libfuncs) (void);
-
- /* Given a decl, a section name, and whether the decl initializer
- has relocs, choose attributes for the section. */
- /* ??? Should be merged with SELECT_SECTION and UNIQUE_SECTION. */
- unsigned int (* section_type_flags) (tree, const char *, int);
-
- /* True if new jumps cannot be created, to replace existing ones or
- not, at the current point in the compilation. */
- bool (* cannot_modify_jumps_p) (void);
-
- /* Return a register class for which branch target register
- optimizations should be applied. */
- int (* branch_target_register_class) (void);