GCC Middle and Back End API Reference
genoutput.c File Reference

Data Structures

struct  operand_data
struct  data
struct  constraint_data

Functions

static int n_occurrences (int, const char *)
static const char * strip_whitespace (const char *)
static void output_prologue (void)
static void output_operand_data (void)
static void output_insn_data (void)
static void output_get_insn_name (void)
static void scan_operands (struct data *, rtx, int, int)
static int compare_operands (struct operand_data *, struct operand_data *)
static void place_operands (struct data *)
static void process_template (struct data *, const char *)
static void validate_insn_alternatives (struct data *)
static void validate_insn_operands (struct data *)
static void gen_insn (rtx, int)
static void gen_peephole (rtx, int)
static void gen_expand (rtx, int)
static void gen_split (rtx, int)
static int mdep_constraint_len (const char *, int, int)
static void note_constraint (rtx, int)
static void check_constraint_len (void)
static int constraint_len (const char *, int)
static int compare_operands ()
static void place_operands ()
static void process_template ()
static void validate_insn_alternatives ()
static void validate_insn_operands ()
static void validate_optab_operands ()
static void gen_insn ()
static void gen_peephole ()
static void gen_expand ()
static void gen_split ()
static void init_insn_for_nothing ()
int main (int, char **)
int main ()
static int n_occurrences ()
static const char * strip_whitespace ()
static void note_constraint ()
static int mdep_constraint_len ()
static int constraint_len ()

Variables

static int next_code_number
static int next_index_number
static int next_operand_number = 1
static struct operand_data null_operand
static struct operand_dataodata = &null_operand
static struct operand_data ** odata_end = &null_operand.next
static struct data nothing
static struct dataidata = &nothing
static struct data ** idata_end = &nothing.next
static const char indep_constraints [] = ",=+%*?!#&<>EFVXgimnoprs"
static struct constraint_dataconstraints_by_letter_table [1<< CHAR_BIT]

Function Documentation

static void check_constraint_len ( )
static
Verify that DEFAULT_CONSTRAINT_LEN is used properly and not
   tampered with.  This isn't bullet-proof, but it should catch
   most genuine mistakes.   

References constraint_len().

Referenced by gen_insn().

static int compare_operands ( struct operand_data ,
struct operand_data  
)
static

Referenced by place_operands().

static int compare_operands ( )
static
static int constraint_len ( const char *  ,
int   
)
static
static int constraint_len ( )
static
static void gen_expand ( rtx  ,
int   
)
static
static void gen_insn ( rtx  ,
int   
)
static
static void gen_peephole ( rtx  ,
int   
)
static
static void gen_peephole ( )
static
Look at a define_peephole just read.  Assign its code number.
   Record on idata the template and the number of arguments.
   If the insn has a hairy output action, output it now.   

References data::code_number, data::filename, get_pattern_stats(), data::index_number, data::lineno, memset(), data::n_dups, data::n_generator_args, data::n_operands, data::name, data::next, next_code_number, next_index_number, pattern_stats::num_insn_operands, data::operand, place_operands(), process_template(), read_md_filename, scan_operands(), and validate_insn_alternatives().

static void gen_split ( rtx  ,
int   
)
static
static void init_insn_for_nothing ( )
static

References data::filename, memset(), data::name, and nothing.

Referenced by main().

int main ( int  ,
char **   
)
static int mdep_constraint_len ( const char *  ,
int  ,
int   
)
static
static int mdep_constraint_len ( )
static
Return the length of the constraint name beginning at position S
   of an operand constraint string, or issue an error message if there
   is no such constraint.  Does not expect to be called for generic
   constraints.   

References error_with_line(), message_with_line(), constraint_data::name, constraint_data::namelen, and constraint_data::next_this_letter.

static int n_occurrences ( int  ,
const char *   
)
static
static int n_occurrences ( )
static
Return the number of occurrences of character C in string S or
   -1 if S is the null string.   
static void note_constraint ( rtx  ,
int   
)
static

Referenced by main().

static void note_constraint ( )
static
Record just enough information about a constraint to allow checking
   of operand constraint strings above, in validate_insn_alternatives.
   Does not validate most properties of the constraint itself; does
   enforce no duplicate names, no overlap with MI constraints, and no
   prefixes.  EXP is the define_*constraint form, LINENO the line number
   reported by the reader.   

References error_with_line(), indep_constraints, constraint_data::lineno, message_with_line(), data::name, constraint_data::name, constraint_data::namelen, constraint_data::next_this_letter, and strlen().

static void output_get_insn_name ( void  )
static

Referenced by main().

static void output_prologue ( void  )
static

Referenced by main().

static void place_operands ( struct data )
static
static void place_operands ( )
static
Scan the list of operands we've already committed to output and either
   find a subsequence that is the same, or allocate a new one at the end.   

References compare_operands(), operand_data::index, data::n_operands, operand_data::next, next_operand_number, data::operand, and data::operand_number.

static void process_template ( struct data ,
const char *   
)
static

Referenced by gen_insn(), and gen_peephole().

static void process_template ( )
static
Process an assembler template from a define_insn or a define_peephole.
   It is either the assembler code template, a list of assembler code
   templates, or C code to generate the assembler code template.   

References data::code_number, error_with_line(), data::lineno, message_with_line(), data::n_alternatives, data::output_format, print_md_ptr_loc(), and data::template_code.

static void scan_operands ( struct data d,
rtx  part,
int  this_address_p,
int  this_strict_low 
)
static
Stores the operand data into `d->operand[i]'.

   THIS_ADDRESS_P is nonzero if the containing rtx was an ADDRESS.
   THIS_STRICT_LOW is nonzero if the containing rtx was a STRICT_LOW_PART.   

References operand_data::address_p, operand_data::constraint, operand_data::eliminable, error_with_line(), data::lineno, operand_data::mode, operand_data::n_alternatives, n_occurrences, data::operand, operand_data::predicate, operand_data::seen, operand_data::strict_low, and strip_whitespace().

Referenced by gen_expand(), gen_insn(), gen_peephole(), and gen_split().

static const char* strip_whitespace ( const char *  )
static

Referenced by scan_operands().

static const char* strip_whitespace ( )
static
Remove whitespace in `s' by moving up characters until the end.
   Return a new string.   

References strlen().

static void validate_insn_alternatives ( struct data )
static

Referenced by gen_expand(), gen_insn(), and gen_peephole().

static void validate_insn_alternatives ( )
static
static void validate_insn_operands ( struct data )
static

Referenced by gen_insn().

static void validate_insn_operands ( )
static
Verify that there are no gaps in operand numbers for INSNs.   

References error_with_line(), data::lineno, data::n_operands, data::operand, and operand_data::seen.

static void validate_optab_operands ( )
static

Variable Documentation

struct constraint_data* constraints_by_letter_table[1<< CHAR_BIT]
static
struct data* idata = &nothing
static
This variable points to the first link in the insn chain.   
struct data** idata_end = &nothing.next
static
This variable points to the end of the insn chain.  This is where
   everything relevant from the machien description is appended to.   
const char indep_constraints[] = ",=+%*?!#&<>EFVXgimnoprs"
static
This is a complete list (unlike the one in genpreds.c) of constraint
   letters and modifiers with machine-independent meaning.  The only
   omission is digits, as these are handled specially.   

Referenced by note_constraint(), and validate_insn_alternatives().

int next_code_number
static
insns in the machine description are assigned sequential code numbers
   that are used by insn-recog.c (produced by genrecog) to communicate
   to insn-output.c (produced by this program).   

Referenced by gen_expand(), gen_insn(), gen_peephole(), gen_split(), and main().

int next_index_number
static
This counts all definitions in the md file,
   for the sake of error messages.   

Referenced by gen_expand(), gen_insn(), gen_peephole(), gen_split(), and main().

int next_operand_number = 1
static
This counts all operands used in the md file.  The first is null.   

Referenced by place_operands().

struct data nothing
static
A dummy insn, for CODE_FOR_nothing.   

Referenced by init_insn_for_nothing().

struct operand_data null_operand
static
Initial value:
{
0, 0, "", "", VOIDmode, 0, 0, 0, 0, 0
}
Begin with a null operand at index 0.   
struct operand_data* odata = &null_operand
static
struct operand_data** odata_end = &null_operand.next
static