GCC Middle and Back End API Reference
genmodes.cc File Reference
#include "bconfig.h"
#include "system.h"
#include "errors.h"
#include "mode-classes.def"
#include "machmode.def"
Include dependency graph for genmodes.cc:

Data Structures

struct  mode_data
 
struct  mode_adjust
 

Macros

#define DEF_MODE_CLASS(M)
 
#define DEF_MODE_CLASS(M)
 
#define HAVE_EXTRA_MODES   0
 
#define EXTRA_MODES_FILE   ""
 
#define for_all_modes(C, M)
 
#define validate_field_(mname, fname, req, val, unset, file, line)
 
#define validate_field(M, F)
 
#define COMPLEX_MODES(C)
 
#define VECTOR_MODES_WITH_PREFIX(PREFIX, C, W, ORDER)
 
#define VECTOR_MODES(C, W)
 
#define VECTOR_BOOL_MODE(NAME, COUNT, COMPONENT, BYTESIZE)
 
#define _SPECIAL_MODE(C, N)
 
#define RANDOM_MODE(N)
 
#define CC_MODE(N)
 
#define INT_MODE(N, Y)
 
#define FRACTIONAL_INT_MODE(N, B, Y)
 
#define BOOL_MODE(N, B, Y)
 
#define OPAQUE_MODE(N, B)
 
#define FRACT_MODE(N, Y, F)
 
#define UFRACT_MODE(N, Y, F)
 
#define ACCUM_MODE(N, Y, I, F)
 
#define UACCUM_MODE(N, Y, I, F)
 
#define FLOAT_MODE(N, Y, F)
 
#define FRACTIONAL_FLOAT_MODE(N, B, Y, F)
 
#define DECIMAL_FLOAT_MODE(N, Y, F)
 
#define FRACTIONAL_DECIMAL_FLOAT_MODE(N, B, Y, F)
 
#define RESET_FLOAT_FORMAT(N, F)
 
#define INT_N(M, PREC)
 
#define PARTIAL_INT_MODE(M, PREC, NAME)
 
#define VECTOR_MODE_WITH_PREFIX(PREFIX, C, M, N, ORDER)
 
#define VECTOR_MODE(C, M, N)
 
#define _ADD_ADJUST(A, M, X, C1, C2)
 
#define ADJUST_NUNITS(M, X)
 
#define ADJUST_BYTESIZE(M, X)
 
#define ADJUST_ALIGNMENT(M, X)
 
#define ADJUST_PRECISION(M, X)
 
#define ADJUST_FLOAT_FORMAT(M, X)
 
#define ADJUST_IBIT(M, X)
 
#define ADJUST_FBIT(M, X)
 
#define NUM_POLY_INT_COEFFS   1
 
#define ZERO_COEFFS   ""
 
#define tagged_printf(FMT, ARG, TAG)
 
#define print_decl(TYPE, NAME, ASIZE)
 
#define print_maybe_const_decl(TYPE, NAME, ASIZE, NEEDS_ADJ)
 
#define print_closer()
 

Enumerations

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

Functions

static enum mode_class complex_class (enum mode_class c)
 
static enum mode_class vector_class (enum mode_class cl)
 
static struct mode_datafind_mode (const char *name)
 
static struct mode_datanew_mode (enum mode_class cl, const char *name, const char *file, unsigned int line)
 
static hashval_t hash_mode (const void *p)
 
static int eq_mode (const void *p, const void *q)
 
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 (struct mode_data *m)
 
static void complete_all_modes (void)
 
static void make_complex_modes (enum mode_class cl, const char *file, unsigned int line)
 
static void make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width, unsigned int order, const char *file, unsigned int line)
 
static void make_vector_bool_mode (const char *name, unsigned int count, const char *component, unsigned int bytesize, 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_bool_mode (const char *name, unsigned int precision, unsigned int bytesize, const char *file, unsigned int line)
 
static void make_opaque_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_int_n (const char *m, int bitsize, 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 *prefix, const char *base, unsigned int ncomponents, unsigned int order, const char *file, unsigned int line)
 
static void create_modes (void)
 
static int cmp_modes (const void *a, const void *b)
 
static void calc_wider_mode (void)
 
static void emit_max_int (void)
 
static void emit_mode_size_inline (void)
 
static void emit_mode_nunits_inline (void)
 
static void emit_mode_inner_inline (void)
 
static void emit_mode_unit_size_inline (void)
 
static void emit_mode_unit_precision_inline (void)
 
static const char * get_mode_class (struct mode_data *mode)
 
static void emit_insn_modes_h (void)
 
static void emit_insn_modes_inline_h (void)
 
static void emit_insn_modes_c_header (void)
 
static void emit_min_insn_modes_c_header (void)
 
static void emit_mode_name (void)
 
static void emit_mode_class (void)
 
static void emit_mode_precision (void)
 
static void emit_mode_size (void)
 
static void emit_mode_nunits (void)
 
static void emit_mode_wider (void)
 
static void emit_mode_complex (void)
 
static void emit_mode_mask (void)
 
static void emit_mode_inner (void)
 
static void emit_mode_unit_size (void)
 
static void emit_mode_unit_precision (void)
 
static void emit_mode_base_align (void)
 
static void emit_class_narrowest_mode (void)
 
static void emit_real_format_for_mode (void)
 
static void emit_mode_adjustments (void)
 
static void emit_mode_ibit (void)
 
static void emit_mode_fbit (void)
 
static void emit_mode_int_n (void)
 
static void emit_insn_modes_c (void)
 
static void emit_min_insn_modes_c (void)
 
int main (int argc, char **argv)
 

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 const struct mode_data blank_mode
 
static htab_t modes_by_name
 
static struct mode_adjustadj_nunits
 
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
 
static struct mode_adjustadj_precision
 
static int bits_per_unit
 
static int max_bitsize_mode_any_int
 
static int max_bitsize_mode_any_mode
 

Macro Definition Documentation

◆ _ADD_ADJUST

#define _ADD_ADJUST ( A,
M,
X,
C1,
C2 )
Value:
new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, __LINE__)
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)
Definition genmodes.cc:216
Adjustability.   

◆ _SPECIAL_MODE

#define _SPECIAL_MODE ( C,
N )
Value:
make_special_mode (MODE_##C, #N, __FILE__, __LINE__)
static void make_special_mode(enum mode_class cl, const char *name, const char *file, unsigned int line)
Definition genmodes.cc:583
#define N
Definition gensupport.cc:202
Input.   

◆ ACCUM_MODE

#define ACCUM_MODE ( N,
Y,
I,
F )
Value:
make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, __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)
Definition genmodes.cc:647
#define I
Definition gensupport.cc:204
#define Y
Definition gensupport.cc:203

◆ ADJUST_ALIGNMENT

#define ADJUST_ALIGNMENT ( M,
X )
Value:
_ADD_ADJUST (alignment, M, X, RANDOM, RANDOM)
#define _ADD_ADJUST(A, M, X, C1, C2)
Definition genmodes.cc:817

◆ ADJUST_BYTESIZE

#define ADJUST_BYTESIZE ( M,
X )
Value:
_ADD_ADJUST (bytesize, M, X, RANDOM, RANDOM)

◆ ADJUST_FBIT

#define ADJUST_FBIT ( M,
X )
Value:
_ADD_ADJUST (fbit, M, X, FRACT, UACCUM)

◆ ADJUST_FLOAT_FORMAT

#define ADJUST_FLOAT_FORMAT ( M,
X )
Value:
_ADD_ADJUST (format, M, X, FLOAT, FLOAT)

◆ ADJUST_IBIT

#define ADJUST_IBIT ( M,
X )
Value:
_ADD_ADJUST (ibit, M, X, ACCUM, UACCUM)

◆ ADJUST_NUNITS

#define ADJUST_NUNITS ( M,
X )
Value:
_ADD_ADJUST (nunits, M, X, RANDOM, RANDOM)

◆ ADJUST_PRECISION

#define ADJUST_PRECISION ( M,
X )
Value:
_ADD_ADJUST (precision, M, X, RANDOM, RANDOM)

◆ BOOL_MODE

#define BOOL_MODE ( N,
B,
Y )
Value:
make_bool_mode (#N, B, Y, __FILE__, __LINE__)
static void make_bool_mode(const char *name, unsigned int precision, unsigned int bytesize, const char *file, unsigned int line)
Definition genmodes.cc:607

◆ CC_MODE

#define CC_MODE ( N)
Value:
#define _SPECIAL_MODE(C, N)
Definition genmodes.cc:577

◆ COMPLEX_MODES

#define COMPLEX_MODES ( C)
Value:
make_complex_modes (MODE_##C, __FILE__, __LINE__)
static void make_complex_modes(enum mode_class cl, const char *file, unsigned int line)
Definition genmodes.cc:446
For each mode in class CLASS, construct a corresponding complex mode.   

◆ DECIMAL_FLOAT_MODE

#define DECIMAL_FLOAT_MODE ( N,
Y,
F )
Value:
#define FRACTIONAL_DECIMAL_FLOAT_MODE(N, B, Y, F)
Definition genmodes.cc:678

◆ DEF_MODE_CLASS [1/2]

#define DEF_MODE_CLASS ( M)
Value:
M
Generate the machine mode enumeration and associated tables.
   Copyright (C) 2003-2025 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
enum mode_class is normally defined by machmode.h but we can't
include that header here.   
Text names of mode classes, for output.   

◆ DEF_MODE_CLASS [2/2]

#define DEF_MODE_CLASS ( M)
Value:
#M
Generate the machine mode enumeration and associated tables.
   Copyright (C) 2003-2025 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
enum mode_class is normally defined by machmode.h but we can't
include that header here.   
Text names of mode classes, for output.   

◆ EXTRA_MODES_FILE

◆ FLOAT_MODE

#define FLOAT_MODE ( N,
Y,
F )
Value:
#define FRACTIONAL_FLOAT_MODE(N, B, Y, F)
Definition genmodes.cc:661

◆ for_all_modes

◆ FRACT_MODE

#define FRACT_MODE ( N,
Y,
F )
Value:
make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, __LINE__)

◆ FRACTIONAL_DECIMAL_FLOAT_MODE

#define FRACTIONAL_DECIMAL_FLOAT_MODE ( N,
B,
Y,
F )
Value:
make_decimal_float_mode (#N, B, Y, #F, __FILE__, __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)
Definition genmodes.cc:682

◆ FRACTIONAL_FLOAT_MODE

#define FRACTIONAL_FLOAT_MODE ( N,
B,
Y,
F )
Value:
make_float_mode (#N, B, Y, #F, __FILE__, __LINE__)
static void make_float_mode(const char *name, unsigned int precision, unsigned int bytesize, const char *format, const char *file, unsigned int line)
Definition genmodes.cc:665

◆ FRACTIONAL_INT_MODE

#define FRACTIONAL_INT_MODE ( N,
B,
Y )
Value:
make_int_mode (#N, B, Y, __FILE__, __LINE__)
static void make_int_mode(const char *name, unsigned int precision, unsigned int bytesize, const char *file, unsigned int line)
Definition genmodes.cc:594

◆ HAVE_EXTRA_MODES

◆ INT_MODE

#define INT_MODE ( N,
Y )
Value:
#define FRACTIONAL_INT_MODE(N, B, Y)
Definition genmodes.cc:590

◆ INT_N

#define INT_N ( M,
PREC )
Value:
make_int_n (#M, PREC, __FILE__, __LINE__)
static void make_int_n(const char *m, int bitsize, const char *file, unsigned int line)
Definition genmodes.cc:717
__intN support.   

◆ NUM_POLY_INT_COEFFS

◆ OPAQUE_MODE

#define OPAQUE_MODE ( N,
B )
Value:
make_opaque_mode (#N, -1U, B, __FILE__, __LINE__)
static void make_opaque_mode(const char *name, unsigned int precision, unsigned int bytesize, const char *file, unsigned int line)
Definition genmodes.cc:621

◆ PARTIAL_INT_MODE

#define PARTIAL_INT_MODE ( M,
PREC,
NAME )
Value:
make_partial_integer_mode (#M, #NAME, PREC, __FILE__, __LINE__)
static void make_partial_integer_mode(const char *base, const char *name, unsigned int precision, const char *file, unsigned int line)
Definition genmodes.cc:746
@ NAME
Definition tree-ssa-pre.cc:242
Partial integer modes are specified by relation to a full integer
mode.   

◆ print_closer

◆ print_decl

#define print_decl ( TYPE,
NAME,
ASIZE )

◆ print_maybe_const_decl

#define print_maybe_const_decl ( TYPE,
NAME,
ASIZE,
NEEDS_ADJ )
Value:
printf ("\n" TYPE " " NAME "[" ASIZE "] = \n{\n", \
NEEDS_ADJ ? "" : "const ")

Referenced by emit_mode_base_align(), emit_mode_fbit(), emit_mode_ibit(), emit_mode_mask(), emit_mode_nunits(), emit_mode_precision(), emit_mode_size(), emit_mode_unit_size(), and emit_real_format_for_mode().

◆ RANDOM_MODE

#define RANDOM_MODE ( N)
Value:
_SPECIAL_MODE (RANDOM, N)

◆ RESET_FLOAT_FORMAT

#define RESET_FLOAT_FORMAT ( N,
F )
Value:
reset_float_format (#N, #F, __FILE__, __LINE__)
static void reset_float_format(const char *name, const char *format, const char *file, unsigned int line)
Definition genmodes.cc:696

◆ tagged_printf

#define tagged_printf ( FMT,
ARG,
TAG )

◆ UACCUM_MODE

#define UACCUM_MODE ( N,
Y,
I,
F )
Value:
make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, __LINE__)

◆ UFRACT_MODE

#define UFRACT_MODE ( N,
Y,
F )
Value:
make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, __LINE__)

◆ validate_field

#define validate_field ( M,
F )
Value:
validate_field_(M->name, #F, r_##F, M->F, blank_mode.F, M->file, M->line)
static const struct mode_data blank_mode
Definition genmodes.cc:88
#define validate_field_(mname, fname, req, val, unset, file, line)
Definition genmodes.cc:266

Referenced by validate_mode().

◆ validate_field_

#define validate_field_ ( mname,
fname,
req,
val,
unset,
file,
line )
Value:
do { \
switch (req) \
{ \
case SET: \
if (val == unset) \
error ("%s:%d: (%s) field %s must be set", \
file, line, mname, fname); \
break; \
case UNSET: \
if (val != unset) \
error ("%s:%d: (%s) field %s must not be set", \
file, line, mname, fname); \
case OPTIONAL: \
break; \
} \
} while (0)
@ OPTIONAL
Definition genmodes.cc:264
@ SET
Definition genmodes.cc:264
@ UNSET
Definition genmodes.cc:264

◆ VECTOR_BOOL_MODE

#define VECTOR_BOOL_MODE ( NAME,
COUNT,
COMPONENT,
BYTESIZE )
Value:
make_vector_bool_mode (#NAME, COUNT, #COMPONENT, BYTESIZE, \
__FILE__, __LINE__)
static void make_vector_bool_mode(const char *name, unsigned int count, const char *component, unsigned int bytesize, const char *file, unsigned int line)
Definition genmodes.cc:558
Create a vector of booleans called NAME with COUNT elements and
BYTESIZE bytes in total.   

◆ VECTOR_MODE

#define VECTOR_MODE ( C,
M,
N )
Value:
#define VECTOR_MODE_WITH_PREFIX(PREFIX, C, M, N, ORDER)
Definition genmodes.cc:770

◆ VECTOR_MODE_WITH_PREFIX

#define VECTOR_MODE_WITH_PREFIX ( PREFIX,
C,
M,
N,
ORDER )
Value:
make_vector_mode (MODE_##C, #PREFIX, #M, N, ORDER, __FILE__, __LINE__);
static void make_vector_mode(enum mode_class bclass, const char *prefix, const char *base, unsigned int ncomponents, unsigned int order, const char *file, unsigned int line)
Definition genmodes.cc:774
A single vector mode can be specified by naming its component
mode and the number of components.   

◆ VECTOR_MODES

#define VECTOR_MODES ( C,
W )
Value:
#define VECTOR_MODES_WITH_PREFIX(PREFIX, C, W, ORDER)
Definition genmodes.cc:502

◆ VECTOR_MODES_WITH_PREFIX

#define VECTOR_MODES_WITH_PREFIX ( PREFIX,
C,
W,
ORDER )
Value:
make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, __LINE__)
static void make_vector_modes(enum mode_class cl, const char *prefix, unsigned int width, unsigned int order, const char *file, unsigned int line)
Definition genmodes.cc:506
For all modes in class CL, construct vector modes of width WIDTH,
having as many components as necessary.  ORDER is the sorting order
of the mode, with smaller numbers indicating a higher priority.   

◆ ZERO_COEFFS

#define ZERO_COEFFS   ""
Text to add to the constant part of a poly_int initializer in
order to fill out te whole structure.   

Referenced by emit_mode_nunits(), emit_mode_precision(), and emit_mode_size().

Enumeration Type Documentation

◆ mode_class

enum mode_class
Enumerator
MODE_CLASSES 
MAX_MODE_CLASS 

◆ requirement

Diagnose failure to meet expectations in a partially filled out
mode structure.   
Enumerator
SET 
UNSET 
OPTIONAL 

Function Documentation

◆ calc_wider_mode()

static void calc_wider_mode ( void )
static

◆ cmp_modes()

static int cmp_modes ( const void * a,
const void * b )
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 a, b, mode_data::bytesize, mode_data::component, mode_data::counter, mode_data::order, and mode_data::precision.

Referenced by calc_wider_mode().

◆ complete_all_modes()

static void complete_all_modes ( void )
static

References mode_data::cl, complete_mode(), and for_all_modes.

Referenced by main().

◆ complete_mode()

static void complete_mode ( struct mode_data * m)
static

◆ complex_class()

static enum mode_class complex_class ( enum mode_class c)
static
Mode class operations.   

References error(), and mode_class_names.

Referenced by make_complex_modes().

◆ create_modes()

static void create_modes ( void )
static
This file contains the definitions and documentation for the
   machine modes used in the GNU compiler.
   Copyright (C) 1987-2025 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
This file defines all the MACHINE MODES used by GCC.

A machine mode specifies a size and format of data
at the machine level.

Each RTL expression has a machine mode.

At the syntax tree level, each ..._TYPE and each ..._DECL node
has a machine mode which describes data of that type or the
data of the variable declared.   
This file is included by the genmodes program.  Its text is the
body of a function.  Do not rely on this, it will change in the
future.

The following statements can be used in this file -- all have
the form of a C macro call.  In their arguments:

A CLASS argument must be one of the constants defined in
mode-classes.def, less the leading MODE_ prefix; some statements
that take CLASS arguments have restrictions on which classes are
acceptable.  For instance, INT.

A MODE argument must be the printable name of a machine mode,
without quotation marks or trailing "mode".  For instance, SI.

A PRECISION, BYTESIZE, or COUNT argument must be a positive integer
constant.

A FORMAT argument must be one of the real_mode_format structures
declared in real.h, or else a literal 0.  Do not put a leading &
on the argument.

An EXPR argument must be a syntactically valid C expression.
If an EXPR contains commas, you may need to write an extra pair of
parentheses around it, so it appears to be a single argument to the
statement.

This file defines only those modes which are of use on almost all
machines.  Other modes can be defined in the target-specific
mode definition file, config/ARCH/ARCH-modes.def.

Order matters in this file in so far as statements which refer to
other modes must appear after the modes they refer to.  However,
statements which do not refer to other modes may appear in any
order.

  RANDOM_MODE (MODE);
     declares MODE to be of class RANDOM.

  CC_MODE (MODE);
     declares MODE to be of class CC.

  INT_MODE (MODE, BYTESIZE);
     declares MODE to be of class INT and BYTESIZE bytes wide.
     All of the bits of its representation are significant.

  FRACTIONAL_INT_MODE (MODE, PRECISION, BYTESIZE);
     declares MODE to be of class INT, BYTESIZE bytes wide in
     storage, but with only PRECISION significant bits.

  FLOAT_MODE (MODE, BYTESIZE, FORMAT);
     declares MODE to be of class FLOAT and BYTESIZE bytes wide,
     using floating point format FORMAT.
     All of the bits of its representation are significant.

  FRACTIONAL_FLOAT_MODE (MODE, PRECISION, BYTESIZE, FORMAT);
     declares MODE to be of class FLOAT, BYTESIZE bytes wide in
     storage, but with only PRECISION significant bits, using
     floating point format FORMAT.

  DECIMAL_FLOAT_MODE (MODE, BYTESIZE, FORMAT);
     declares MODE to be of class DECIMAL_FLOAT and BYTESIZE bytes
     wide.  All of the bits of its representation are significant.

  FRACTIONAL_DECIMAL_FLOAT_MODE (MODE, BYTESIZE, FORMAT);
     declares MODE to be of class DECIMAL_FLOAT and BYTESIZE bytes
     wide.  All of the bits of its representation are significant.

  FRACT_MODE (MODE, BYTESIZE, FBIT);
     declares MODE to be of class FRACT and BYTESIZE bytes wide
     with FBIT fractional bits.  There may be padding bits.

  UFRACT_MODE (MODE, BYTESIZE, FBIT);
     declares MODE to be of class UFRACT and BYTESIZE bytes wide
     with FBIT fractional bits.  There may be padding bits.

  ACCUM_MODE (MODE, BYTESIZE, IBIT, FBIT);
     declares MODE to be of class ACCUM and BYTESIZE bytes wide
     with IBIT integral bits and FBIT fractional bits.
     There may be padding bits.

  UACCUM_MODE (MODE, BYTESIZE, IBIT, FBIT);
     declares MODE to be of class UACCUM and BYTESIZE bytes wide
     with IBIT integral bits and FBIT fractional bits.
     There may be padding bits.

  RESET_FLOAT_FORMAT (MODE, FORMAT);
     changes the format of MODE, which must be class FLOAT,
     to FORMAT.  Use in an ARCH-modes.def to reset the format
     of one of the float modes defined in this file.

  PARTIAL_INT_MODE (MODE, PRECISION, NAME);
     declares a mode of class PARTIAL_INT with the same size as
     MODE (which must be an INT mode) and precision PREC.
     Optionally, NAME is the new name of the mode.  NAME is the
     name of the mode.

  VECTOR_MODE (CLASS, MODE, COUNT);
     Declare a vector mode whose component mode is MODE (of class
     CLASS) with COUNT components.  CLASS must be INT or FLOAT.
     The name of the vector mode takes the form VnX where n is
     COUNT in decimal and X is MODE.

  VECTOR_MODES (CLASS, WIDTH);
     For all modes presently declared in class CLASS, construct
     corresponding vector modes having width WIDTH.  Modes whose
     byte sizes do not evenly divide WIDTH are ignored, as are
     modes that would produce vector modes with only one component,
     and modes smaller than one byte (if CLASS is INT) or smaller
     than two bytes (if CLASS is FLOAT).  CLASS must be INT or
     FLOAT.  The names follow the same rule as VECTOR_MODE uses.

  VECTOR_MODES_WITH_PREFIX (PREFIX, CLASS, WIDTH, ORDER);
     Like VECTOR_MODES, but start the mode names with PREFIX instead
     of the usual "V".  ORDER is the top-level sorting order of the
     mode, with smaller numbers indicating a higher priority.

  VECTOR_BOOL_MODE (NAME, COUNT, COMPONENT, BYTESIZE)
     Create a vector mode called NAME that contains COUNT boolean
     elements and occupies BYTESIZE bytes in total.  Each boolean
     element is of COMPONENT type and occupies (COUNT * BITS_PER_UNIT) /
     BYTESIZE bits, with the element at index 0 occupying the lsb of the
     first byte in memory.  Only the lowest bit of each element is
     significant.

  OPAQUE_MODE (NAME, BYTESIZE)
     Create an opaque mode called NAME that is BYTESIZE bytes wide.

  COMPLEX_MODES (CLASS);
     For all modes presently declared in class CLASS, construct
     corresponding complex modes.  Modes smaller than one byte
     are ignored.  For FLOAT modes, the names are derived by
     replacing the 'F' in the mode name with a 'C'.  (It is an
     error if there is no 'F'.  For INT modes, the names are
     derived by prefixing a C to the name.

  ADJUST_BYTESIZE (MODE, EXPR);
  ADJUST_ALIGNMENT (MODE, EXPR);
  ADJUST_FLOAT_FORMAT (MODE, EXPR);
  ADJUST_IBIT (MODE, EXPR);
  ADJUST_FBIT (MODE, EXPR);
     Arrange for the byte size, alignment, floating point format, ibit,
     or fbit of MODE to be adjustable at run time.  EXPR will be executed
     once after processing all command line options, and should
     evaluate to the desired byte size, alignment, format, ibit or fbit.

     Unlike a FORMAT argument, if you are adjusting a float format
     you must put an & in front of the name of each format structure.

  ADJUST_NUNITS (MODE, EXPR);
     Like the above, but set the number of nunits of MODE to EXPR.
     This changes the size and precision of the mode in proportion
     to the change in the number of units; for example, doubling
     the number of units doubles the size and precision as well.

Note: If a mode is ever made which is more than 255 bytes wide,
machmode.h and genmodes.cc will have to be changed to allocate
more space for the mode_size and mode_alignment arrays.   
VOIDmode is used when no mode needs to be specified,
as for example on CONST_INT RTL expressions.   
BLKmode is used for structures, arrays, etc.
that fit no more specific mode.   
Single bit mode used for booleans.   
Basic integer modes.  We go up to TI in generic code (128 bits).
TImode is needed here because the some front ends now genericly
support __int128.  If the front ends decide to generically support
larger types, then corresponding modes must be added here.  The
name OI is reserved for a 256-bit type (needed by some back ends).
No partial integer modes are defined by default.   
The target normally defines any target-specific __intN types and
their modes, but __int128 for TImode is fairly common so define it
here.  The type will not be created unless the target supports
TImode.   
Basic floating point modes.  SF and DF are the only modes provided
by default.  The names QF, HF, XF, and TF are reserved for targets
that need 1-word, 2-word, 80-bit, or 128-bit float types respectively.

These are the IEEE mappings.  They can be overridden with
RESET_FLOAT_FORMAT or at runtime (in TARGET_OPTION_OVERRIDE).   
Basic CC modes.
FIXME define this only for targets that need it.   
Fixed-point modes.   
Allow the target to specify additional modes of various kinds.   
Complex modes.   
Decimal floating point modes.   
The symbol Pmode stands for one of the above machine modes (usually SImode).
The tm.h file specifies which one.  It is not a distinct mode.   

References bits_per_unit, max_bitsize_mode_any_int, and max_bitsize_mode_any_mode.

Referenced by main().

◆ emit_class_narrowest_mode()

◆ emit_insn_modes_c()

◆ emit_insn_modes_c_header()

static void emit_insn_modes_c_header ( void )
static

References EXTRA_MODES_FILE, and HAVE_EXTRA_MODES.

Referenced by emit_insn_modes_c().

◆ emit_insn_modes_h()

◆ emit_insn_modes_inline_h()

◆ emit_max_int()

static void emit_max_int ( void )
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 bits_per_unit, mode_data::bytesize, i, max_bitsize_mode_any_int, max_bitsize_mode_any_mode, MAX_MODE_CLASS, and modes.

Referenced by emit_insn_modes_h().

◆ emit_min_insn_modes_c()

◆ emit_min_insn_modes_c_header()

static void emit_min_insn_modes_c_header ( void )
static

◆ emit_mode_adjustments()

◆ emit_mode_base_align()

static void emit_mode_base_align ( void )
static

◆ emit_mode_class()

static void emit_mode_class ( void )
static

◆ emit_mode_complex()

static void emit_mode_complex ( void )
static

◆ emit_mode_fbit()

static void emit_mode_fbit ( void )
static

◆ emit_mode_ibit()

static void emit_mode_ibit ( void )
static

◆ emit_mode_inner()

static void emit_mode_inner ( void )
static

◆ emit_mode_inner_inline()

static void emit_mode_inner_inline ( void )
static
Emit mode_inner_inline routine into insn-modes.h header.   

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

Referenced by emit_insn_modes_inline_h().

◆ emit_mode_int_n()

static void emit_mode_int_n ( void )
static
Emit __intN for all modes.   

References for_all_modes, i, mode_data::int_n, int_n, n_modes, mode_data::name, print_closer, print_decl, and tagged_printf.

Referenced by emit_insn_modes_c().

◆ emit_mode_mask()

◆ emit_mode_name()

static void emit_mode_name ( void )
static

◆ emit_mode_nunits()

◆ emit_mode_nunits_inline()

static void emit_mode_nunits_inline ( void )
static
Emit mode_nunits_inline routine into insn-modes.h header.   

References a, adj_nunits, for_all_modes, mode_data::name, mode_data::ncomponents, and mode_data::need_nunits_adj.

Referenced by emit_insn_modes_inline_h().

◆ emit_mode_precision()

◆ emit_mode_size()

◆ emit_mode_size_inline()

static void emit_mode_size_inline ( void )
static
Emit mode_size_inline routine into insn-modes.h header.   

References a, adj_bytesize, adj_nunits, mode_data::bytesize, for_all_modes, mode_data::name, mode_data::need_bytesize_adj, and mode_data::next_cont.

Referenced by emit_insn_modes_inline_h().

◆ emit_mode_unit_precision()

static void emit_mode_unit_precision ( void )
static
Emit mode_unit_precision array into insn-modes.cc file.   

References mode_data::bytesize, mode_data::component, for_all_modes, mode_data::name, mode_data::precision, print_closer, print_decl, and tagged_printf.

Referenced by emit_insn_modes_c().

◆ emit_mode_unit_precision_inline()

static void emit_mode_unit_precision_inline ( void )
static
Emit mode_unit_precision_inline routine into insn-modes.h header.   

References mode_data::bytesize, mode_data::component, for_all_modes, mode_data::name, and mode_data::precision.

Referenced by emit_insn_modes_inline_h().

◆ emit_mode_unit_size()

static void emit_mode_unit_size ( void )
static
Emit mode_unit_size array into insn-modes.cc file.   

References adj_bytesize, mode_data::bytesize, mode_data::component, for_all_modes, mode_data::name, print_closer, print_maybe_const_decl, and tagged_printf.

Referenced by emit_insn_modes_c().

◆ emit_mode_unit_size_inline()

static void emit_mode_unit_size_inline ( void )
static
Emit mode_unit_size_inline routine into insn-modes.h header.   

References mode_data::bytesize, mode_data::component, for_all_modes, mode_data::name, and mode_data::need_bytesize_adj.

Referenced by emit_insn_modes_inline_h().

◆ emit_mode_wider()

◆ emit_real_format_for_mode()

static void emit_real_format_for_mode ( void )
static

◆ eq_mode()

static int eq_mode ( const void * p,
const void * q )
static

References a, and b.

Referenced by main().

◆ find_mode()

static struct mode_data * find_mode ( const char * name)
inlinestatic

◆ get_mode_class()

static const char * get_mode_class ( struct mode_data * mode)
static
Return the best machine mode class for MODE, or null if machine_mode
should be used.   

References mode_data::cl, and NULL.

Referenced by emit_insn_modes_h().

◆ hash_mode()

static hashval_t hash_mode ( const void * p)
static

References mode_data::name.

Referenced by main().

◆ main()

◆ make_bool_mode()

static void make_bool_mode ( const char * name,
unsigned int precision,
unsigned int bytesize,
const char * file,
unsigned int line )
static

◆ make_complex_modes()

static void make_complex_modes ( enum mode_class cl,
const char * file,
unsigned int line )
static

◆ make_decimal_float_mode()

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

◆ make_fixed_point_mode()

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::cl, mode_data::fbit, mode_data::file, mode_data::ibit, mode_data::line, mode_data::name, and new_mode().

◆ make_float_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

◆ make_int_mode()

static void make_int_mode ( const char * name,
unsigned int precision,
unsigned int bytesize,
const char * file,
unsigned int line )
static

◆ make_int_n()

static void make_int_n ( const char * m,
int bitsize,
const char * file,
unsigned int line )
static

◆ make_opaque_mode()

static void make_opaque_mode ( const char * name,
unsigned int precision,
unsigned int bytesize,
const char * file,
unsigned int line )
static

◆ make_partial_integer_mode()

static void make_partial_integer_mode ( const char * base,
const char * name,
unsigned int precision,
const char * file,
unsigned int line )
static

◆ make_special_mode()

static void make_special_mode ( enum mode_class cl,
const char * name,
const char * file,
unsigned int line )
static

◆ make_vector_bool_mode()

static void make_vector_bool_mode ( const char * name,
unsigned int count,
const char * component,
unsigned int bytesize,
const char * file,
unsigned int line )
static

◆ make_vector_mode()

static void make_vector_mode ( enum mode_class bclass,
const char * prefix,
const char * base,
unsigned int ncomponents,
unsigned int order,
const char * file,
unsigned int line )
static

◆ make_vector_modes()

static void make_vector_modes ( enum mode_class cl,
const char * prefix,
unsigned int width,
unsigned int order,
const char * file,
unsigned int line )
static

◆ new_adjust()

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

◆ new_mode()

◆ reset_float_format()

static void reset_float_format ( const char * name,
const char * format,
const char * file,
unsigned int line )
static

◆ validate_mode()

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

References validate_field.

Referenced by complete_mode().

◆ vector_class()

static enum mode_class vector_class ( enum mode_class cl)
static

References error(), and mode_class_names.

Referenced by make_vector_mode(), and make_vector_modes().

Variable Documentation

◆ adj_alignment

struct mode_adjust* adj_alignment
static

◆ adj_bytesize

◆ adj_fbit

struct mode_adjust* adj_fbit
static

◆ adj_format

struct mode_adjust* adj_format
static

◆ adj_ibit

struct mode_adjust* adj_ibit
static

◆ adj_nunits

◆ adj_precision

struct mode_adjust* adj_precision
static

Referenced by emit_mode_adjustments().

◆ bits_per_unit

int bits_per_unit
static

Referenced by create_modes(), and emit_max_int().

◆ blank_mode

const struct mode_data blank_mode
static
Initial value:
= {
0, "<unknown>", MAX_MODE_CLASS,
0, -1U, -1U, -1U, -1U,
0, 0, 0, 0, 0, 0,
"<unknown>", 0, 0, 0, 0, false, false, 0,
false
}

Referenced by new_mode().

◆ max_bitsize_mode_any_int

int max_bitsize_mode_any_int
static

Referenced by create_modes(), and emit_max_int().

◆ max_bitsize_mode_any_mode

int max_bitsize_mode_any_mode
static

Referenced by create_modes(), and emit_max_int().

◆ mode_class_names

const char* const mode_class_names[MAX_MODE_CLASS]
static

◆ modes

◆ modes_by_name

htab_t modes_by_name
static

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

◆ n_modes

unsigned int n_modes[MAX_MODE_CLASS]
static

◆ void_mode