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   
)

Referenced by insn_invalid_p().

int added_clobbers_hard_reg_p ( int  )

Referenced by insn_invalid_p().

int apply_change_group ( void  )
   Apply a group of changes previously issued with `validate_change'.
   If all changes are valid, call confirm_change_group and return 1,
   otherwise, call cancel_changes and return 0.  

Referenced by find_comparison_args(), find_invariants_to_move(), and redirect_exp_1().

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.  
         Avoid unnecessary rescanning when multiple changes to same instruction
         are made.  

References confirm_change_group().

Referenced by confirm_change_group(), and redirect_jump_1().

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 ( void  )

References extract_asm_operands().

Referenced by profile_function().

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.

void insn_extract ( rtx  )
int insn_invalid_p ( rtx  ,
bool   
)
int 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.  

Referenced by determine_common_wider_type(), gen_lowpart_if_possible(), get_computation(), num_changes_pending(), and reload_combine_closest_single_use().

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 memory_address_addr_space_p().

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

References swap_commutative_operands_p().

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.  
     Adjusting an offsettable address involves changing to a narrower mode.
     Make sure that's OK.  
     ??? How much offset does an offsettable BLKmode reference need?
     Clearly that depends on the situation in which it's being used.
     However, the current situation in which we test 0xffffffff is
     less than ideal.  Caveat user.  
     If the expression contains a constant term,
     see if it remains valid when max possible offset is added.  
         Use QImode because an odd displacement may be automatically invalid
         for any wider mode.  But it should be valid for a single byte.  
         In any case, restore old contents of memory.  
     The offset added here is chosen as the maximum offset that
     any instruction could need to add when operating on something
     of the specified mode.  We assume that if Y and Y+c are
     valid addresses then so is Y+d for all 0<d<c.  adjust_address will
     go inside a LO_SUM here, so we do so as well.  
     Likewise for a ZERO_EXTEND from pointer_mode.  
     Use QImode because an odd displacement may be automatically invalid
     for any wider mode.  But it should be valid for a single byte.  

References constrain_operands(), and which_alternative.

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.  
         Don't use registers set or clobbered by the insn.  
         Distribute the free registers as much as possible.  
         Can it support the mode we need?  
             Don't allocate fixed registers.  
             Don't allocate global registers.  
             Make sure the register is of the right class.  
             And that we don't create an extra save/restore.  
             And we don't clobber traceback for noreturn functions.  
             Start the next search with the next register.  
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 *   
)
void preprocess_constraints ( void  )
   After calling extract_insn, you can use this function to extract some
   information from the constraint strings into a more usable form.
   The collected data is stored in recog_op_alt.  
                     These don't say anything we care about.  

Referenced by process_bb_node_lives(), replace_src_with_reg_ok_p(), and undo_transformations().

int recog ( rtx  ,
rtx  ,
int *   
)
static int recog_memoized ( rtx  insn)
inlinestatic
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.  
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.  
     Regno must not be a pseudo register.  Offset may be negative.  

Referenced by constrain_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.  

References recog_data_d::constraints, recog_data_d::is_operator, recog_data_d::operand, and recog_data_d::operand_loc.

Referenced by constrain_operands_cached().

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 operands_match_p().

Referenced by subreg_lowpart_offset().

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.  
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.  
struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES]
   Contains a vector of operand_alternative structures for every operand.
   Set up by preprocess_constraints.  

Referenced by build_def_use(), copyprop_hardreg_forward_1(), extract_constrain_insn_cached(), extract_insn_cached(), and replace_src_with_reg_ok_p().

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 block_move_libcall_safe_for_call_parm(), and init_recog_no_volatile().

int which_alternative
   Set by constrain_operands to the number of the alternative that
   matched.  
   On return from `constrain_operands', indicate which alternative
   was satisfied.  

Referenced by check_asm_operands(), lra_update_insn_recog_data(), offsettable_address_addr_space_p(), and replace_src_with_reg_ok_p().