/* Data structure definitions for a generic GCC target.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
/* Finalize machine-dependent scheduling code. */
void (* md_finish) (FILE *, int);
- /* Initialize machine-dependent function while scheduling code. */
+ /* Initialize machine-dependent function wide scheduling code. */
void (* md_init_global) (FILE *, int, int);
/* Finalize machine-dependent function wide scheduling code. */
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
- the second insn (second parameter). */
+ 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
/* The following member value is a pointer to a function called
by the insn scheduler. It should return true if the check instruction
- corresponding to the instruction passed as the parameter needs a
- recovery block. */
- bool (* needs_block_p) (const_rtx);
+ 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
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_check) (rtx, rtx, bool);
+ 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
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
/* Return true if vector alignment is reachable (by peeling N
iterations) for the given type. */
bool (* vector_alignment_reachable) (const_tree, bool);
- } vectorize;
+
+ /* Target builtin that implements vector permute. */
+ tree (* builtin_vec_perm) (tree, tree*);
+} vectorize;
/* The initial value of target_flags. */
int default_target_flags;
/* 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);
scanned. In either case, *TOTAL contains the cost result. */
/* Note that CODE and OUTER_CODE ought to be RTX_CODE, but that's
not necessarily defined at this point. */
- bool (* rtx_costs) (rtx x, int code, int outer_code, int *total);
+ bool (* rtx_costs) (rtx x, int code, int outer_code, int *total, bool speed);
/* Compute the cost of X, used as an address. Never called with
invalid addresses. */
- int (* address_cost) (rtx x);
+ int (* address_cost) (rtx x, bool speed);
/* Return where to allocate pseudo for a given hard register initial
value. */
/* Create the __builtin_va_list type. */
tree (* build_builtin_va_list) (void);
+ /* Get the cfun/fndecl calling abi __builtin_va_list type. */
+ tree (* fn_abi_va_list) (tree);
+
+ /* Get the __builtin_va_list type dependent on input type. */
+ tree (* canonical_va_list_type) (tree);
+
+ /* Expand the __builtin_va_start builtin. */
+ void (* expand_builtin_va_start) (tree valist, rtx nextarg);
+
/* Gimplifies a VA_ARG_EXPR. */
- tree (* gimplify_va_arg_expr) (tree valist, tree type, tree *pre_p,
- tree *post_p);
+ tree (* gimplify_va_arg_expr) (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p);
/* Validity-checking routines for PCH files, target-specific.
get_pch_validity returns a pointer to the data to be stored,
void (* dwarf_handle_frame_unspec) (const char *, rtx, int);
/* Perform architecture specific checking of statements gimplified
- from VA_ARG_EXPR. LHS is left hand side of MODIFY_EXPR, RHS
- is right hand side. Returns true if the statements doesn't need
- to be checked for va_list references. */
- bool (* stdarg_optimize_hook) (struct stdarg_info *ai, const_tree lhs, const_tree rhs);
+ from VA_ARG_EXPR. STMT is the statement. Returns true if the statement
+ doesn't need to be checked for va_list references. */
+ bool (* stdarg_optimize_hook) (struct stdarg_info *ai, const_gimple stmt);
/* This target hook allows the operating system to override the DECL
that represents the external variable that contains the stack
/* Return an rtx for the argument pointer incoming to the
current function. */
rtx (*internal_arg_pointer) (void);
+
+ /* Update the current function stack boundary if needed. */
+ void (*update_stack_boundary) (void);
+
+ /* Handle stack alignment and return an rtx for Dynamic Realign
+ Argument Pointer if necessary. */
+ rtx (*get_drap_rtx) (void);
+
+ /* Return true if all function parameters should be spilled to the
+ stack. */
+ bool (*allocate_stack_slots_for_args) (void);
+
} calls;
/* Return the diagnostic message string if conversion from FROMTYPE
is not permitted on TYPE1 and TYPE2, NULL otherwise. */
const char *(*invalid_binary_op) (int op, const_tree type1, const_tree type2);
+ /* Return the array of IRA cover classes for the current target. */
+ const enum reg_class *(*ira_cover_classes) (void);
+
/* Return the class for a secondary reload, and fill in extra information. */
enum reg_class (*secondary_reload) (bool, rtx, enum reg_class,
enum machine_mode,
struct secondary_reload_info *);
+ /* This target hook allows the backend to perform additional
+ processing while initializing for variable expansion. */
+ void (* expand_to_rtl_hook) (void);
+
+ /* This target hook allows the backend to perform additional
+ instantiations on rtx that are not actually in insns yet,
+ but will be later. */
+ void (* instantiate_decls) (void);
+
+ /* Return true if is OK to use a hard register REGNO as scratch register
+ in peephole2. */
+ bool (* hard_regno_scratch_ok) (unsigned int regno);
+
/* Functions specific to the C family of frontends. */
struct c {
/* Return machine mode for non-standard suffix
void (*adjust_class_at_definition) (tree type);
} cxx;
+ /* Functions and data for emulated TLS support. */
+ struct emutls {
+ /* Name of the address and common functions. */
+ const char *get_address;
+ const char *register_common;
+
+ /* Prefixes for proxy variable and template. */
+ const char *var_section;
+ const char *tmpl_section;
+
+ /* Prefixes for proxy variable and template. */
+ const char *var_prefix;
+ const char *tmpl_prefix;
+
+ /* Function to generate field definitions of the proxy variable. */
+ tree (*var_fields) (tree, tree *);
+
+ /* Function to initialize a proxy variable. */
+ tree (*var_init) (tree, tree, tree);
+
+ /* Whether we are allowed to alter the usual alignment of the
+ proxy variable. */
+ bool var_align_fixed;
+
+ /* Whether we can emit debug information for TLS vars. */
+ bool debug_form_tls_address;
+ } emutls;
+
+ struct target_option_hooks {
+ /* Function to validate the attribute((option(...))) strings or NULL. If
+ the option is validated, it is assumed that DECL_FUNCTION_SPECIFIC will
+ be filled in in the function decl node. */
+ bool (*valid_attribute_p) (tree, tree, tree, int);
+
+ /* Function to save any extra target state in the target options
+ structure. */
+ void (*save) (struct cl_target_option *);
+
+ /* Function to restore any extra target state from the target options
+ structure. */
+ void (*restore) (struct cl_target_option *);
+
+ /* Function to print any extra target state from the target options
+ structure. */
+ void (*print) (FILE *, int, struct cl_target_option *);
+
+ /* Function to parse arguments to be validated for #pragma option, and to
+ change the state if the options are valid. If the first argument is
+ NULL, the second argument specifies the default options to use. Return
+ true if the options are valid, and set the current state. */
+ bool (*pragma_parse) (tree, tree);
+
+ /* Function to determine if one function can inline another function. */
+ bool (*can_inline_p) (tree, tree);
+ } target_option;
+
/* For targets that need to mark extra registers as live on entry to
the function, they should define this target hook and set their
bits in the bitmap passed in. */