GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | operand_alternative |
struct | recog_data_d |
struct | insn_gen_fn |
struct | insn_operand_data |
struct | insn_data_d |
Macros | |
#define | MAX_RECOG_ALTERNATIVES 30 |
#define | memory_address_p(mode, addr) memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC) |
#define | strict_memory_address_p(mode, addr) strict_memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC) |
#define | offsettable_address_p(strict, mode, addr) |
#define | INSN_OUTPUT_FORMAT_NONE 0 /* abort */ |
#define | INSN_OUTPUT_FORMAT_SINGLE 1 /* const char * */ |
#define | INSN_OUTPUT_FORMAT_MULTI 2 /* const char * const * */ |
#define | INSN_OUTPUT_FORMAT_FUNCTION 3 /* const char * (*)(...) */ |
Typedefs | |
typedef int(* | insn_operand_predicate_fn )(rtx, enum machine_mode) |
typedef const char *(* | insn_output_fn )(rtx *, rtx) |
Enumerations | |
enum | op_type { OP_IN, OP_OUT, OP_INOUT } |
Variables | |
int | volatile_ok |
int | which_alternative |
struct recog_data_d | recog_data |
struct operand_alternative | recog_op_alt [MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES] |
struct insn_data_d | insn_data [] |
int | peep2_current_count |
#define INSN_OUTPUT_FORMAT_FUNCTION 3 /* const char * (*)(...) */ |
#define INSN_OUTPUT_FORMAT_MULTI 2 /* const char * const * */ |
#define INSN_OUTPUT_FORMAT_NONE 0 /* abort */ |
Legal values for insn_data.output_format. Indicate what type of data is stored in insn_data.output.
#define INSN_OUTPUT_FORMAT_SINGLE 1 /* const char * */ |
#define MAX_RECOG_ALTERNATIVES 30 |
Declarations for interface to insn recognizer and insn-output.c. Copyright (C) 1987-2013 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/. Random number that should be large enough for all purposes.
#define memory_address_p | ( | mode, | |
addr | |||
) | memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC) |
Referenced by default_legitimate_address_p().
#define offsettable_address_p | ( | strict, | |
mode, | |||
addr | |||
) |
#define strict_memory_address_p | ( | mode, | |
addr | |||
) | strict_memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC) |
Referenced by default_legitimate_address_p().
typedef int(* insn_operand_predicate_fn)(rtx, enum machine_mode) |
A table defined in insn-output.c that give information about each insn-code value.
enum op_type |
void add_clobbers | ( | rtx | , |
int | |||
) |
Referenced by insn_invalid_p().
int added_clobbers_hard_reg_p | ( | int | ) |
Referenced by insn_invalid_p().
int apply_change_group | ( | void | ) |
Apply a group of changes previously issued with `validate_change'. If all changes are valid, call confirm_change_group and return 1, otherwise, call cancel_changes and return 0.
Referenced by find_comparison_args(), find_invariants_to_move(), and redirect_exp_1().
int asm_operand_ok | ( | rtx | , |
const char * | , | ||
const char ** | |||
) |
void cancel_changes | ( | int | ) |
int check_asm_operands | ( | rtx | ) |
void confirm_change_group | ( | void | ) |
A group of changes has previously been issued with validate_change and verified with verify_changes. Call df_insn_rescan for each of the insn changed and clear num_changes.
Avoid unnecessary rescanning when multiple changes to same instruction are made.
References confirm_change_group().
Referenced by confirm_change_group(), and redirect_jump_1().
int constrain_operands | ( | int | ) |
int constrain_operands_cached | ( | int | ) |
void extract_constrain_insn_cached | ( | rtx | ) |
void extract_insn | ( | rtx | ) |
void extract_insn_cached | ( | rtx | ) |
void init_recog | ( | void | ) |
References extract_asm_operands(), and NULL_RTX.
Referenced by profile_function().
void init_recog_no_volatile | ( | void | ) |
Initialize data used by the function `recog'. This must be called once in the compilation of a function before any insn recognition may be done in the function.
References volatile_ok.
void insn_extract | ( | rtx | ) |
int memory_address_addr_space_p | ( | enum machine_mode | mode, |
rtx | addr, | ||
addr_space_t | as | ||
) |
Return 1 if ADDR is a valid memory address for mode MODE in address space AS.
Referenced by determine_common_wider_type(), gen_lowpart_if_possible(), get_computation(), num_changes_pending(), and reload_combine_closest_single_use().
bool mode_dependent_address_p | ( | rtx | , |
addr_space_t | |||
) |
int num_changes_pending | ( | void | ) |
Return number of changes made and not validated yet.
References GET_MODE, MEM_ADDR_SPACE, memory_address_addr_space_p(), and XEXP.
int num_validated_changes | ( | void | ) |
Return the number of changes so far in the current group.
References GET_CODE, swap_commutative_operands_p(), SWAPPABLE_OPERANDS_P, and XEXP.
int offsettable_address_addr_space_p | ( | int | strictp, |
enum machine_mode | mode, | ||
rtx | y, | ||
addr_space_t | as | ||
) |
Return 1 if Y is a memory address which contains no side effects and would remain valid for address space AS after the addition of a positive integer less than the size of that mode.
We assume that the original address is valid and do not check it. We do check that it is valid for narrower modes.
If STRICTP is nonzero, we require a strictly valid address, for the sake of use in reload.c.
Adjusting an offsettable address involves changing to a narrower mode. Make sure that's OK.
??? How much offset does an offsettable BLKmode reference need? Clearly that depends on the situation in which it's being used. However, the current situation in which we test 0xffffffff is less than ideal. Caveat user.
If the expression contains a constant term, see if it remains valid when max possible offset is added.
Use QImode because an odd displacement may be automatically invalid for any wider mode. But it should be valid for a single byte.
In any case, restore old contents of memory.
The offset added here is chosen as the maximum offset that any instruction could need to add when operating on something of the specified mode. We assume that if Y and Y+c are valid addresses then so is Y+d for all 0<d<c. adjust_address will go inside a LO_SUM here, so we do so as well.
Use QImode because an odd displacement may be automatically invalid for any wider mode. But it should be valid for a single byte.
References constrain_operands(), and which_alternative.
int offsettable_memref_p | ( | rtx | ) |
int offsettable_nonstrict_memref_p | ( | rtx | ) |
rtx peep2_next_insn | ( | int | ) |
int peep2_reg_dead_p | ( | int | , |
rtx | |||
) |
int peep2_regno_dead_p | ( | int | , |
int | |||
) |
void preprocess_constraints | ( | void | ) |
After calling extract_insn, you can use this function to extract some information from the constraint strings into a more usable form. The collected data is stored in recog_op_alt.
These don't say anything we care about.
Referenced by process_bb_node_lives().
Referenced by canonicalize_change_group(), gmalloc(), and init_elim_table().
|
inlinestatic |
Referenced by noce_emit_store_flag().
|
inlinestatic |
Try recognizing the instruction INSN, and return the code number that results. Remember the code so that repeated calls do not need to spend the time for actual rerecognition.
This function is the normal interface to instruction recognition. The automatically-generated function `recog' is normally called through this one.
bool reg_fits_class_p | ( | const_rtx | operand, |
reg_class_t | cl, | ||
int | offset, | ||
enum machine_mode | mode | ||
) |
Return true iff OPERAND (assumed to be a REG rtx) is a hard reg in class CLASS when its regno is offset by OFFSET and changed to mode MODE. If REG occupies multiple hard regs, all of them must be in CLASS.
Regno must not be a pseudo register. Offset may be negative.
References peep2_current_count.
Referenced by constrain_operands().
|
inlinestatic |
Skip chars until the next ',' or the end of the string. This is useful to skip alternatives in a constraint string.
References recog_data_d::constraints, recog_data_d::is_operator, recog_data_d::operand, and recog_data_d::operand_loc.
Referenced by constrain_operands_cached().
int strict_memory_address_addr_space_p | ( | enum machine_mode | mode, |
rtx | addr, | ||
addr_space_t | as | ||
) |
Return 1 if ADDR is a valid memory address for mode MODE in address space AS, and check that each pseudo reg has the proper kind of hard reg.
References operands_match_p(), and XVECEXP.
Referenced by subreg_lowpart_offset().
Same as above, but do not simplify rtx afterwards.
int verify_changes | ( | int | ) |
struct insn_data_d insn_data[] |
Referenced by block_move_libcall_safe_for_call_parm(), can_atomic_exchange_p(), clear_storage_hints(), default_different_addr_displacement_p(), default_secondary_reload(), emit_libcall_block_1(), expand_abs_nojump(), expand_atomic_fetch_op(), expand_binop_directly(), expand_builtin_bzero(), expand_builtin_memset_args(), init_op_alt_data(), shift_optab_p(), supportable_widening_operation(), and vect_build_slp_tree_1().
int peep2_current_count |
Referenced by reg_fits_class_p().
struct recog_data_d recog_data |
struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES] |
Contains a vector of operand_alternative structures for every operand. Set up by preprocess_constraints.
Referenced by build_def_use(), copyprop_hardreg_forward_1(), extract_constrain_insn_cached(), and extract_insn_cached().
int volatile_ok |
Nonzero means volatile operands are recognized.
Nonzero means allow operands to be volatile. This should be 0 if you are generating rtl, such as if you are calling the functions in optabs.c and expmed.c (most of the time). This should be 1 if all valid insns need to be recognized, such as in reginfo.c and final.c and reload.c.
init_recog and init_recog_no_volatile are responsible for setting this.
Referenced by block_move_libcall_safe_for_call_parm(), and init_recog_no_volatile().
int which_alternative |
Set by constrain_operands to the number of the alternative that matched.
On return from `constrain_operands', indicate which alternative was satisfied.
Referenced by check_asm_operands(), lra_update_insn_recog_data(), and offsettable_address_addr_space_p().