GCC Middle and Back End API Reference
recog.h File Reference

Go to the source code of this file.

Data Structures

struct  operand_alternative
struct  recog_data_d
struct  insn_gen_fn
struct  insn_operand_data
struct  insn_data_d

Typedefs

typedef int(* insn_operand_predicate_fn )(rtx, enum machine_mode)
typedef const char *(* insn_output_fn )(rtx *, rtx)

Enumerations

enum  op_type { OP_IN, OP_OUT, OP_INOUT }

Functions

void init_recog (void)
void init_recog_no_volatile (void)
int check_asm_operands (rtx)
int asm_operand_ok (rtx, const char *, const char **)
bool validate_change (rtx, rtx *, rtx, bool)
bool validate_unshare_change (rtx, rtx *, rtx, bool)
bool canonicalize_change_group (rtx insn, rtx x)
int insn_invalid_p (rtx, bool)
int verify_changes (int)
void confirm_change_group (void)
int apply_change_group (void)
int num_validated_changes (void)
void cancel_changes (int)
int constrain_operands (int)
int constrain_operands_cached (int)
int memory_address_addr_space_p (enum machine_mode, rtx, addr_space_t)
int strict_memory_address_addr_space_p (enum machine_mode, rtx, addr_space_t)
int validate_replace_rtx_subexp (rtx, rtx, rtx, rtx *)
int validate_replace_rtx (rtx, rtx, rtx)
int validate_replace_rtx_part (rtx, rtx, rtx *, rtx)
int validate_replace_rtx_part_nosimplify (rtx, rtx, rtx *, rtx)
void validate_replace_rtx_group (rtx, rtx, rtx)
void validate_replace_src_group (rtx, rtx, rtx)
bool validate_simplify_insn (rtx insn)
int num_changes_pending (void)
int next_insn_tests_no_inequality (rtx)
bool reg_fits_class_p (const_rtx, reg_class_t, int, enum machine_mode)
int offsettable_memref_p (rtx)
int offsettable_nonstrict_memref_p (rtx)
int offsettable_address_addr_space_p (int, enum machine_mode, rtx, addr_space_t)
bool mode_dependent_address_p (rtx, addr_space_t)
int recog (rtx, rtx, int *)
static int recog_memoized (rtx insn)
void add_clobbers (rtx, int)
int added_clobbers_hard_reg_p (int)
void insn_extract (rtx)
void extract_insn (rtx)
void extract_constrain_insn_cached (rtx)
void extract_insn_cached (rtx)
void preprocess_constraints (void)
rtx peep2_next_insn (int)
int peep2_regno_dead_p (int, int)
int peep2_reg_dead_p (int, rtx)
rtx peep2_find_free_register (int, int, const char *, enum machine_mode, HARD_REG_SET *)
rtx peephole2_insns (rtx, rtx, int *)
int store_data_bypass_p (rtx, rtx)
int if_test_bypass_p (rtx, rtx)
static int recog_memoized ()
static const char * skip_alternative ()

Variables

int volatile_ok
int which_alternative
struct recog_data_d recog_data
struct operand_alternative recog_op_alt [MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES]
struct insn_data_d insn_data []
int peep2_current_count

Typedef Documentation

typedef int(* insn_operand_predicate_fn)(rtx, enum machine_mode)
A table defined in insn-output.c that give information about
   each insn-code value.   
typedef const char*(* insn_output_fn)(rtx *, rtx)

Enumeration Type Documentation

enum op_type
Types of operands.   
Enumerator:
OP_IN 
OP_OUT 
OP_INOUT 

Function Documentation

void add_clobbers ( rtx  ,
int   
)
int added_clobbers_hard_reg_p ( int  )
int asm_operand_ok ( rtx  ,
const char *  ,
const char **   
)
void cancel_changes ( int  )
bool canonicalize_change_group ( rtx  insn,
rtx  x 
)
int check_asm_operands ( rtx  )
void confirm_change_group ( void  )
A group of changes has previously been issued with validate_change
   and verified with verify_changes.  Call df_insn_rescan for each of
   the insn changed and clear num_changes.   

References copy_rtx(), df_insn_rescan(), change_t::loc, num_changes, and change_t::object.

Referenced by apply_change_group(), dead_or_predicable(), redirect_jump_2(), reload_as_needed(), and try_fwprop_subst().

int constrain_operands ( int  )
int constrain_operands_cached ( int  )
void extract_constrain_insn_cached ( rtx  )
void extract_insn ( rtx  )
void extract_insn_cached ( rtx  )
int if_test_bypass_p ( rtx  ,
rtx   
)
void init_recog_no_volatile ( void  )
Initialize data used by the function `recog'.
   This must be called once in the compilation of a function
   before any insn recognition may be done in the function.   

References volatile_ok.

Referenced by combine_instructions(), expand_function_start(), and rest_of_clean_state().

void insn_extract ( rtx  )
int insn_invalid_p ( rtx  ,
bool   
)
bool mode_dependent_address_p ( rtx  ,
addr_space_t   
)
int next_insn_tests_no_inequality ( rtx  )
int num_changes_pending ( void  )
Return number of changes made and not validated yet.   

References num_changes.

Referenced by forward_propagate_asm(), regmove_backward_pass(), try_replace_reg(), and validate_simplify_insn().

int num_validated_changes ( void  )
Return the number of changes so far in the current group.   

References num_changes.

Referenced by dead_or_predicable(), decompose_multiword_subregs(), invert_jump_1(), redirect_jump_1(), and resolve_reg_notes().

int offsettable_address_addr_space_p ( int  strictp,
enum machine_mode  mode,
rtx  y,
addr_space_t  as 
)
Return 1 if Y is a memory address which contains no side effects
   and would remain valid for address space AS after the addition of
   a positive integer less than the size of that mode.

   We assume that the original address is valid and do not check it.
   We do check that it is valid for narrower modes.

   If STRICTP is nonzero, we require a strictly valid address,
   for the sake of use in reload.c.   

References find_constant_term_loc(), memory_address_addr_space_p(), mode_dependent_address_p(), plus_constant(), RTX_AUTOINC, strict_memory_address_addr_space_p(), and targetm.

Referenced by offsettable_memref_p(), and offsettable_nonstrict_memref_p().

int offsettable_memref_p ( rtx  )
int offsettable_nonstrict_memref_p ( rtx  )
rtx peep2_find_free_register ( int  from,
int  to,
const char *  class_str,
enum machine_mode  mode,
HARD_REG_SET reg_set 
)
Try to find a hard register of mode MODE, matching the register class in
   CLASS_STR, which is available at the beginning of insn CURRENT_INSN and
   remains available until the end of LAST_INSN.  LAST_INSN may be NULL_RTX,
   in which case the only condition is that the register must be available
   before CURRENT_INSN.
   Registers that already have bits set in REG_SET will not be considered.

   If an appropriate register is available, it will be returned and the
   corresponding bit(s) in REG_SET will be set; otherwise, NULL_RTX is
   returned.   

References add_to_hard_reg_set(), df_regs_ever_live_p(), gen_rtx_REG(), global_regs, peep2_insn_data::insn, live, peep2_insn_data::live_before, peep2_buf_position(), peep2_current, reload_completed, and targetm.

rtx peep2_next_insn ( int  )
int peep2_reg_dead_p ( int  ,
rtx   
)
int peep2_regno_dead_p ( int  ,
int   
)
rtx peephole2_insns ( rtx  ,
rtx  ,
int *   
)

Referenced by peephole2_optimize().

static int recog_memoized ( )
inlinestatic
Try recognizing the instruction INSN,
   and return the code number that results.
   Remember the code so that repeated calls do not
   need to spend the time for actual rerecognition.

   This function is the normal interface to instruction recognition.
   The automatically-generated function `recog' is normally called
   through this one.   

References recog().

bool reg_fits_class_p ( const_rtx  operand,
reg_class_t  cl,
int  offset,
enum machine_mode  mode 
)
Return true iff OPERAND (assumed to be a REG rtx)
   is a hard reg in class CLASS when its regno is offset by OFFSET
   and changed to mode MODE.
   If REG occupies multiple hard regs, all of them must be in CLASS.   

References in_hard_reg_set_p().

Referenced by constrain_operands(), find_reloads(), record_reg_classes(), and reload_cse_simplify_operands().

static const char* skip_alternative ( )
inlinestatic
Skip chars until the next ',' or the end of the string.  This is
   useful to skip alternatives in a constraint string.   

Referenced by constrain_operands(), find_reloads(), preprocess_constraints(), and record_reg_classes().

int store_data_bypass_p ( rtx  ,
rtx   
)
int strict_memory_address_addr_space_p ( enum machine_mode  mode,
rtx  addr,
addr_space_t  as 
)
Return 1 if ADDR is a valid memory address for mode MODE
   in address space AS, and check that each pseudo reg has the
   proper kind of hard reg.   

References replacement::mode, and targetm.

Referenced by constrain_operands(), find_reloads_address(), find_reloads_subreg_address(), get_secondary_mem(), offsettable_address_addr_space_p(), operand_subword(), and reload().

bool validate_change ( rtx  ,
rtx ,
rtx  ,
bool   
)
int validate_replace_rtx ( rtx  ,
rtx  ,
rtx   
)
void validate_replace_rtx_group ( rtx  ,
rtx  ,
rtx   
)
int validate_replace_rtx_part ( rtx  ,
rtx  ,
rtx ,
rtx   
)
int validate_replace_rtx_part_nosimplify ( rtx  from,
rtx  to,
rtx where,
rtx  insn 
)
Same as above, but do not simplify rtx afterwards.   

References apply_change_group(), and validate_replace_rtx_1().

Referenced by substitute_reg_in_expr().

int validate_replace_rtx_subexp ( rtx  ,
rtx  ,
rtx  ,
rtx  
)
void validate_replace_src_group ( rtx  ,
rtx  ,
rtx   
)
bool validate_simplify_insn ( rtx  insn)
bool validate_unshare_change ( rtx  ,
rtx ,
rtx  ,
bool   
)
int verify_changes ( int  )

Variable Documentation

int peep2_current_count
The number of instructions available to match a peep2.   

Referenced by peep2_fill_buffer(), peep2_next_insn(), peep2_reinit_state(), peep2_update_life(), and peephole2_optimize().

struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES]
int volatile_ok
Nonzero means volatile operands are recognized.   
Nonzero means allow operands to be volatile.
   This should be 0 if you are generating rtl, such as if you are calling
   the functions in optabs.c and expmed.c (most of the time).
   This should be 1 if all valid insns need to be recognized,
   such as in reginfo.c and final.c and reload.c.

   init_recog and init_recog_no_volatile are responsible for setting this.   

Referenced by emit_block_move_via_movmem(), general_operand(), init_recog(), init_recog_no_volatile(), and maybe_legitimize_operand().