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

Data Structures

struct  mode_data
struct  mode_adjust

Enumerations

enum  mode_class { MODE_CLASSES, MAX_MODE_CLASS, MODE_CLASSES, MAX_MODE_CLASS }
enum  requirement { SET, UNSET, OPTIONAL }

Functions

static enum mode_class complex_class ()
static enum mode_class vector_class ()
static struct mode_datafind_mode ()
static struct mode_datanew_mode (enum mode_class cl, const char *name, const char *file, unsigned int line)
static hashval_t hash_mode ()
static int eq_mode ()
static void new_adjust (const char *name, struct mode_adjust **category, const char *catname, const char *adjustment, enum mode_class required_class_from, enum mode_class required_class_to, const char *file, unsigned int line)
static void validate_mode (struct mode_data *m, enum requirement r_precision, enum requirement r_bytesize, enum requirement r_component, enum requirement r_ncomponents, enum requirement r_format)
static void complete_mode ()
static void complete_all_modes ()
static void make_complex_modes (enum mode_class cl, const char *file, unsigned int line)
static void make_vector_modes (enum mode_class cl, unsigned int width, const char *file, unsigned int line)
static void make_special_mode (enum mode_class cl, const char *name, const char *file, unsigned int line)
static void make_int_mode (const char *name, unsigned int precision, unsigned int bytesize, const char *file, unsigned int line)
static void make_fixed_point_mode (enum mode_class cl, const char *name, unsigned int bytesize, unsigned int ibit, unsigned int fbit, const char *file, unsigned int line)
static void make_float_mode (const char *name, unsigned int precision, unsigned int bytesize, const char *format, const char *file, unsigned int line)
static void make_decimal_float_mode (const char *name, unsigned int precision, unsigned int bytesize, const char *format, const char *file, unsigned int line)
static void reset_float_format (const char *name, const char *format, const char *file, unsigned int line)
static void make_partial_integer_mode (const char *base, const char *name, unsigned int precision, const char *file, unsigned int line)
static void make_vector_mode (enum mode_class bclass, const char *base, unsigned int ncomponents, const char *file, unsigned int line)
static void create_modes ()
static int cmp_modes ()
static void calc_wider_mode ()
static void emit_max_int ()
static void emit_insn_modes_h ()
static void emit_insn_modes_c_header ()
static void emit_min_insn_modes_c_header ()
static void emit_mode_name ()
static void emit_mode_class ()
static void emit_mode_precision ()
static void emit_mode_size ()
static void emit_mode_nunits ()
static void emit_mode_wider ()
static void emit_mode_mask ()
static void emit_mode_inner ()
static void emit_mode_base_align ()
static void emit_class_narrowest_mode ()
static void emit_real_format_for_mode ()
static void emit_mode_adjustments ()
static void emit_mode_ibit ()
static void emit_mode_fbit ()
static void emit_insn_modes_c ()
static void emit_min_insn_modes_c ()
int main ()

Variables

static const char *const mode_class_names [MAX_MODE_CLASS]
static struct mode_datamodes [MAX_MODE_CLASS]
static unsigned int n_modes [MAX_MODE_CLASS]
static struct mode_datavoid_mode
static struct mode_data blank_mode
static htab_t modes_by_name
static struct mode_adjustadj_bytesize
static struct mode_adjustadj_alignment
static struct mode_adjustadj_format
static struct mode_adjustadj_ibit
static struct mode_adjustadj_fbit

Enumeration Type Documentation

enum mode_class
Enumerator:
MODE_CLASSES 
MAX_MODE_CLASS 
MODE_CLASSES 
MAX_MODE_CLASS 
Diagnose failure to meet expectations in a partially filled out
   mode structure.   
Enumerator:
SET 
UNSET 
OPTIONAL 

Function Documentation

static void calc_wider_mode ( )
static
static int cmp_modes ( )
static
Processing.   
Sort a list of modes into the order needed for the WIDER field:
   major sort by precision, minor sort by component precision.

   For instance:
     QI < HI < SI < DI < TI
     V4QI < V2HI < V8QI < V4HI < V2SI.

   If the precision is not set, sort by the bytesize.  A mode with
   precision set gets sorted before a mode without precision set, if
   they have the same bytesize; this is the right thing because
   the precision must always be smaller than the bytesize * BITS_PER_UNIT.
   We don't have to do anything special to get this done -- an unset
   precision shows up as (unsigned int)-1, i.e. UINT_MAX.   

References mode_data::bytesize, mode_data::component, mode_data::counter, and mode_data::precision.

Referenced by calc_wider_mode().

static void complete_all_modes ( )
static

References mode_data::cl, and complete_mode().

Referenced by main().

static void complete_mode ( )
static
Given a partially-filled-out mode structure, figure out what we can
   and fill the rest of it in; die if it isn't enough.   

References mode_data::alignment, mode_data::bytesize, mode_data::cl, mode_data::component, mode_data::contained, error(), mode_data::file, mode_data::line, MAX_MODE_CLASS, mode_data::name, mode_data::ncomponents, mode_data::next_cont, OPTIONAL, mode_data::precision, SET, UNSET, and validate_mode().

Referenced by complete_all_modes().

static enum mode_class complex_class ( )
static
Mode class operations.   

References error(), and mode_class_names.

Referenced by make_complex_modes().

static void create_modes ( )
static

Referenced by main().

static void emit_class_narrowest_mode ( )
static
static void emit_insn_modes_c_header ( )
static

Referenced by emit_insn_modes_c().

static void emit_max_int ( )
static
Compute the max bitsize of some of the classes of integers.  It may
   be that there are needs for the other integer classes, and this
   code is easy to extend.   

References mode_data::bytesize, MAX_MODE_CLASS, and mode_data::next.

Referenced by emit_insn_modes_h().

static void emit_min_insn_modes_c ( )
static
static void emit_min_insn_modes_c_header ( )
static

Referenced by emit_min_insn_modes_c().

static void emit_mode_base_align ( )
static

References mode_data::alignment, and mode_data::name.

Referenced by emit_insn_modes_c().

static void emit_mode_class ( )
static
static void emit_mode_fbit ( )
static
Emit fbit for all modes.   

References mode_data::fbit, and mode_data::name.

Referenced by emit_insn_modes_c().

static void emit_mode_ibit ( )
static
Emit ibit for all modes.   

References mode_data::ibit, and mode_data::name.

Referenced by emit_insn_modes_c().

static void emit_mode_inner ( )
static

References mode_data::component, and mode_data::name.

Referenced by emit_insn_modes_c().

static void emit_mode_mask ( )
static
static void emit_mode_name ( )
static
static void emit_mode_nunits ( )
static
static void emit_mode_precision ( )
static
static void emit_mode_size ( )
static

References mode_data::bytesize, and mode_data::name.

Referenced by emit_insn_modes_c().

static void emit_real_format_for_mode ( )
static
static int eq_mode ( )
static

References mode_data::name.

Referenced by main().

static struct mode_data* find_mode ( )
staticread
static hashval_t hash_mode ( )
static

References mode_data::name.

Referenced by main().

static void make_complex_modes ( enum mode_class  cl,
const char *  file,
unsigned int  line 
)
static
static void make_decimal_float_mode ( const char *  name,
unsigned int  precision,
unsigned int  bytesize,
const char *  format,
const char *  file,
unsigned int  line 
)
static
static void make_fixed_point_mode ( enum mode_class  cl,
const char *  name,
unsigned int  bytesize,
unsigned int  ibit,
unsigned int  fbit,
const char *  file,
unsigned int  line 
)
static
Create a fixed-point mode by setting CL, NAME, BYTESIZE, IBIT, FBIT,
   FILE, and LINE.   

References mode_data::bytesize, mode_data::fbit, mode_data::ibit, and new_mode().

static void make_float_mode ( const char *  name,
unsigned int  precision,
unsigned int  bytesize,
const char *  format,
const char *  file,
unsigned int  line 
)
static
static void make_int_mode ( const char *  name,
unsigned int  precision,
unsigned int  bytesize,
const char *  file,
unsigned int  line 
)
static
static void make_partial_integer_mode ( const char *  base,
const char *  name,
unsigned int  precision,
const char *  file,
unsigned int  line 
)
static
static void make_special_mode ( enum mode_class  cl,
const char *  name,
const char *  file,
unsigned int  line 
)
static

References new_mode().

static void make_vector_mode ( enum mode_class  bclass,
const char *  base,
unsigned int  ncomponents,
const char *  file,
unsigned int  line 
)
static
static void make_vector_modes ( enum mode_class  cl,
unsigned int  width,
const char *  file,
unsigned int  line 
)
static
static void new_adjust ( const char *  name,
struct mode_adjust **  category,
const char *  catname,
const char *  adjustment,
enum mode_class  required_class_from,
enum mode_class  required_class_to,
const char *  file,
unsigned int  line 
)
static
static void reset_float_format ( const char *  name,
const char *  format,
const char *  file,
unsigned int  line 
)
static
static void validate_mode ( struct mode_data m,
enum requirement  r_precision,
enum requirement  r_bytesize,
enum requirement  r_component,
enum requirement  r_ncomponents,
enum requirement  r_format 
)
static

Referenced by complete_mode().

static enum mode_class vector_class ( )
static

References error(), and mode_class_names.

Referenced by make_vector_mode(), and make_vector_modes().


Variable Documentation

struct mode_adjust* adj_alignment
static
struct mode_adjust* adj_bytesize
static
struct mode_adjust* adj_fbit
static
struct mode_adjust* adj_format
static
struct mode_adjust* adj_ibit
static
struct mode_data blank_mode
static
Initial value:
{
0, "<unknown>", MAX_MODE_CLASS,
-1U, -1U, -1U, -1U,
0, 0, 0, 0, 0,
"<unknown>", 0, 0, 0, 0
}
htab_t modes_by_name
static

Referenced by find_mode(), main(), and new_mode().

unsigned int n_modes[MAX_MODE_CLASS]
static

Referenced by calc_wider_mode(), and new_mode().

struct mode_data* void_mode
static

Referenced by calc_wider_mode(), and emit_mode_wider().