GCC Middle and Back End API Reference
|
#include "bconfig.h"
#include "system.h"
#include "errors.h"
#include "mode-classes.def"
#include "machmode.def"
Data Structures | |
struct | mode_data |
struct | mode_adjust |
Enumerations | |
enum | mode_class { MODE_CLASSES , MAX_MODE_CLASS } |
enum | requirement { SET , UNSET , OPTIONAL } |
#define _ADD_ADJUST | ( | A, | |
M, | |||
X, | |||
C1, | |||
C2 ) new_adjust (#M, &adj_##A, #A, #X, MODE_##C1, MODE_##C2, __FILE__, __LINE__) |
Adjustability.
#define ACCUM_MODE | ( | N, | |
Y, | |||
I, | |||
F ) make_fixed_point_mode (MODE_ACCUM, #N, Y, I, F, __FILE__, __LINE__) |
#define CC_MODE | ( | N | ) | _SPECIAL_MODE (CC, N) |
For each mode in class CLASS, construct a corresponding complex mode.
Generate the machine mode enumeration and associated tables. Copyright (C) 2003-2024 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.
Generate the machine mode enumeration and associated tables. Copyright (C) 2003-2024 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.
#define EXTRA_MODES_FILE "" |
Referenced by complete_all_modes(), emit_insn_modes_h(), emit_mode_adjustments(), emit_mode_base_align(), emit_mode_class(), emit_mode_complex(), emit_mode_fbit(), emit_mode_ibit(), emit_mode_inner(), emit_mode_inner_inline(), emit_mode_int_n(), emit_mode_mask(), emit_mode_name(), emit_mode_nunits(), emit_mode_nunits_inline(), emit_mode_precision(), emit_mode_size(), emit_mode_size_inline(), emit_mode_unit_precision(), emit_mode_unit_precision_inline(), emit_mode_unit_size(), emit_mode_unit_size_inline(), and emit_mode_wider().
#define FRACT_MODE | ( | N, | |
Y, | |||
F ) make_fixed_point_mode (MODE_FRACT, #N, Y, 0, F, __FILE__, __LINE__) |
#define FRACTIONAL_DECIMAL_FLOAT_MODE | ( | N, | |
B, | |||
Y, | |||
F ) make_decimal_float_mode (#N, B, Y, #F, __FILE__, __LINE__) |
#define HAVE_EXTRA_MODES 0 |
#define NUM_POLY_INT_COEFFS 1 |
Referenced by inchash::add_rtx(), bp_pack_poly_value(), bp_unpack_poly_value(), build_new_poly_int_cst(), build_poly_int_cst(), const_poly_int_value(), cselib_hash_rtx(), DFS::DFS_write_tree_body(), dump_generic_node(), emit_insn_modes_h(), const_poly_int_hasher::equal(), equiv_constant(), estimated_poly_value(), force_fit_type(), const_poly_int_hasher::hash(), operand_compare::hash_operand(), hash_rtx(), hash_tree(), immed_wide_int_const(), init_emit_once(), int_loc_descriptor(), lto_input_ts_poly_tree_pointers(), poly_int_binop(), poly_int_cst_value(), poly_int_rtx_p(), print_node(), print_poly_int(), rtx_writer::print_rtx(), print_value(), ptrdiff_tree_p(), rtx_to_poly_int64(), SET_TYPE_VECTOR_SUBPARTS(), simplify_const_binary_operation(), streamer_read_poly_int64(), streamer_read_poly_uint64(), streamer_write_poly_int64(), streamer_write_poly_uint64(), wi::to_poly_offset(), wi::to_poly_widest(), tree_fits_poly_int64_p(), tree_fits_poly_uint64_p(), trunc_int_for_mode(), TYPE_VECTOR_SUBPARTS(), subreg_shape::unique_id(), valid_constant_size_p(), valid_vector_subparts_p(), and write_ts_poly_tree_pointers().
#define PARTIAL_INT_MODE | ( | M, | |
PREC, | |||
NAME ) make_partial_integer_mode (#M, #NAME, PREC, __FILE__, __LINE__) |
Partial integer modes are specified by relation to a full integer mode.
#define print_closer | ( | ) | puts ("};") |
Referenced by emit_class_narrowest_mode(), emit_mode_base_align(), emit_mode_class(), emit_mode_complex(), emit_mode_fbit(), emit_mode_ibit(), emit_mode_inner(), emit_mode_int_n(), emit_mode_mask(), emit_mode_name(), emit_mode_nunits(), emit_mode_precision(), emit_mode_size(), emit_mode_unit_precision(), emit_mode_unit_size(), emit_mode_wider(), and emit_real_format_for_mode().
#define RANDOM_MODE | ( | N | ) | _SPECIAL_MODE (RANDOM, N) |
Output routines.
Referenced by emit_class_narrowest_mode(), emit_mode_base_align(), emit_mode_class(), emit_mode_complex(), emit_mode_fbit(), emit_mode_ibit(), emit_mode_inner(), emit_mode_int_n(), emit_mode_mask(), emit_mode_nunits(), emit_mode_precision(), emit_mode_size(), emit_mode_unit_precision(), emit_mode_unit_size(), emit_mode_wider(), and emit_real_format_for_mode().
#define UACCUM_MODE | ( | N, | |
Y, | |||
I, | |||
F ) make_fixed_point_mode (MODE_UACCUM, #N, Y, I, F, __FILE__, __LINE__) |
#define UFRACT_MODE | ( | N, | |
Y, | |||
F ) make_fixed_point_mode (MODE_UFRACT, #N, Y, 0, F, __FILE__, __LINE__) |
#define validate_field | ( | M, | |
F ) validate_field_(M->name, #F, r_##F, M->F, blank_mode.F, M->file, M->line) |
Referenced by validate_mode().
Create a vector of booleans called NAME with COUNT elements and BYTESIZE bytes in total.
#define VECTOR_MODE_WITH_PREFIX | ( | PREFIX, | |
C, | |||
M, | |||
N, | |||
ORDER ) make_vector_mode (MODE_##C, #PREFIX, #M, N, ORDER, __FILE__, __LINE__); |
A single vector mode can be specified by naming its component mode and the number of components.
#define VECTOR_MODES_WITH_PREFIX | ( | PREFIX, | |
C, | |||
W, | |||
ORDER ) make_vector_modes (MODE_##C, #PREFIX, W, ORDER, __FILE__, __LINE__) |
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.
#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().
References cmp_modes(), ggc_alloc(), i, MAX, MAX_MODE_CLASS, modes, n_modes, mode_data::next, qsort, void_mode, and mode_data::wider.
Referenced by main().
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().
References mode_data::cl, complete_mode(), and for_all_modes.
Referenced by main().
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, gcc_unreachable, ggc_alloc(), mode_data::line, MAX_MODE_CLASS, mode_data::name, mode_data::ncomponents, mode_data::next_cont, OPTIONAL, mode_data::precision, SET, UNSET, validate_mode(), and void_mode.
Referenced by complete_all_modes().
|
static |
Mode class operations.
References error(), ggc_alloc(), and mode_class_names.
Referenced by make_complex_modes().
References bits_per_unit, ggc_alloc(), max_bitsize_mode_any_int, and max_bitsize_mode_any_mode.
Referenced by main().
References mode_data::boolean, ggc_alloc(), MAX_MODE_CLASS, mode_class_names, modes, mode_data::name, mode_data::next, print_closer, print_decl, tagged_printf, and void_mode.
Referenced by emit_insn_modes_c(), and emit_min_insn_modes_c().
References emit_class_narrowest_mode(), emit_insn_modes_c_header(), emit_mode_adjustments(), emit_mode_base_align(), emit_mode_class(), emit_mode_complex(), emit_mode_fbit(), emit_mode_ibit(), emit_mode_inner(), emit_mode_int_n(), emit_mode_mask(), emit_mode_name(), emit_mode_nunits(), emit_mode_precision(), emit_mode_size(), emit_mode_unit_precision(), emit_mode_unit_size(), emit_mode_wider(), and emit_real_format_for_mode().
Referenced by main().
References EXTRA_MODES_FILE, ggc_alloc(), and HAVE_EXTRA_MODES.
Referenced by emit_insn_modes_c().
References adj_alignment, adj_bytesize, adj_fbit, adj_format, adj_ibit, adj_nunits, mode_data::boolean, emit_max_int(), EXTRA_MODES_FILE, mode_data::file, for_all_modes, get_mode_class(), ggc_alloc(), HAVE_EXTRA_MODES, mode_data::int_n, last, mode_data::line, MAX_MODE_CLASS, mode_class_names, modes, mode_data::name, mode_data::next, NUM_POLY_INT_COEFFS, trim_filename(), and void_mode.
Referenced by main().
References emit_mode_inner_inline(), emit_mode_nunits_inline(), emit_mode_size_inline(), emit_mode_unit_precision_inline(), emit_mode_unit_size_inline(), EXTRA_MODES_FILE, ggc_alloc(), and HAVE_EXTRA_MODES.
Referenced by main().
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, ggc_alloc(), i, max_bitsize_mode_any_int, max_bitsize_mode_any_mode, MAX_MODE_CLASS, modes, and mode_data::next.
Referenced by emit_insn_modes_h().
References emit_class_narrowest_mode(), emit_min_insn_modes_c_header(), emit_mode_class(), emit_mode_inner(), emit_mode_name(), emit_mode_nunits(), and emit_mode_wider().
Referenced by main().
References EXTRA_MODES_FILE, ggc_alloc(), and HAVE_EXTRA_MODES.
Referenced by emit_min_insn_modes_c().
References a, adj_alignment, adj_bytesize, adj_fbit, adj_format, adj_ibit, adj_nunits, adj_precision, mode_data::cl, mode_data::contained, for_all_modes, ggc_alloc(), internal_error(), mode_data::name, mode_data::ncomponents, mode_adjust::next, and mode_data::next_cont.
Referenced by emit_insn_modes_c().
References adj_alignment, mode_data::alignment, for_all_modes, mode_data::name, print_closer, print_maybe_const_decl, and tagged_printf.
Referenced by emit_insn_modes_c().
References mode_data::cl, for_all_modes, mode_class_names, mode_data::name, print_closer, print_decl, and tagged_printf.
Referenced by emit_insn_modes_c(), and emit_min_insn_modes_c().
References mode_data::complex, for_all_modes, mode_data::name, print_closer, print_decl, tagged_printf, and void_mode.
Referenced by emit_insn_modes_c().
Emit fbit for all modes.
References adj_fbit, mode_data::fbit, for_all_modes, mode_data::name, print_closer, print_maybe_const_decl, and tagged_printf.
Referenced by emit_insn_modes_c().
Emit ibit for all modes.
References adj_ibit, for_all_modes, mode_data::ibit, mode_data::name, print_closer, print_maybe_const_decl, and tagged_printf.
Referenced by emit_insn_modes_c().
References mode_data::component, for_all_modes, ggc_alloc(), mode_data::name, print_closer, print_decl, and tagged_printf.
Referenced by emit_insn_modes_c(), and emit_min_insn_modes_c().
Emit mode_inner_inline routine into insn-modes.h header.
References mode_data::component, for_all_modes, ggc_alloc(), and mode_data::name.
Referenced by emit_insn_modes_inline_h().
Emit __intN for all modes.
References for_all_modes, ggc_alloc(), 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().
References adj_nunits, mode_data::bytesize, for_all_modes, ggc_alloc(), mode_data::name, mode_data::precision, print_closer, print_maybe_const_decl, and tagged_printf.
Referenced by emit_insn_modes_c().
References for_all_modes, ggc_alloc(), mode_data::name, print_closer, and print_decl.
Referenced by emit_insn_modes_c(), and emit_min_insn_modes_c().
References adj_nunits, for_all_modes, mode_data::name, mode_data::ncomponents, print_closer, print_maybe_const_decl, tagged_printf, and ZERO_COEFFS.
Referenced by emit_insn_modes_c(), and emit_min_insn_modes_c().
Emit mode_nunits_inline routine into insn-modes.h header.
References a, adj_nunits, for_all_modes, ggc_alloc(), mode_data::name, mode_data::ncomponents, mode_data::need_nunits_adj, and mode_adjust::next.
Referenced by emit_insn_modes_inline_h().
References adj_nunits, mode_data::bytesize, for_all_modes, mode_data::name, mode_data::precision, print_closer, print_maybe_const_decl, tagged_printf, and ZERO_COEFFS.
Referenced by emit_insn_modes_c().
References adj_bytesize, adj_nunits, mode_data::bytesize, for_all_modes, mode_data::name, print_closer, print_maybe_const_decl, tagged_printf, and ZERO_COEFFS.
Referenced by emit_insn_modes_c().
Emit mode_size_inline routine into insn-modes.h header.
References a, adj_bytesize, adj_nunits, mode_data::bytesize, mode_data::contained, for_all_modes, ggc_alloc(), mode_data::name, mode_data::need_bytesize_adj, mode_adjust::next, and mode_data::next_cont.
Referenced by emit_insn_modes_inline_h().
Emit mode_unit_precision array into insn-modes.cc file.
References mode_data::bytesize, mode_data::component, for_all_modes, ggc_alloc(), mode_data::name, mode_data::precision, print_closer, print_decl, and tagged_printf.
Referenced by emit_insn_modes_c().
Emit mode_unit_precision_inline routine into insn-modes.h header.
References mode_data::bytesize, mode_data::component, for_all_modes, ggc_alloc(), mode_data::name, and mode_data::precision.
Referenced by emit_insn_modes_inline_h().
Emit mode_unit_size array into insn-modes.cc file.
References adj_bytesize, mode_data::bytesize, mode_data::component, for_all_modes, ggc_alloc(), mode_data::name, print_closer, print_maybe_const_decl, and tagged_printf.
Referenced by emit_insn_modes_c().
Emit mode_unit_size_inline routine into insn-modes.h header.
References mode_data::bytesize, mode_data::component, for_all_modes, ggc_alloc(), mode_data::name, and mode_data::need_bytesize_adj.
Referenced by emit_insn_modes_inline_h().
References mode_data::bytesize, mode_data::cl, mode_data::component, for_all_modes, ggc_alloc(), mode_data::name, mode_data::ncomponents, mode_data::precision, print_closer, print_decl, tagged_printf, void_mode, and mode_data::wider.
Referenced by emit_insn_modes_c(), and emit_min_insn_modes_c().
References mode_data::format, ggc_alloc(), modes, mode_data::name, mode_data::next, print_closer, print_decl, print_maybe_const_decl, and tagged_printf.
Referenced by emit_insn_modes_c().
References a, b, and ggc_alloc().
Referenced by main().
Utility routines.
References ggc_alloc(), modes_by_name, and mode_data::name.
Referenced by make_int_n(), make_partial_integer_mode(), make_vector_bool_mode(), make_vector_mode(), new_adjust(), new_mode(), and reset_float_format().
Return the best machine mode class for MODE, or null if machine_mode should be used.
References mode_data::cl, ggc_alloc(), and NULL.
Referenced by emit_insn_modes_h().
References ggc_alloc(), and mode_data::name.
Referenced by main().
int main | ( | int | argc, |
char ** | argv ) |
Master control.
References calc_wider_mode(), complete_all_modes(), create_modes(), emit_insn_modes_c(), emit_insn_modes_h(), emit_insn_modes_inline_h(), emit_min_insn_modes_c(), eq_mode(), error(), FATAL_EXIT_CODE, free(), gen_header, ggc_alloc(), hash_mode(), have_error, modes_by_name, progname, and SUCCESS_EXIT_CODE.
|
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().
|
static |
References mode_data::bytesize, mode_data::file, ggc_alloc(), mode_data::line, mode_data::name, new_mode(), and mode_data::precision.
References error(), mode_data::file, find_mode(), ggc_alloc(), and mode_data::line.
|
static |
References mode_data::bytesize, mode_data::file, ggc_alloc(), mode_data::line, mode_data::name, new_mode(), and mode_data::precision.
|
static |
References mode_data::component, error(), mode_data::file, find_mode(), ggc_alloc(), mode_data::line, mode_data::name, new_mode(), and mode_data::precision.
|
static |
References mode_data::cl, mode_data::file, mode_data::line, mode_data::name, and new_mode().
|
static |
References a, mode_adjust::adjustment, mode_data::cl, error(), mode_data::file, mode_adjust::file, find_mode(), ggc_alloc(), mode_adjust::line, mode_adjust::mode, mode_class_names, mode_data::name, and trim_filename().
Referenced by try_apply_stack_adjustment().
|
static |
References blank_mode, mode_data::cl, count, mode_data::counter, error(), mode_data::file, find_mode(), ggc_alloc(), mode_data::line, modes, modes_by_name, n_modes, mode_data::name, mode_data::next, and trim_filename().
Referenced by can_eliminate_compare(), cse_insn(), emit_move_change_mode(), extract_bit_field_1(), extract_fixed_bit_field_1(), find_shift_sequence(), make_bool_mode(), make_complex_modes(), make_decimal_float_mode(), make_field_assignment(), make_fixed_point_mode(), make_float_mode(), make_int_mode(), make_opaque_mode(), make_partial_integer_mode(), make_special_mode(), make_vector_bool_mode(), make_vector_mode(), make_vector_modes(), maybe_mode_change(), maybe_select_cc_mode(), mode_change_ok(), reload_adjust_reg_for_icode(), reload_adjust_reg_for_temp(), signed_or_unsigned_type_for(), simplify_while_replacing(), try_combine(), update_reg_equal_equiv_notes(), vect_double_mask_nunits(), and vect_halve_mask_nunits().
|
static |
References mode_data::cl, error(), mode_data::file, find_mode(), mode_data::format, ggc_alloc(), mode_data::line, and mode_data::name.
|
static |
References validate_field.
Referenced by complete_mode().
|
static |
References error(), ggc_alloc(), and mode_class_names.
Referenced by make_vector_mode(), and make_vector_modes().
|
static |
Referenced by emit_insn_modes_h(), emit_mode_adjustments(), and emit_mode_base_align().
|
static |
Referenced by emit_insn_modes_h(), emit_mode_adjustments(), emit_mode_size(), emit_mode_size_inline(), and emit_mode_unit_size().
|
static |
Referenced by emit_insn_modes_h(), emit_mode_adjustments(), and emit_mode_fbit().
|
static |
Referenced by emit_insn_modes_h(), and emit_mode_adjustments().
|
static |
Referenced by emit_insn_modes_h(), emit_mode_adjustments(), and emit_mode_ibit().
|
static |
|
static |
Referenced by emit_mode_adjustments().
|
static |
Referenced by create_modes(), and emit_max_int().
Referenced by new_mode().
|
static |
Referenced by create_modes(), and emit_max_int().
|
static |
Referenced by create_modes(), and emit_max_int().
|
static |
Referenced by complex_class(), emit_class_narrowest_mode(), emit_insn_modes_h(), emit_mode_class(), make_vector_mode(), new_adjust(), and vector_class().
|
static |
Referenced by calc_wider_mode(), cse_cc_succs(), decode_asm_operands(), emit_class_narrowest_mode(), emit_insn_modes_h(), emit_max_int(), emit_real_format_for_mode(), initialize_iterators(), make_complex_modes(), make_vector_modes(), new_mode(), omp_clause_aligned_alignment(), omp_max_vf(), rtx_reader::read_rtx_code(), record_operand_costs(), and record_reg_classes().
|
static |
Referenced by find_mode(), main(), and new_mode().
|
static |
Referenced by calc_wider_mode(), emit_mode_int_n(), and new_mode().
Referenced by calc_wider_mode(), complete_mode(), emit_class_narrowest_mode(), emit_insn_modes_h(), emit_mode_complex(), and emit_mode_wider().