|
GCC Middle and Back End API 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"
Data Structures | |
| struct | extraction |
| struct | code_ptr |
| class | accum_extract |
Macros | |
| #define | ENCODE_PATH_STEP(INDEX, IS_VECTOR) |
| #define | MISSING_OPERAND_STEP 255 |
| #define | MAX_PATH_INDEX ((MISSING_OPERAND_STEP - 2) / 2) |
Typedefs | |
| typedef unsigned char * | locstr |
Functions | |
| static void | walk_rtx (md_rtx_info *, rtx, class accum_extract *) |
| static void | push_pathstr_operand (int operand, bool is_vector, class accum_extract *acc) |
| static void | gen_insn (md_rtx_info *info) |
| static void | VEC_safe_set_locstr (md_rtx_info *info, vec< locstr > *vp, unsigned int ix, locstr str) |
| static unsigned char * | VEC_char_to_string (const vec< unsigned char > &v) |
| static void | add_path (const unsigned char *path) |
| static void | print_header (void) |
| static void | print_extractions (void) |
| int | main (int argc, const char **argv) |
Variables | |
| static struct extraction * | extractions |
| static struct code_ptr * | peepholes |
| static struct obstack | pathpool |
| static vec< int > | dupnums |
| #define ENCODE_PATH_STEP | ( | INDEX, | |
| IS_VECTOR ) |
A path is a sequence of steps down a pattern, one byte each. A step down XEXP (x, INDEX) is 2 * INDEX + 1 and a step down XVECEXP (x, 0, INDEX) is 2 * INDEX + 2, which leaves zero free to terminate a path and MISSING_OPERAND_STEP free to mark an operand number that the pattern does not use.
Referenced by push_pathstr_operand().
| #define MAX_PATH_INDEX ((MISSING_OPERAND_STEP - 2) / 2) |
Referenced by push_pathstr_operand().
| #define MISSING_OPERAND_STEP 255 |
Referenced by add_path(), and print_extractions().
| typedef unsigned char* locstr |
Generate code from machine description to extract operands from insn as rtl. Copyright (C) 1987-2026 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 structure contains all the information needed to describe one set of extractions methods. Each method may be used by more than one pattern if the operands are in the same place. The string for each operand describes that path to the operand and contains `0' through `9' when going into an expression and `a' through `z' then 'A' through to 'Z' when going into a vector. We assume here that only the first operand of an rtl expression is a vector. genrecog.cc makes the same assumption (and uses the same representation) and it is currently true.
|
static |
Add PATH, which is null for an operand number that the pattern skips, to the path pool.
References add_path(), MISSING_OPERAND_STEP, and pathpool.
Referenced by add_env_var_paths(), add_path(), add_path(), add_standard_paths(), and print_extractions().
|
static |
References a, b, md_rtx_info::def, extraction::dup_count, accum_extract::duplocs, extraction::duplocs, accum_extract::dupnums, extraction::dupnums, extractions, gcc_assert, gen_insn(), i, md_rtx_info::index, extraction::insns, extraction::next, link::next, extraction::op_count, accum_extract::oplocs, extraction::oplocs, accum_extract::pathstr, push_pathstr_operand(), walk_rtx(), XVECEXP, and XVECLEN.
| int main | ( | int | argc, |
| const char ** | argv ) |
|
static |
Print the tables that drive insn_extract, and insn_extract itself.
References add_path(), extraction::dup_count, extraction::duplocs, dupnums, extraction::dupnums, extractions, gcc_assert, i, IN_RANGE, extraction::insns, MISSING_OPERAND_STEP, extraction::next, link::next, extraction::op_count, extraction::oplocs, pathpool, peepholes, print_extractions(), UCHAR_MAX, and USHRT_MAX.
Referenced by main(), and print_extractions().
|
static |
References print_header().
|
static |
Encode the step to OPERAND, a vector element if IS_VECTOR, and push it onto the end of the path in ACC.
References ENCODE_PATH_STEP, gcc_assert, IN_RANGE, MAX_PATH_INDEX, accum_extract::pathstr, and push_pathstr_operand().
Referenced by gen_insn(), push_pathstr_operand(), and walk_rtx().
|
static |
Another helper subroutine of walk_rtx: given a vec of path steps, convert it to a zero-terminated path in malloc memory. No step is zero, so the result can be handled as a string.
References VEC_char_to_string().
Referenced by VEC_char_to_string(), and walk_rtx().
|
static |
Helper subroutine of walk_rtx: given a vec<locstr>, an index, and a string, insert the string at the index, which should either already exist and be NULL, or not yet exist within the vector. In the latter case the vector is enlarged as appropriate. INFO describes the containing define_* expression.
References have_error, md_rtx_info::loc, message_at(), NULL, and VEC_safe_set_locstr().
Referenced by VEC_safe_set_locstr(), and walk_rtx().
|
static |
Forward declarations.
References accum_extract::duplocs, accum_extract::dupnums, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, MATCH_OPERAND, MATCH_OPERATOR, MATCH_PARALLEL, accum_extract::oplocs, accum_extract::pathstr, push_pathstr_operand(), RTX_CODE, VEC_char_to_string(), VEC_safe_set_locstr(), walk_rtx(), XEXP, XINT, XVECEXP, and XVECLEN.
Referenced by gen_insn(), and walk_rtx().
|
static |
The dup numbers of all extraction methods, concatenated.
Referenced by print_extractions().
|
static |
All extractions needed for this machine description.
Referenced by gen_insn(), and print_extractions().
|
static |
The paths of all extraction methods, concatenated. Each path is zero terminated; the paths of one method are adjacent, operands first and dups second.
Referenced by add_path(), and print_extractions().
|
static |
All insn codes for old-style peepholes.
Referenced by main(), and print_extractions().