GCC Middle and Back End API Reference
genemit.cc File Reference
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "errors.h"
#include "read-md.h"
#include "gensupport.h"
#include "internal-fn.def"
Include dependency graph for genemit.cc:

Data Structures

struct  clobber_pat
 
struct  clobber_ent
 

Macros

#define DEF_INTERNAL_OPTAB_FN(NAME, FLAGS, OPTAB, TYPE)    nofail_optabs[OPTAB##_optab] = true;
 

Functions

static void output_peephole2_scratches (rtx, FILE *)
 
static void print_code (RTX_CODE code, FILE *file)
 
static void gen_rtx_scratch (rtx x, enum rtx_code subroutine_type, FILE *file)
 
static void gen_exp (rtx x, enum rtx_code subroutine_type, char *used, md_rtx_info *info, FILE *file)
 
static void gen_emit_seq (rtvec vec, char *used, md_rtx_info *info, FILE *file)
 
static void emit_c_code (const char *code, bool can_fail_p, const char *name, FILE *file)
 
static void gen_insn (md_rtx_info *info, FILE *file)
 
static void gen_expand (md_rtx_info *info, FILE *file)
 
static void gen_split (md_rtx_info *info, FILE *file)
 
static void output_add_clobbers (md_rtx_info *info, FILE *file)
 
static void output_added_clobbers_hard_reg_p (FILE *file)
 
static void print_overload_arguments (overloaded_name *oname, FILE *file)
 
static void print_overload_test (overloaded_instance *instance, FILE *file)
 
static void handle_overloaded_code_for (overloaded_name *oname, FILE *file)
 
static void handle_overloaded_gen (overloaded_name *oname, FILE *file)
 
void print_header (FILE *file)
 
static bool handle_arg (const char *arg)
 
int main (int argc, const char **argv)
 

Variables

struct clobber_patclobber_list
 
static bool nofail_optabs [NUM_OPTABS]
 
auto_vec< const char *, 10 > output_files
 

Macro Definition Documentation

◆ DEF_INTERNAL_OPTAB_FN

#define DEF_INTERNAL_OPTAB_FN ( NAME,
FLAGS,
OPTAB,
TYPE )    nofail_optabs[OPTAB##_optab] = true;

Function Documentation

◆ emit_c_code()

static void emit_c_code ( const char * code,
bool can_fail_p,
const char * name,
FILE * file )
static
Emit the given C code to the output file.  The code is allowed to
fail if CAN_FAIL_P.  NAME describes what we're generating,
for use in error messages.   

References ggc_alloc(), md_reader::print_md_ptr_loc(), and rtx_reader_ptr.

Referenced by gen_expand(), and gen_split().

◆ gen_emit_seq()

static void gen_emit_seq ( rtvec vec,
char * used,
md_rtx_info * info,
FILE * file )
static
Output code to emit the instruction patterns in VEC, with each element
becoming a separate instruction.  USED is as for gen_exp.   

References gen_exp(), get_emit_function(), GET_NUM_ELEM, ggc_alloc(), i, needs_barrier_p(), clobber_ent::next, and RTVEC_ELT.

Referenced by gen_expand(), and gen_split().

◆ gen_exp()

static void gen_exp ( rtx x,
enum rtx_code subroutine_type,
char * used,
md_rtx_info * info,
FILE * file )
static

◆ gen_expand()

static void gen_expand ( md_rtx_info * info,
FILE * file )
static

◆ gen_insn()

◆ gen_rtx_scratch()

static void gen_rtx_scratch ( rtx x,
enum rtx_code subroutine_type,
FILE * file )
static

References GET_MODE, GET_MODE_NAME, ggc_alloc(), and XINT.

Referenced by gen_exp().

◆ gen_split()

static void gen_split ( md_rtx_info * info,
FILE * file )
static

◆ handle_arg()

static bool handle_arg ( const char * arg)
static

References output_files.

Referenced by main().

◆ handle_overloaded_code_for()

static void handle_overloaded_code_for ( overloaded_name * oname,
FILE * file )
static
Emit a maybe_code_for_* function for ONAME.   

References ggc_alloc(), print_overload_arguments(), and print_overload_test().

Referenced by main().

◆ handle_overloaded_gen()

static void handle_overloaded_gen ( overloaded_name * oname,
FILE * file )
static
Emit a maybe_gen_* function for ONAME.   

References get_pattern_stats(), ggc_alloc(), HOST_WIDE_INT_1U, i, print_overload_arguments(), stats, and XVEC.

Referenced by main().

◆ main()

◆ output_add_clobbers()

static void output_add_clobbers ( md_rtx_info * info,
FILE * file )
static
Write a function, `add_clobbers', that is given a PARALLEL of sufficient
size for the insn and an INSN_CODE, and inserts the required CLOBBERs at
the end of the vector.   

References clobber_list, gen_exp(), GET_CODE, ggc_alloc(), i, NULL, XVECEXP, and XVECLEN.

Referenced by main().

◆ output_added_clobbers_hard_reg_p()

static void output_added_clobbers_hard_reg_p ( FILE * file)
static
Write a function, `added_clobbers_hard_reg_p' that is given an insn_code
number that will have clobbers added (as indicated by `recog') and returns
1 if those include a clobber of a hard reg or 0 if all of them just clobber
SCRATCH.   

References clobber_list, and ggc_alloc().

Referenced by main().

◆ output_peephole2_scratches()

static void output_peephole2_scratches ( rtx split,
FILE * file )
static
Generate code to invoke find_free_register () as needed for the
scratch registers used by the peephole2 pattern in SPLIT.   

References GET_CODE, GET_MODE, GET_MODE_NAME, ggc_alloc(), i, XINT, XSTR, XVECEXP, and XVECLEN.

Referenced by gen_split().

◆ print_code()

static void print_code ( RTX_CODE code,
FILE * file )
static

References GET_RTX_NAME, and ggc_alloc().

Referenced by gen_exp().

◆ print_header()

void print_header ( FILE * file)

References ggc_alloc().

◆ print_overload_arguments()

static void print_overload_arguments ( overloaded_name * oname,
FILE * file )
static
Print "arg<N>" parameter declarations for each argument N of ONAME.   

References ggc_alloc(), and i.

Referenced by handle_overloaded_code_for(), and handle_overloaded_gen().

◆ print_overload_test()

static void print_overload_test ( overloaded_instance * instance,
FILE * file )
static
Print code to test whether INSTANCE should be chosen, given that
argument N of the overload is available as "arg<N>".   

References overloaded_instance::arg_values, ggc_alloc(), and i.

Referenced by handle_overloaded_code_for().

Variable Documentation

◆ clobber_list

◆ nofail_optabs

bool nofail_optabs[NUM_OPTABS]
static
True for <X>_optab if that optab isn't allowed to fail.   

Referenced by gen_expand().

◆ output_files

auto_vec<const char *, 10> output_files
The list of output files.   

Referenced by handle_arg(), and main().