GCC Middle and Back End API Reference
|
#include "optabs-query.h"
#include "optabs-libfuncs.h"
#include "vec-perm-indices.h"
#include "insn-config.h"
Go to the source code of this file.
Data Structures | |
class | expand_operand |
Enumerations | |
enum | expand_operand_type { EXPAND_FIXED , EXPAND_OUTPUT , EXPAND_INPUT , EXPAND_CONVERT_TO , EXPAND_CONVERT_FROM , EXPAND_ADDRESS , EXPAND_INTEGER , EXPAND_UNDEFINED_INPUT } |
enum | optab_methods { OPTAB_DIRECT , OPTAB_LIB , OPTAB_WIDEN , OPTAB_LIB_WIDEN , OPTAB_MUST_WIDEN } |
enum | can_compare_purpose { ccp_jump , ccp_cmov , ccp_store_flag } |
enum can_compare_purpose |
enum expand_operand_type |
enum optab_methods |
Passed to expand_simple_binop and expand_binop to say which options to try to use if the requested operation can't be open-coded on the requisite mode. Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using a library call. Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try using a wider mode. OPTAB_MUST_WIDEN says try widening and don't try anything else.
Enumerator | |
---|---|
OPTAB_DIRECT | |
OPTAB_LIB | |
OPTAB_WIDEN | |
OPTAB_LIB_WIDEN | |
OPTAB_MUST_WIDEN |
|
extern |
Nonzero if a compare of mode MODE can be done straightforwardly (without splitting it into pieces).
True if we can perform a comparison of mode MODE straightforwardly. PURPOSE describes how this comparison will be used. CODE is the rtx comparison code we will be using. ??? Actually, CODE is slightly weaker than that. A target is still required to implement all of the normal bcc operations, but not required to implement all (or any) of the unordered bcc operations.
References ccp_cmov, ccp_jump, ccp_store_flag, const0_rtx, GET_MODE_WIDER_MODE(), insn_operand_matches(), optab_handler(), and PUT_MODE().
Referenced by by_pieces_mode_supported_p(), do_compare_rtx_and_jump(), do_jump_1(), emit_block_cmp_via_loop(), emit_cmp_and_jump_insns(), emit_store_flag(), emit_store_flag_force(), emit_store_flag_int(), and compare_by_pieces_d::prepare_mode().
|
extern |
Return whether the backend can emit a vector comparison (vec_cmp/vec_cmpu) for code CODE, comparing operands of mode VALUE_MODE and producing a result with MASK_MODE.
References get_vec_cmp_icode(), insn_predicate_matches_p(), and unsigned_optab_p().
Referenced by vec_cmp_icode_p().
|
extern |
Return whether the backend can emit a vec_extract instruction with a non-constant index.
References alloca_raw_REG, convert_optab_handler(), insn_data, insn_operand_matches(), LAST_VIRTUAL_REGISTER, operand_data::mode, data::operand, and VECTOR_MODE_P.
Referenced by gimple_expand_vec_set_extract_expr(), and vectorizable_live_operation().
|
extern |
Return whether the backend can emit vector set instructions for inserting element into vector at variable index position.
References alloca_raw_REG, GET_MODE_INNER, insn_data, insn_operand_matches(), LAST_VIRTUAL_REGISTER, operand_data::mode, data::operand, optab_handler(), and VECTOR_MODE_P.
Referenced by gimple_expand_vec_set_extract_expr().
|
inline |
Make OP describe an input Pmode address operand. VALUE is the value of the address, but it may need to be converted to Pmode first.
References create_expand_operand(), and EXPAND_ADDRESS.
Referenced by emit_indirect_jump(), emit_stack_probe(), expand_builtin_prefetch(), expand_gather_load_optab_fn(), expand_scatter_store_optab_fn(), expand_strided_load_optab_fn(), expand_strided_store_optab_fn(), and maybe_emit_call_builtin___clear_cache().
|
inline |
Make OP describe an input operand that should have the same value as VALUE, after any mode conversion that the backend might request. If VALUE is a CONST_INT, it should be treated as having mode MODE. UNSIGNED_P says whether VALUE is unsigned. The conversion of VALUE can include a combination of numerical conversion (as for convert_modes) and duplicating a scalar to fill a vector (if VALUE is a scalar but the operand is a vector).
References create_expand_operand(), and EXPAND_CONVERT_FROM.
Referenced by add_mask_else_and_len_args(), create_convert_operand_from_type(), expand_cmpstrn_or_cmpmem(), expand_expr_real_2(), expand_fn_using_insn(), expand_ternary_op(), expand_twoval_binop(), expand_twoval_unop(), expand_unop_direct(), expand_vec_set_optab_fn(), expand_widen_pattern_expr(), and set_storage_via_setmem().
|
extern |
Make OP describe an input operand that should have the same value as VALUE, after any mode conversion that the target might request. TYPE is the type of VALUE.
References create_convert_operand_from(), TYPE_MODE, and TYPE_UNSIGNED.
Referenced by expand_vec_perm_const(), and try_casesi().
|
inline |
Like create_input_operand, except that VALUE must first be converted to mode MODE. UNSIGNED_P says whether VALUE is unsigned.
References create_expand_operand(), and EXPAND_CONVERT_TO.
Referenced by allocate_dynamic_stack_space(), emit_block_move_via_pattern(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_op_fetch_cmp_0(), maybe_emit_op(), set_storage_via_setmem(), and store_integral_bit_field().
|
inline |
Initialize OP with the given fields. Initialise the other fields to their default values.
References expand_operand::int_value, expand_operand::mode, expand_operand::target, expand_operand::type, type(), expand_operand::unsigned_p, expand_operand::unused, and expand_operand::value.
Referenced by create_address_operand(), create_convert_operand_from(), create_convert_operand_to(), create_fixed_operand(), create_input_operand(), create_integer_operand(), create_output_operand(), and create_undefined_input_operand().
|
inline |
Make OP describe an operand that must use rtx X, even if X is volatile.
References create_expand_operand(), and EXPAND_FIXED.
Referenced by allocate_dynamic_stack_space(), emit_block_move_via_pattern(), emit_conditional_add(), emit_conditional_move_1(), emit_conditional_neg_or_complement(), emit_cstore(), emit_storent_insn(), expand_addsub_overflow(), expand_assignment(), expand_atomic_compare_and_swap(), expand_atomic_load(), expand_atomic_store(), expand_builtin_strlen(), expand_cmpstr(), expand_cmpstrn_or_cmpmem(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_op_fetch_cmp_0(), expand_load_lanes_optab_fn(), expand_misaligned_mem_ref(), expand_movstr(), expand_mul_overflow(), expand_neg_overflow(), expand_partial_load_optab_fn(), expand_partial_store_optab_fn(), expand_RAWMEMCHR(), expand_store_lanes_optab_fn(), expand_twoval_binop(), expand_twoval_unop(), expand_vec_cmp_expr(), expand_vec_perm_1(), expand_vec_set_optab_fn(), extract_bit_field_using_extv(), maybe_emit_atomic_exchange(), maybe_emit_atomic_test_and_set(), maybe_emit_op(), maybe_emit_sync_lock_test_and_set(), set_storage_via_setmem(), store_bit_field_1(), store_bit_field_using_insv(), store_integral_bit_field(), and try_casesi().
|
inline |
Make OP describe an input operand that must have mode MODE and value VALUE; MODE cannot be VOIDmode. The backend may request that VALUE be copied into a different kind of rtx before being passed as an operand.
References create_expand_operand(), and EXPAND_INPUT.
Referenced by add_mask_else_and_len_args(), builtin_memset_gen_str(), emit_conditional_add(), emit_conditional_move_1(), emit_conditional_neg_or_complement(), emit_storent_insn(), expand_addsub_overflow(), expand_assignment(), expand_atomic_compare_and_swap(), expand_atomic_store(), expand_binop_directly(), expand_builtin_set_thread_pointer(), expand_crc_optab_fn(), expand_expr_real_2(), expand_fn_using_insn(), expand_gather_load_optab_fn(), expand_GOMP_SIMT_ENTER_ALLOC(), expand_GOMP_SIMT_EXIT(), expand_GOMP_SIMT_LAST_LANE(), expand_GOMP_SIMT_ORDERED_PRED(), expand_GOMP_SIMT_VOTE_ANY(), expand_GOMP_SIMT_XCHG_BFLY(), expand_GOMP_SIMT_XCHG_IDX(), expand_mul_overflow(), expand_mult_highpart(), expand_neg_overflow(), expand_partial_store_optab_fn(), expand_RAWMEMCHR(), expand_scatter_store_optab_fn(), expand_SPACESHIP(), expand_store_lanes_optab_fn(), expand_strided_store_optab_fn(), expand_UADDC(), expand_vec_cond_mask_optab_fn(), expand_vec_perm_1(), expand_vec_perm_const(), expand_vec_series_expr(), expand_vec_set_optab_fn(), expand_vector_broadcast(), expand_while_optab_fn(), extract_bit_field_1(), maybe_emit_atomic_exchange(), maybe_emit_sync_lock_test_and_set(), maybe_emit_unop_insn(), probe_stack_range(), store_bit_field_1(), store_bit_field_using_insv(), store_constructor(), try_casesi(), and vector_compare_rtx().
|
extern |
Make OP describe an input operand that has value INTVAL and that has no inherent mode. This function should only be used for operands that are always expand-time constants. The backend may request that INTVAL be copied into a different kind of rtx, but it must specify the mode of that rtx if so.
References create_expand_operand(), EXPAND_INTEGER, and gen_int_mode().
Referenced by emit_block_move_via_pattern(), expand_atomic_compare_and_swap(), expand_atomic_load(), expand_atomic_store(), expand_builtin_prefetch(), expand_builtin_strlen(), expand_cmpstr(), expand_cmpstrn_or_cmpmem(), expand_gather_load_optab_fn(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_op_fetch_cmp_0(), expand_scatter_store_optab_fn(), expand_while_optab_fn(), extract_bit_field_1(), extract_bit_field_using_extv(), maybe_emit_atomic_exchange(), maybe_emit_atomic_test_and_set(), maybe_emit_op(), set_storage_via_setmem(), store_bit_field_1(), and store_bit_field_using_insv().
|
inline |
Make OP describe an output operand that must have mode MODE. X, if nonnull, is a suggestion for where the output should be stored. It is OK for VALUE to be inconsistent with MODE, although it will just be ignored in that case.
References create_expand_operand(), and EXPAND_OUTPUT.
Referenced by builtin_memset_gen_str(), create_call_lhs_operand(), emit_conditional_add(), emit_conditional_move_1(), emit_conditional_neg_or_complement(), emit_cstore(), expand_addsub_overflow(), expand_atomic_compare_and_swap(), expand_atomic_load(), expand_binop_directly(), expand_builtin_interclass_mathfn(), expand_builtin_strlen(), expand_builtin_thread_pointer(), expand_cmpstr(), expand_cmpstrn_or_cmpmem(), expand_expr_real_2(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_op_fetch_cmp_0(), expand_misaligned_mem_ref(), expand_movstr(), expand_mul_overflow(), expand_mult_highpart(), expand_neg_overflow(), expand_strided_load_optab_fn(), expand_ternary_op(), expand_UADDC(), expand_unop_direct(), expand_vec_cmp_expr(), expand_vec_perm_1(), expand_vec_perm_const(), expand_vec_series_expr(), expand_vector_broadcast(), expand_widen_pattern_expr(), extract_bit_field_1(), extract_bit_field_using_extv(), maybe_emit_atomic_exchange(), maybe_emit_atomic_test_and_set(), maybe_emit_op(), maybe_emit_sync_lock_test_and_set(), maybe_emit_unop_insn(), and store_constructor().
|
inline |
Make OP describe an undefined input operand of mode MODE. MODE cannot be null.
References create_expand_operand(), and EXPAND_UNDEFINED_INPUT.
Referenced by add_mask_else_and_len_args(), and expand_fn_using_insn().
|
extern |
Emit a pair of rtl insns to compare two rtx's and to jump to a label if the comparison is true.
Overloaded version of emit_cmp_and_jump_insns in which VAL is unknown.
References emit_cmp_and_jump_insns(), NULL, and y.
|
extern |
Generate code to compare X with Y so that the condition codes are set and to jump to LABEL if the condition is true. If X is a constant and Y is not a constant, then the comparison is swapped to ensure that the comparison RTL has the canonical form. UNSIGNEDP nonzero says that X and Y are unsigned; this matters if they need to be widened. UNSIGNEDP is also used to select the proper branch condition code. If X and Y have mode BLKmode, then SIZE specifies the size of both X and Y. MODE is the mode of the inputs (in case they are const_int). COMPARISON is the rtl operator to compare with (EQ, NE, GT, etc.). It will be potentially converted into an unsigned variant based on UNSIGNEDP to select a proper jump instruction. PROB is the probability of jumping to LABEL. If the comparison is against zero then VAL contains the expression from which the non-zero RTL is derived.
References can_compare_p(), ccp_jump, CONST0_RTX, CONSTANT_P, emit_cmp_and_jump_insn_1(), force_reg(), GET_MODE, OPTAB_LIB_WIDEN, prepare_cmp_insn(), swap_commutative_operands_p(), swap_condition(), unsigned_condition(), validate_test_and_branch(), and y.
Referenced by allocate_dynamic_stack_space(), anti_adjust_stack_and_probe(), anti_adjust_stack_and_probe_stack_clash(), asan_clear_shadow(), asan_emit_stack_protection(), do_compare_rtx_and_jump(), do_tablejump(), emit_block_cmp_via_loop(), emit_block_move_via_loop(), emit_block_move_via_oriented_loop(), emit_cmp_and_jump_insns(), emit_stack_clash_protection_probe_loop_end(), emit_stack_clash_protection_probe_loop_start(), expand_builtin_atomic_compare_exchange(), expand_compare_and_swap_loop(), expand_copysign_absneg(), expand_doubleword_clz_ctz_ffs(), expand_ffs(), expand_fix(), expand_float(), inline_string_cmp(), prepare_call_address(), probe_stack_range(), sjlj_emit_function_enter(), stack_protect_epilogue(), store_expr(), try_casesi(), and try_store_by_multiple_pieces().
rtx emit_conditional_add | ( | rtx | target, |
enum rtx_code | code, | ||
rtx | op0, | ||
rtx | op1, | ||
machine_mode | cmode, | ||
rtx | op2, | ||
rtx | op3, | ||
machine_mode | mode, | ||
int | unsignedp ) |
Emit a conditional addition instruction if the machine supports one for that condition and machine mode. OP0 and OP1 are the operands that should be compared using CODE. CMODE is the mode to use should they be constants. If it is VOIDmode, they cannot both be constants. OP2 should be stored in TARGET if the comparison is false, otherwise OP2+OP3 should be stored there. MODE is the mode to use should they be constants. If it is VOIDmode, they cannot both be constants. The result is either TARGET (perhaps modified) or NULL_RTX if the operation is not supported.
References COMPARISON_P, const0_rtx, const1_rtx, constm1_rtx, convert_move(), create_fixed_operand(), create_input_operand(), create_output_operand(), delete_insns_since(), do_pending_stack_adjust(), gen_reg_rtx(), GET_CODE, get_last_insn(), GET_MODE, last, maybe_expand_insn(), expand_operand::mode, NULL_RTX, optab_handler(), OPTAB_WIDEN, prepare_cmp_insn(), simplify_gen_relational(), swap_commutative_operands_p(), swap_condition(), expand_operand::target, unsigned_condition(), expand_operand::value, and XEXP.
Referenced by noce_try_addcc().
rtx emit_conditional_move | ( | rtx | target, |
rtx | comparison, | ||
rtx | rev_comparison, | ||
rtx | op2, | ||
rtx | op3, | ||
machine_mode | mode ) |
Helper function that, in addition to COMPARISON, also tries the reversed REV_COMPARISON with swapped OP2 and OP3. As opposed to when we pass the specific constituents of a comparison, no additional insns are emitted for it. It might still be necessary to emit more than one insn for the final conditional move, though.
References emit_conditional_move_1(), expand_operand::mode, NULL_RTX, and expand_operand::target.
rtx emit_conditional_move | ( | rtx | target, |
struct rtx_comparison | comp, | ||
rtx | op2, | ||
rtx | op3, | ||
machine_mode | mode, | ||
int | unsignedp ) |
Emit a conditional move operation.
Emit a conditional move instruction if the machine supports one for that condition and machine mode. OP0 and OP1 are the operands that should be compared using CODE. CMODE is the mode to use should they be constants. If it is VOIDmode, they cannot both be constants. OP2 should be stored in TARGET if the comparison is true, otherwise OP3 should be stored there. MODE is the mode to use should they be constants. If it is VOIDmode, they cannot both be constants. The result is either TARGET (perhaps modified) or NULL_RTX if the operation is not supported.
References can_create_pseudo_p, comp, COMPARISON_P, const0_rtx, const1_rtx, CONSTANT_P, constm1_rtx, COSTS_N_INSNS, delete_insns_since(), direct_optab_handler(), do_pending_stack_adjust(), emit_conditional_move_1(), emit_move_insn(), force_reg(), gen_reg_rtx(), GET_CODE, get_last_insn(), GET_MODE, last, expand_operand::mode, NULL, NULL_RTX, OPTAB_WIDEN, optimize_insn_for_speed_p(), prepare_cmp_insn(), restore_pending_stack_adjust(), reversed_comparison_code_parts(), rtx_cost(), rtx_equal_p(), save_pending_stack_adjust(), simplify_gen_relational(), swap_commutative_operands_p(), swap_condition(), expand_operand::target, unsigned_condition(), and XEXP.
Referenced by emit_store_flag(), expand_cond_expr_using_cmove(), expand_doubleword_shift_condmove(), expand_expr_real_2(), expand_sdiv_pow2(), and noce_emit_cmove().
rtx emit_conditional_neg_or_complement | ( | rtx | target, |
rtx_code | code, | ||
machine_mode | mode, | ||
rtx | cond, | ||
rtx | op1, | ||
rtx | op2 ) |
Emit a conditional negate or bitwise complement operation.
Emit a conditional negate or bitwise complement using the negcc or notcc optabs if available. Return NULL_RTX if such operations are not available. Otherwise return the RTX holding the result. TARGET is the desired destination of the result. COMP is the comparison on which to negate. If COND is true move into TARGET the negation or bitwise complement of OP1. Otherwise move OP2 into TARGET. CODE is either NEG or NOT. MODE is the machine mode in which the operation is performed.
References convert_move(), create_fixed_operand(), create_input_operand(), create_output_operand(), delete_insns_since(), direct_optab_handler(), gcc_unreachable, gen_reg_rtx(), get_last_insn(), last, maybe_expand_insn(), expand_operand::mode, NULL_RTX, expand_operand::target, unknown_optab, and expand_operand::value.
Referenced by noce_try_inverse_constants().
|
extern |
Generate code to indirectly jump to a location given in the rtx LOC.
References create_address_operand(), emit_barrier(), expand_jump_insn(), sorry(), and targetm.
Referenced by expand_builtin_longjmp(), expand_builtin_nonlocal_goto(), expand_computed_goto(), and fix_crossing_unconditional_branches().
Emit code to make a call to a constant function or a library call.
References emit_libcall_block_1(), insns, and no_conflict_data::target.
Referenced by convert_mode_scalar(), expand_fix(), expand_fixed_convert(), expand_float(), expand_twoval_binop_libfunc(), and prepare_float_lib_cmp().
Generate an instruction whose insn-code is INSN_CODE, with two operands: an output TARGET and an input OP0. TARGET *must* be nonzero, and the output is always stored there. CODE is an rtx code such that (CODE OP0) is an rtx that describes the value that is stored into TARGET.
References gcc_assert, maybe_emit_unop_insn(), and expand_operand::target.
Referenced by compress_float_constant(), convert_mode_scalar(), convert_move(), expand_copysign_absneg(), expand_fixed_convert(), and expand_float().
References CONST0_RTX, do_compare_rtx_and_jump(), emit_label(), emit_move_insn(), expand_abs_nojump(), expand_unop(), gen_label_rtx(), gen_reg_rtx(), GET_MODE, GET_MODE_CLASS, MEM_P, MEM_VOLATILE_P, expand_operand::mode, NO_DEFER_POP, NULL, NULL_RTX, OK_DEFER_POP, REG_P, REGNO, expand_operand::target, and profile_probability::uninitialized().
Referenced by expand_builtin_fabs(), expand_divmod(), and expand_expr_real_2().
Expand the absolute value operation.
Emit code to compute the absolute value of OP0, with result to TARGET if convenient. (TARGET may be 0.) The return value says where the result actually is to be found. MODE is the mode of the operand; the mode of the result is different but can be deduced from MODE.
References delete_insns_since(), expand_absneg_bit(), expand_binop(), expand_shift(), expand_unop(), get_last_insn(), GET_MODE_CLASS, GET_MODE_INNER, GET_MODE_PRECISION(), HONOR_SIGNED_ZEROS(), is_a(), is_int_mode(), last, expand_operand::mode, NULL_RTX, optab_handler(), OPTAB_LIB_WIDEN, OPTAB_WIDEN, optimize_insn_for_speed_p(), and expand_operand::target.
Referenced by expand_abs(), and noce_try_abs().
|
extern |
Generate asm volatile("" : : : "memory") as a memory blockage, at the same time clobbering the register set specified by REGS.
References emit_insn(), gcc_assert, gen_rtx_MEM(), i, MEM_VOLATILE_P, regno_reg_rtx, rtvec_alloc(), RTVEC_ELT, TEST_HARD_REG_BIT, and UNKNOWN_LOCATION.
Referenced by gen_call_used_regs_seq().
|
extern |
This function expands the atomic compare exchange operation: *PTARGET_BOOL is an optional place to store the boolean success/failure. *PTARGET_OVAL is an optional place to store the old value from memory. Both target parameters may be NULL or const0_rtx to indicate that we do not care about that return value. Both target parameters are updated on success to the actual location of the corresponding result. MEMMODEL is the memory model variant to use. The return value of the function is true for success.
References can_atomic_load_p(), const0_rtx, convert_memory_address, copy_to_reg(), create_fixed_operand(), create_input_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), emit_library_call_value(), emit_move_insn(), emit_store_flag_force(), find_cc_set(), gen_reg_rtx(), get_last_insn(), GET_MODE, have_insn_for(), insn_data, is_mm_sync(), LCT_NORMAL, maybe_expand_insn(), MEM_P, expand_operand::mode, insn_operand_data::mode, note_stores(), NULL, NULL_RTX, insn_data_d::operand, optab_handler(), optab_libfunc(), ptr_mode, reg_overlap_mentioned_p(), expand_operand::target, expand_operand::value, and XEXP.
Referenced by expand_builtin_atomic_compare_exchange(), expand_builtin_compare_and_swap(), expand_compare_and_swap_loop(), and expand_ifn_atomic_compare_exchange().
This function expands the atomic exchange operation: atomically store VAL in MEM and return the previous value in MEM. MEMMODEL is the memory model variant to use. TARGET is an optional place to stick the return value.
References can_atomic_load_p(), GET_MODE, is_mm_sync(), maybe_emit_atomic_exchange(), maybe_emit_compare_and_swap_exchange_loop(), expand_operand::mode, NULL_RTX, and expand_operand::target.
Referenced by expand_builtin_atomic_exchange().
rtx expand_atomic_fetch_op | ( | rtx | target, |
rtx | mem, | ||
rtx | val, | ||
enum rtx_code | code, | ||
enum memmodel | model, | ||
bool | after ) |
This function expands an atomic fetch_OP or OP_fetch operation: TARGET is an option place to stick the return value. const0_rtx indicates the result is unused. atomically fetch MEM, perform the operation with VAL and return it to MEM. CODE is the operation being performed (OP) MEMMODEL is the memory model variant to use. AFTER is true to return the result of the operation (OP_fetch). AFTER is false to return the value before the operation (fetch_OP).
References can_atomic_load_p(), can_compare_and_swap_p(), const0_rtx, convert_memory_address, emit_insn(), emit_library_call_value(), emit_move_insn(), end_sequence(), expand_atomic_fetch_op_no_fallback(), expand_compare_and_swap_loop(), expand_simple_binop(), expand_simple_unop(), gen_reg_rtx(), get_atomic_op_for_code(), get_insns(), GET_MODE, is_mm_sync(), LCT_NORMAL, NULL, NULL_RTX, OPTAB_LIB_WIDEN, optab_libfunc(), ptr_mode, register_operand(), start_sequence(), and XEXP.
Referenced by expand_builtin_atomic_fetch_op(), expand_builtin_sync_operation(), expand_ifn_atomic_bit_test_and(), and expand_ifn_atomic_op_fetch_cmp_0().
This function expands the atomic load operation: return the atomically loaded value in MEM. MEMMODEL is the memory model variant to use. TARGET is an option place to stick the return value.
References BITS_PER_WORD, const0_rtx, create_fixed_operand(), create_integer_operand(), create_output_operand(), delete_insns_since(), direct_optab_handler(), emit_move_insn(), expand_mem_thread_fence(), expand_memory_blockage(), gen_reg_rtx(), get_last_insn(), GET_MODE, GET_MODE_PRECISION(), is_mm_relaxed(), is_mm_seq_cst(), last, maybe_expand_insn(), maybe_gt, expand_operand::mode, NULL_RTX, expand_operand::target, and expand_operand::value.
Referenced by expand_builtin_atomic_load().
This function expands the atomic store operation: Atomically store VAL in MEM. MEMMODEL is the memory model variant to use. USE_RELEASE is true if __sync_lock_release can be used as a fall back. function returns const0_rtx if a pattern was emitted.
References BITS_PER_WORD, can_atomic_load_p(), const0_rtx, create_fixed_operand(), create_input_operand(), create_integer_operand(), delete_insns_since(), direct_optab_handler(), emit_move_insn(), expand_mem_thread_fence(), expand_memory_blockage(), get_last_insn(), GET_MODE, GET_MODE_PRECISION(), is_mm_relaxed(), is_mm_seq_cst(), is_mm_sync(), last, maybe_emit_atomic_exchange(), maybe_emit_compare_and_swap_exchange_loop(), maybe_expand_insn(), maybe_gt, expand_operand::mode, NULL_RTX, and expand_operand::target.
Referenced by expand_builtin_atomic_clear(), expand_builtin_atomic_store(), and expand_builtin_sync_lock_release().
This function expands the atomic test_and_set operation: atomically store a boolean TRUE into MEM and return the previous value. MEMMODEL is the memory model variant to use. TARGET is an optional place to stick the return value.
References const0_rtx, const1_rtx, emit_store_flag_force(), gcc_assert, gen_int_mode(), gen_reg_rtx(), GET_MODE, maybe_emit_atomic_exchange(), maybe_emit_atomic_test_and_set(), maybe_emit_compare_and_swap_exchange_loop(), maybe_emit_sync_lock_test_and_set(), expand_operand::mode, expand_operand::target, and targetm.
Referenced by expand_builtin_atomic_test_and_set().
|
extern |
Expand a binary operation given optab and rtx operands.
Generate code to perform an operation specified by BINOPTAB on operands OP0 and OP1, with result having machine-mode MODE. UNSIGNEDP is for the case where we have to widen the operands to perform the operation. It says to use zero-extension. If TARGET is nonzero, the value is generated there, if it is convenient to do so. In all cases an rtx is returned for the locus of the value; this may or may not be TARGET.
References as_a(), avoid_expensive_constant(), BITS_PER_WORD, CLASS_HAS_WIDER_MODES_P, commutative_optab_p(), CONST0_RTX, const0_rtx, CONST_INT_P, convert_move(), convert_optab_handler(), convert_optab_p(), convert_to_mode(), copy_rtx(), delete_insns_since(), emit_clobber(), emit_insn(), emit_libcall_block_1(), emit_library_call_value(), emit_move_insn(), emit_store_flag_force(), end_sequence(), expand_binop(), expand_binop_directly(), expand_doubleword_divmod(), expand_doubleword_mod(), expand_doubleword_mult(), expand_doubleword_shift(), expand_vector_broadcast(), find_widening_optab_handler, FOR_EACH_WIDER_MODE, force_reg(), gcc_assert, gen_int_mode(), gen_int_shift_amount(), gen_lowpart, gen_reg_rtx(), get_insns(), get_last_insn(), GET_MODE, GET_MODE_2XWIDER_MODE(), GET_MODE_BITSIZE(), GET_MODE_CLASS, GET_MODE_INNER, GET_MODE_PRECISION(), GET_MODE_SIZE(), GET_MODE_WIDER_MODE(), i, insns, INTVAL, is_int_mode(), last, LCT_CONST, expand_operand::mode, negate_rtx(), NULL_RTX, operand_subword(), operand_subword_force(), OPTAB_DIRECT, optab_handler(), OPTAB_LIB, OPTAB_LIB_WIDEN, optab_libfunc(), OPTAB_MUST_WIDEN, OPTAB_WIDEN, optimize_insn_for_speed_p(), reg_overlap_mentioned_p(), REG_P, rtx_equal_p(), set_dst_reg_note(), shift_optab_p(), simplify_gen_unary(), start_sequence(), STORE_FLAG_VALUE, swap_commutative_operands_with_target(), expand_operand::target, targetm, trapv_binoptab_p(), TRULY_NOOP_TRUNCATION_MODES_P, UINTVAL, unknown_optab, valid_multiword_target_p(), expand_operand::value, widen_operand(), widened_mode(), and word_mode.
Referenced by add_mask_else_and_len_args(), adjust_stack_1(), align_dynamic_address(), allocate_dynamic_stack_space(), asan_emit_stack_protection(), calculate_table_based_CRC(), convert_mode_scalar(), do_compare_rtx_and_jump(), do_jump_by_parts_zero_rtx(), do_store_flag(), emit_block_cmp_via_loop(), emit_push_insn(), emit_store_flag(), emit_store_flag_1(), emit_store_flag_int(), expand_abs_nojump(), expand_absneg_bit(), expand_addsub_overflow(), expand_and(), expand_binop(), expand_binop_directly(), expand_builtin_issignaling(), expand_builtin_next_arg(), expand_builtin_signbit(), expand_clrsb_using_clz(), expand_copysign(), expand_copysign_absneg(), expand_copysign_bit(), expand_ctz(), expand_dec(), expand_divmod(), expand_doubleword_clz_ctz_ffs(), expand_doubleword_mult(), expand_doubleword_parity(), expand_doubleword_popcount(), expand_expr_real_2(), expand_ffs(), expand_fix(), expand_float(), expand_fn_using_insn(), expand_inc(), expand_mul_overflow(), expand_mult(), expand_mult_highpart(), expand_one_cmpl_abs_nojump(), expand_parity(), expand_sdiv_pow2(), expand_shift_1(), expand_simple_binop(), expand_single_bit_test(), expand_smod_pow2(), expand_unop(), expand_widening_mult(), expmed_mult_highpart_optab(), extract_fixed_bit_field_1(), extract_split_bit_field(), find_shift_sequence(), gen_common_operation_to_reflect(), compare_by_pieces_d::generate(), get_dynamic_stack_base(), noce_emit_move_insn(), noce_try_sign_mask(), optimize_bitfield_assignment_op(), probe_stack_range(), push_block(), round_push(), sign_expand_binop(), simplify_expand_binop(), store_constructor(), store_expr(), store_fixed_bit_field_1(), and widen_leading().
Expand the copysign operation.
Expand the C99 copysign operation. OP0 and OP1 must be the same scalar floating point mode. Return NULL if we do not know how to expand the operation inline.
References as_a(), CONST_DOUBLE_AS_FLOAT_P, CONST_DOUBLE_REAL_VALUE, expand_binop(), expand_copysign_absneg(), expand_copysign_bit(), gcc_assert, GET_MODE, real_format::has_signed_zero, expand_operand::mode, NULL, NULL_RTX, OPTAB_DIRECT, optab_handler(), real_isneg(), REAL_MODE_FORMAT, real_format::signbit_ro, real_format::signbit_rw, and simplify_unary_operation().
Referenced by expand_builtin_copysign().
|
extern |
Similarly to the above function, but compute both quotient and remainder. Quotient can be computed from the remainder as: rem = op0 % op1; // Handled using expand_doubleword_mod quot = (op0 - rem) * inv; // inv is multiplicative inverse of op1 modulo // 2 * BITS_PER_WORD We can also handle cases where op1 is a multiple of power of two constant and constant handled by expand_doubleword_mod. op11 = 1 << __builtin_ctz (op1); op12 = op1 / op11; rem1 = op0 % op12; // Handled using expand_doubleword_mod quot1 = (op0 - rem1) * inv; // inv is multiplicative inverse of op12 modulo // 2 * BITS_PER_WORD rem = (quot1 % op11) * op12 + rem1; quot = quot1 / op11;
References a, b, BITS_PER_WORD, CALL_P, const1_rtx, ctz_hwi(), expand_divmod(), expand_doubleword_mod(), expand_simple_binop(), wide_int_storage::from(), GEN_INT, get_insns(), get_last_insn(), HOST_WIDE_INT_1, immed_wide_int_const(), INTVAL, last, wi::mod_inv(), expand_operand::mode, NEXT_INSN(), NULL_RTX, OPTAB_DIRECT, pow2p_hwi(), wi::shifted_mask(), and UNSIGNED.
Referenced by expand_binop(), and expand_DIVMOD().
Generate code for a FIX_EXPR.
Generate code to convert FROM to fixed point and store in TO. FROM must be floating point.
References arm_bfloat_half_format, as_a(), can_fix_p(), const_double_from_real_value(), convert_move(), convert_optab_libfunc(), convert_to_mode(), copy_rtx(), DECIMAL_FLOAT_MODE_P, delete_insns_since(), do_pending_stack_adjust(), emit_barrier(), emit_cmp_and_jump_insns(), emit_jump_insn(), emit_label(), emit_libcall_block(), emit_library_call_value(), emit_move_insn(), end_sequence(), expand_binop(), expand_fix(), expand_unop(), FOR_EACH_MODE_FROM, gcc_assert, gen_int_mode(), gen_label_rtx(), gen_reg_rtx(), get_insns(), get_last_insn(), GET_MODE, GET_MODE_BITSIZE(), GET_MODE_PRECISION(), HOST_WIDE_INT_1, HWI_COMPUTABLE_MODE_P(), ieee_single_format, insns, is_a(), is_narrower_int_mode(), last, LCT_CONST, maybe_emit_unop_insn(), NULL_RTX, offset, optab_handler(), OPTAB_LIB_WIDEN, real_2expN(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, opt_mode< T >::require(), set_dst_reg_note(), start_sequence(), expand_operand::target, targetm, and expand_operand::value.
Referenced by expand_builtin_int_roundingfn(), expand_expr_real_2(), expand_fix(), and force_operand().
Generate code for a FIXED_CONVERT_EXPR.
Generate code to convert FROM or TO a fixed-point. If UINTP is true, either TO or FROM is an unsigned integer. If SATP is true, we need to saturate the result.
References convert_optab_handler(), convert_optab_libfunc(), emit_libcall_block(), emit_library_call_value(), emit_move_insn(), emit_unop_insn(), end_sequence(), gcc_assert, get_insns(), GET_MODE, insns, LCT_CONST, NULL_RTX, prepare_libcall_arg(), start_sequence(), and expand_operand::value.
Referenced by convert_mode_scalar(), and expand_expr_real_2().
Generate code for a FLOAT_EXPR.
Generate code to convert FROM to floating point and store in TO. FROM must be fixed point and not VOIDmode. UNSIGNEDP nonzero means regard FROM as unsigned. Normally this is done by correcting the final value if it is negative.
References can_float_p(), const0_rtx, const1_rtx, const_double_from_real_value(), convert_move(), convert_optab_libfunc(), convert_to_mode(), do_pending_stack_adjust(), emit_barrier(), emit_cmp_and_jump_insns(), emit_jump_insn(), emit_label(), emit_libcall_block(), emit_library_call_value(), emit_move_insn(), emit_unop_insn(), end_sequence(), opt_mode< T >::exists(), expand_binop(), expand_float(), expand_shift(), FOR_EACH_MODE_FROM, gcc_assert, gen_label_rtx(), gen_reg_rtx(), get_insns(), GET_MODE, GET_MODE_BITSIZE(), GET_MODE_PRECISION(), GET_MODE_UNIT_PRECISION, insns, is_a(), is_narrower_int_mode(), LCT_CONST, NULL_RTX, offset, OPTAB_LIB_WIDEN, real_2expN(), REAL_VALUE_TYPE, REG_P, REGNO, opt_mode< T >::require(), significand_size(), start_sequence(), expand_operand::target, targetm, and expand_operand::value.
Referenced by expand_expr_real_2(), expand_float(), and force_operand().
|
extern |
Emit instruction ICODE, using operands [OPS, OPS + NOPS) as its operands.
References gcc_unreachable, and maybe_expand_insn().
Referenced by allocate_dynamic_stack_space(), builtin_memset_gen_str(), emit_stack_probe(), expand_assignment(), expand_builtin_set_thread_pointer(), expand_builtin_thread_pointer(), expand_crc_optab_fn(), expand_expr_real_2(), expand_fn_using_insn(), expand_gather_load_optab_fn(), expand_GOMP_SIMT_ENTER_ALLOC(), expand_GOMP_SIMT_EXIT(), expand_GOMP_SIMT_LAST_LANE(), expand_GOMP_SIMT_ORDERED_PRED(), expand_GOMP_SIMT_VOTE_ANY(), expand_GOMP_SIMT_XCHG_BFLY(), expand_GOMP_SIMT_XCHG_IDX(), expand_load_lanes_optab_fn(), expand_misaligned_mem_ref(), expand_mult_highpart(), expand_partial_load_optab_fn(), expand_partial_store_optab_fn(), expand_RAWMEMCHR(), expand_scatter_store_optab_fn(), expand_SPACESHIP(), expand_store_lanes_optab_fn(), expand_strided_load_optab_fn(), expand_strided_store_optab_fn(), expand_ternary_op(), expand_UADDC(), expand_vec_cmp_expr(), expand_vec_cond_mask_optab_fn(), expand_vec_series_expr(), expand_vector_broadcast(), expand_while_optab_fn(), expand_widen_pattern_expr(), and store_constructor().
|
extern |
Like expand_insn, but for jumps.
References gcc_unreachable, and maybe_expand_jump_insn().
Referenced by emit_indirect_jump(), and try_casesi().
|
extern |
Emit a signal fence with given memory model.
References expand_memory_blockage(), and is_mm_relaxed().
Referenced by expand_builtin_atomic_signal_fence().
|
extern |
Generate memory barriers.
This routine will either emit the mem_thread_fence pattern or issue a sync_synchronize to generate a fence for memory model MEMMODEL.
References emit_insn(), emit_library_call(), expand_memory_blockage(), GEN_INT, is_mm_relaxed(), LCT_NORMAL, NULL_RTX, synchronize_libfunc, and targetm.
Referenced by expand_atomic_load(), expand_atomic_store(), expand_builtin_atomic_thread_fence(), expand_builtin_sync_synchronize(), and maybe_emit_sync_lock_test_and_set().
Generate code for MULT_HIGHPART_EXPR.
Expand a highpart multiply.
References as_a(), can_mult_highpart_p(), create_input_operand(), create_output_operand(), expand_binop(), expand_insn(), expand_vec_perm_const(), expmed_mult_highpart_optab(), gcc_checking_assert, gcc_unreachable, gen_lowpart, gen_reg_rtx(), GET_MODE_NUNITS(), GET_MODE_SIZE(), i, insn_data, INT_MAX, known_eq, expand_operand::mode, insn_operand_data::mode, int_vector_builder< T >::new_vector(), NULL_RTX, insn_data_d::operand, optab_handler(), OPTAB_LIB_WIDEN, expand_operand::target, and expand_operand::value.
Referenced by expand_expr_real_2().
Expand the one's complement absolute value operation.
Emit code to compute the one's complement absolute value of OP0 (if (OP0 < 0) OP0 = ~OP0), with result to TARGET if convenient. (TARGET may be NULL_RTX.) The return value says where the result actually is to be found. MODE is the mode of the operand; the mode of the result is different but can be deduced from MODE.
References delete_insns_since(), expand_binop(), expand_shift(), expand_unop(), FLOAT_MODE_P, get_last_insn(), GET_MODE_PRECISION(), is_int_mode(), last, expand_operand::mode, NULL_RTX, optab_handler(), OPTAB_LIB_WIDEN, OPTAB_WIDEN, optimize_insn_for_speed_p(), and expand_operand::target.
Referenced by noce_try_abs().
Generate code for float to integral conversion.
Generate code to convert FROM to fixed point and store in TO. FROM must be floating point, TO must be signed. Use the conversion optab TAB to do the conversion.
References convert_move(), convert_optab_handler(), convert_to_mode(), delete_insns_since(), FOR_EACH_MODE_FROM, gen_reg_rtx(), get_last_insn(), GET_MODE, insn_optimization_type(), last, maybe_emit_unop_insn(), and expand_operand::target.
Referenced by expand_builtin_int_roundingfn(), and expand_builtin_int_roundingfn_2().
|
extern |
Generate code for a simple binary or unary operation. "Simple" in this case means "can be unambiguously described by a (mode, code) pair and mapped to a single optab."
Wrapper around expand_binop which takes an rtx code to specify the operation to perform, not an optab pointer. All other arguments are the same.
References expand_binop(), gcc_assert, expand_operand::mode, and expand_operand::target.
Referenced by asan_clear_shadow(), asan_emit_stack_protection(), default_memtag_extract_tag(), default_memtag_set_tag(), default_memtag_untagged_pointer(), emit_block_cmp_via_loop(), emit_block_move_via_loop(), emit_move_resolve_push(), expand_arith_overflow_result_store(), expand_asan_emit_allocas_unpoison(), expand_atomic_fetch_op(), expand_atomic_fetch_op_no_fallback(), expand_builtin_apply(), expand_builtin_atomic_fetch_op(), expand_doubleword_divmod(), expand_doubleword_mod(), expand_expr_addr_expr_1(), expand_HWASAN_ALLOCA_UNPOISON(), expand_HWASAN_CHOOSE_TAG(), expand_ifn_atomic_bit_test_and(), expand_mul_overflow(), expand_POPCOUNT(), expand_ubsan_result_store(), expand_vec_perm_var(), force_operand(), hwasan_emit_untag_frame(), hwasan_truncate_to_tag_size(), inline_string_cmp(), instantiate_virtual_regs_in_insn(), noce_try_addcc(), noce_try_cmove(), noce_try_cond_zero_arith(), noce_try_minmax(), noce_try_store_flag_constants(), noce_try_store_flag_mask(), round_trampoline_addr(), and unroll_loop_runtime_iterations().
|
extern |
Wrapper around expand_unop which takes an rtx code to specify the operation to perform, not an optab pointer. All other arguments are the same.
References expand_unop(), gcc_assert, expand_operand::mode, and expand_operand::target.
Referenced by expand_atomic_fetch_op(), expand_atomic_fetch_op_no_fallback(), expand_builtin_atomic_fetch_op(), expand_ifn_atomic_bit_test_and(), force_operand(), and noce_try_abs().
This function expands the legacy _sync_lock test_and_set operation which is generally an atomic exchange. Some limited targets only allow the constant 1 to be stored. This is an ACQUIRE operation. TARGET is an optional place to stick the return value. MEM is where VAL is stored.
References const1_rtx, maybe_emit_atomic_exchange(), maybe_emit_atomic_test_and_set(), maybe_emit_compare_and_swap_exchange_loop(), maybe_emit_sync_lock_test_and_set(), MEMMODEL_SYNC_ACQUIRE, and expand_operand::target.
Referenced by expand_builtin_sync_lock_test_and_set().
|
extern |
Generate code to perform an operation specified by TERNARY_OPTAB on operands OP0, OP1 and OP2, with result having machine-mode MODE. UNSIGNEDP is for the case where we have to widen the operands to perform the operation. It says to use zero-extension. If TARGET is nonzero, the value is generated there, if it is convenient to do so. In all cases an rtx is returned for the locus of the value; this may or may not be TARGET.
References create_convert_operand_from(), create_output_operand(), expand_insn(), gcc_assert, expand_operand::mode, optab_handler(), expand_operand::target, and expand_operand::value.
Referenced by expand_builtin_mathfn_ternary(), and expand_expr_real_2().
|
extern |
Generate code to perform an operation on two operands with two results.
Generate code to perform an operation specified by BINOPTAB on operands OP0 and OP1, with two results to TARG1 and TARG2. We assume that the order of the operands for the instruction is TARG0, OP0, OP1, TARG1, which would fit a pattern like [(set TARG0 (operate OP0 OP1)) (set TARG1 (operate ...))]. Either TARG0 or TARG1 may be zero, but what that means is that the result is not actually wanted. We will generate it into a dummy pseudo-reg and discard it. They may not both be zero. Returns true if this operation can be performed; false if not.
References avoid_expensive_constant(), CLASS_HAS_WIDER_MODES_P, convert_modes(), convert_move(), create_convert_operand_from(), create_fixed_operand(), delete_insns_since(), expand_twoval_binop(), FOR_EACH_WIDER_MODE, gen_reg_rtx(), get_last_insn(), GET_MODE, GET_MODE_CLASS, insn_data, last, maybe_expand_insn(), expand_operand::mode, insn_operand_data::mode, insn_data_d::operand, and optab_handler().
Referenced by expand_DIVMOD(), expand_divmod(), and expand_twoval_binop().
|
extern |
Generate code to perform an operation on two operands with two results, using a library function.
Expand the two-valued library call indicated by BINOPTAB, but preserve only one of the values. If TARG0 is non-NULL, the first value is placed into TARG0; otherwise the second value is placed into TARG1. Exactly one of TARG0 and TARG1 must be non-NULL. The value stored into TARG0 or TARG1 is equivalent to (CODE OP0 OP1). This routine assumes that the value returned by the library call is as if the return value was of an integral mode twice as wide as the mode of OP0. Returns 1 if the call was successful.
References emit_libcall_block(), emit_library_call_value(), end_sequence(), gcc_assert, get_insns(), GET_MODE, GET_MODE_BITSIZE(), GET_MODE_SIZE(), insns, LCT_CONST, expand_operand::mode, NULL_RTX, optab_libfunc(), simplify_gen_subreg(), smallest_int_mode_for_size(), and start_sequence().
Referenced by expand_divmod().
Generate code to perform an operation on one operand with two results.
Generate code to perform an operation specified by UNOPPTAB on operand OP0, with two results to TARG0 and TARG1. We assume that the order of the operands for the instruction is TARG0, TARG1, OP0. Either TARG0 or TARG1 may be zero, but what that means is that the result is not actually wanted. We will generate it into a dummy pseudo-reg and discard it. They may not both be zero. Returns true if this operation can be performed; false if not.
References CLASS_HAS_WIDER_MODES_P, convert_modes(), convert_move(), create_convert_operand_from(), create_fixed_operand(), delete_insns_since(), expand_twoval_unop(), FOR_EACH_WIDER_MODE, gen_reg_rtx(), get_last_insn(), GET_MODE, GET_MODE_CLASS, last, maybe_expand_insn(), expand_operand::mode, and optab_handler().
Referenced by expand_builtin_cexpi(), expand_builtin_mathfn_3(), expand_builtin_sincos(), and expand_twoval_unop().
Expand a unary arithmetic operation given optab rtx operand.
Generate code to perform an operation specified by UNOPTAB on operand OP0, with result having machine-mode MODE. UNSIGNEDP is for the case where we have to widen the operands to perform the operation. It says to use zero-extension. If TARGET is nonzero, the value is generated there, if it is convenient to do so. In all cases an rtx is returned for the locus of the value; this may or may not be TARGET.
References as_a(), BITS_PER_WORD, CLASS_HAS_WIDER_MODES_P, CONST0_RTX, CONSTM1_RTX, convert_move(), delete_insns_since(), emit_insn(), emit_libcall_block_1(), emit_library_call_value(), emit_move_insn(), end_sequence(), expand_absneg_bit(), expand_binop(), expand_clrsb_using_clz(), expand_ctz(), expand_doubleword_bswap(), expand_doubleword_clz_ctz_ffs(), expand_doubleword_parity(), expand_doubleword_popcount(), expand_ffs(), expand_parity(), expand_shift(), expand_unop(), expand_unop_direct(), FOR_EACH_WIDER_MODE, gcc_assert, gen_int_mode(), gen_int_shift_amount(), gen_lowpart, gen_reg_rtx(), get_insns(), get_last_insn(), GET_MODE, GET_MODE_BITSIZE(), GET_MODE_CLASS, GET_MODE_INNER, GET_MODE_PRECISION(), GET_MODE_SIZE(), GET_MODE_UNIT_SIZE, hard_libcall_value(), HONOR_SIGNED_ZEROS(), i, insns, integer_type_node, is_a(), is_int_mode(), last, LCT_CONST, expand_operand::mode, NULL_RTX, operand_subword(), operand_subword_force(), OPTAB_DIRECT, optab_handler(), OPTAB_LIB_WIDEN, optab_libfunc(), OPTAB_WIDEN, optimize_insn_for_speed_p(), reg_overlap_mentioned_p(), SCALAR_INT_MODE_P, simplify_gen_unary(), start_sequence(), expand_operand::target, trapv_unoptab_p(), TRULY_NOOP_TRUNCATION_MODES_P, TYPE_MODE, valid_multiword_target_p(), expand_operand::value, widen_bswap(), widen_leading(), widen_operand(), and word_mode.
Referenced by emit_cstore(), emit_store_flag_1(), emit_store_flag_int(), expand_abs(), expand_abs_nojump(), expand_addsub_overflow(), expand_builtin_bswap(), expand_builtin_issignaling(), expand_builtin_mathfn_3(), expand_builtin_unop(), expand_copysign_absneg(), expand_divmod(), expand_doubleword_bswap(), expand_doubleword_parity(), expand_expr_real_2(), expand_fix(), expand_mul_overflow(), expand_mult(), expand_mult_const(), expand_neg_overflow(), expand_one_cmpl_abs_nojump(), expand_parity(), expand_shift_1(), expand_simple_unop(), expand_subword_shift(), expand_unop(), expand_unop_direct(), flip_storage_order(), negate_rtx(), noce_emit_move_insn(), widen_bswap(), and widen_leading().
Generate code for vector comparison.
Generate insns for a vector comparison into a mask.
References create_fixed_operand(), create_output_operand(), exp(), expand_insn(), get_vec_cmp_eq_icode(), get_vec_cmp_icode(), expand_operand::target, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_MODE, TYPE_UNSIGNED, expand_operand::value, vector_compare_rtx(), and XEXP.
Referenced by do_store_flag().
|
extern |
Implement a permutation of vectors v0 and v1 using the permutation vector in SEL and return the result. Use TARGET to hold the result if nonnull and convenient. MODE is the mode of the vectors being permuted (V0 and V1). SEL_MODE is the TYPE_MODE associated with SEL, or BLKmode if SEL isn't known to have a particular mode.
References CONST0_RTX, const0_rtx, create_convert_operand_from_type(), create_input_operand(), create_output_operand(), delete_insns_since(), direct_optab_handler(), expand_vec_perm_1(), force_reg(), gcc_checking_assert, gen_lowpart, gen_reg_rtx(), get_last_insn(), GET_MODE, GET_MODE_NUNITS(), GET_MODE_UNIT_SIZE, last, maybe_expand_insn(), expand_operand::mode, vec_perm_indices::new_expanded_vector(), NULL, NULL_RTX, optab_handler(), qimode_for_vec_perm(), register_operand(), related_int_vector_mode(), rtx_equal_p(), selector_fits_mode_p(), shift_amt_for_vec_perm_mask(), sizetype, expand_operand::target, targetm, unknown_optab, expand_operand::value, and vec_perm_indices_to_rtx().
Referenced by expand_expr_real_2(), expand_mult_highpart(), expand_rotate_as_vec_perm(), and expand_vec_perm_var().
Generate code for VEC_PERM_EXPR.
Implement a permutation of vectors v0 and v1 using the permutation vector in SEL and return the result. Use TARGET to hold the result if nonnull and convenient. MODE is the mode of the vectors being permuted (V0 and V1). SEL must have the integer equivalent of MODE and is known to be unsuitable for permutes with a constant permutation vector.
References rtx_vector_builder::build(), direct_optab_handler(), exact_log2(), expand_simple_binop(), expand_vec_perm_1(), expand_vec_perm_const(), gcc_assert, GEN_INT, gen_int_shift_amount(), gen_lowpart, gen_reg_rtx(), GET_MODE, GET_MODE_MASK, GET_MODE_NUNITS(), GET_MODE_SIZE(), GET_MODE_UNIT_SIZE, i, maybe_gt, expand_operand::mode, NULL, NULL_RTX, OPTAB_DIRECT, qimode_for_vec_perm(), and expand_operand::target.
Referenced by expand_expr_real_2().
Generate code for VEC_SERIES_EXPR.
Generate VEC_SERIES_EXPR <OP0, OP1>, returning a value of mode VMODE. Use TARGET for the result if nonnull and convenient.
References create_input_operand(), create_output_operand(), direct_optab_handler(), expand_insn(), gcc_assert, GET_MODE_INNER, expand_operand::target, and expand_operand::value.
Referenced by expand_expr_real_2().
Create a new vector value in VMODE with all elements set to OP. The mode of OP must be the element mode of VMODE. If OP is a constant, then the return value will be a constant.
References convert_optab_handler(), create_input_operand(), create_output_operand(), emit_insn(), expand_insn(), gcc_checking_assert, gen_const_vec_duplicate(), gen_reg_rtx(), GET_MODE, GET_MODE_INNER, GET_MODE_NUNITS(), i, NULL, NULL_RTX, optab_handler(), rtvec_alloc(), RTVEC_ELT, valid_for_const_vector_p(), expand_operand::value, and VECTOR_MODE_P.
Referenced by expand_binop(), expand_expr_real_2(), and maybe_legitimize_operand().
|
extern |
Definitions for code generation pass of GNU compiler. Copyright (C) 2001-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/>.
Generate code for a widening multiply.
Perform a widening multiplication and return an rtx for the result. MODE is mode of value; OP0 and OP1 are what to multiply (rtx's); TARGET is a suggestion for where to store the result (an rtx). THIS_OPTAB is the optab we should use, it must be either umul_widen_optab or smul_widen_optab. We check specially for a constant integer as OP1, comparing the cost of a widening multiply against the cost of a sequence of shifts and adds.
References choose_mult_variant(), CONST0_RTX, CONST_INT_P, convert_modes(), convert_to_mode(), EXACT_POWER_OF_2_OR_ZERO_P, expand_binop(), expand_mult_const(), expand_shift(), floor_log2(), GET_MODE, HWI_COMPUTABLE_MODE_P(), INTVAL, mul_widen_cost(), OPTAB_LIB_WIDEN, and optimize_insn_for_speed_p().
Referenced by expand_expr_real_2().
|
extern |
Like simplify_expand_binop, but always put the result in TARGET. Return true if the expansion succeeded.
References emit_move_insn(), expand_operand::mode, simplify_expand_binop(), and expand_operand::target.
Referenced by expand_doubleword_shift(), expand_sjlj_dispatch_table(), expand_subword_shift(), expand_superword_shift(), and shift_return_value().
Create but don't emit one rtl instruction to perform certain operations. Modes must match; operands must meet the operation's predicates. Likewise for subtraction and for just copying.
These functions attempt to generate an insn body, rather than emitting the insn, but if the gen function already emits them, we make no attempt to turn them back into naked patterns.
Generate and return an insn body to add Y to X.
References gcc_assert, GET_MODE, insn_operand_matches(), optab_handler(), and y.
Referenced by emit_add2_insn(), address_reload_context::emit_autoinc(), gen_reload(), inc_for_reload(), and pieces_addr::increment_address().
Generate and return an insn body to add r1 and c, storing the result in r0.
References GET_MODE, insn_operand_matches(), NULL, and optab_handler().
Referenced by emit_inc_dec_insn_before().
Generate and return an insn body to add Y to X.
References gcc_assert, GET_MODE, insn_operand_matches(), optab_handler(), and y.
Referenced by emit_add3_insn().
Generate a conditional trap instruction.
Generate insns to trap with code TCODE if OP1 and OP2 satisfy condition CODE. Return 0 on failure.
References do_pending_stack_adjust(), emit_insn(), end_sequence(), get_insns(), GET_MODE, insn_operand_matches(), expand_operand::mode, NULL, NULL_RTX, OPTAB_DIRECT, optab_handler(), prepare_cmp_insn(), start_sequence(), and XEXP.
Referenced by find_cond_trap().
|
extern |
Generate the body of an insn to extend Y (with mode MFROM) into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero.
References can_extend_p(), and y.
Referenced by assign_parm_setup_reg().
Generate and return an insn body to subtract Y from X.
References gcc_assert, GET_MODE, insn_operand_matches(), optab_handler(), and y.
Referenced by address_reload_context::emit_autoinc(), and inc_for_reload().
Generate and return an insn body to subtract r1 and c, storing the result in r0.
References GET_MODE, insn_operand_matches(), NULL, and optab_handler().
Return rtx code for TCODE. Use UNSIGNEDP to select signed or unsigned operation code.
References gcc_assert, and get_rtx_code_1().
Referenced by expand_ccmp_next(), get_compare_parts(), and vector_compare_rtx().
Return rtx code for TCODE or UNKNOWN. Use UNSIGNEDP to select signed or unsigned operation code.
Referenced by get_rtx_code(), and vec_cmp_icode_p().
References gcc_assert, GET_MODE, insn_operand_matches(), optab_handler(), and y.
Referenced by move2add_use_add2_insn(), and reload_cse_move2add().
Return true if the target implements an addptr pattern and X, Y, and Z are valid for the pattern predicates.
References gcc_assert, GET_MODE, insn_operand_matches(), optab_handler(), and y.
Referenced by eliminate_regs_in_insn(), and emit_add3_insn().
Report whether the machine description contains an insn which can perform the operation described by CODE and MODE.
Report whether we have an instruction to perform the operation specified by CODE on operands of mode MODE.
References expand_operand::mode, and optab_handler().
Referenced by analyze_insn_to_expand_var(), default_min_divisions_for_recip_mul(), do_compare_rtx_and_jump(), do_jump(), expand_atomic_compare_and_swap(), expand_DEFERRED_INIT(), expand_expr_real_2(), force_to_mode(), make_compound_operation_int(), make_extraction(), move2add_use_add2_insn(), simplify_comparison(), and simplify_context::simplify_subreg().
References gcc_assert, GET_MODE, insn_operand_matches(), optab_handler(), and y.
Return true if OPERAND is suitable for operand number OPNO of instruction ICODE.
References insn_data.
Referenced by assign_parm_setup_reg(), can_compare_p(), can_vec_extract_var_idx_p(), can_vec_set_var_idx_p(), compress_float_constant(), default_secondary_reload(), emit_cmp_and_jump_insn_1(), expand_vec_perm_1(), find_reloads_address_1(), gen_add2_insn(), gen_add3_insn(), gen_addptr3_insn(), gen_cond_trap(), gen_reload(), gen_sub2_insn(), gen_sub3_insn(), get_supported_else_vals(), have_add2_insn(), have_addptr3_insn(), have_sub2_insn(), init_expr_target(), insn_predicate_matches_p(), internal_check_ptrs_fn_supported_p(), internal_gather_scatter_fn_supported_p(), internal_len_load_store_bias(), maybe_legitimize_operand(), maybe_legitimize_operand_same_code(), maybe_legitimize_operands(), prepare_cmp_insn(), prepare_operand(), reverse_rotate_by_imm_p(), and safe_insn_predicate().
Generate an instruction with a given INSN_CODE with an output and an input.
Generate an instruction whose insn-code is INSN_CODE, with two operands: an output TARGET and an input OP0. TARGET *must* be nonzero, and the output is always stored there. CODE is an rtx code such that (CODE OP0) is an rtx that describes the value that is stored into TARGET. Return false if expansion failed.
References add_equal_note(), create_input_operand(), create_output_operand(), emit_insn(), emit_move_insn(), GET_MODE, INSN_P, maybe_gen_insn(), NEXT_INSN(), NULL_RTX, expand_operand::target, and expand_operand::value.
Referenced by emit_unop_insn(), expand_builtin_interclass_mathfn(), expand_builtin_issignaling(), expand_builtin_signbit(), expand_fix(), and expand_sfix_optab().
|
extern |
Try to emit instruction ICODE, using operands [OPS, OPS + NOPS) as its operands. Return true on success and emit no code on failure.
References emit_insn(), and maybe_gen_insn().
Referenced by emit_block_move_via_pattern(), emit_conditional_add(), emit_conditional_move_1(), emit_conditional_neg_or_complement(), emit_cstore(), emit_storent_insn(), expand_addsub_overflow(), expand_atomic_compare_and_swap(), expand_atomic_load(), expand_atomic_store(), expand_builtin_prefetch(), expand_builtin_strlen(), expand_cmpstr(), expand_cmpstrn_or_cmpmem(), expand_ifn_atomic_bit_test_and(), expand_ifn_atomic_op_fetch_cmp_0(), expand_insn(), expand_movstr(), expand_mul_overflow(), expand_neg_overflow(), expand_twoval_binop(), expand_twoval_unop(), expand_vec_perm_1(), expand_vec_perm_const(), expand_vec_set_optab_fn(), extract_bit_field_1(), extract_bit_field_using_extv(), maybe_emit_atomic_exchange(), maybe_emit_atomic_test_and_set(), maybe_emit_call_builtin___clear_cache(), maybe_emit_op(), maybe_emit_sync_lock_test_and_set(), probe_stack_range(), set_storage_via_setmem(), store_bit_field_1(), store_bit_field_using_insv(), and store_integral_bit_field().
|
extern |
Like maybe_expand_insn, but for jumps.
References emit_jump_insn(), and maybe_gen_insn().
Referenced by expand_jump_insn().
|
extern |
Try to generate instruction ICODE, using operands [OPS, OPS + NOPS) as its operands. Return the instruction pattern on success, and emit any necessary set-up code. Return null and emit no code on failure.
References gcc_assert, gcc_unreachable, insn_data, maybe_legitimize_operands(), NULL, and expand_operand::value.
Referenced by expand_binop_directly(), expand_unop_direct(), maybe_emit_unop_insn(), maybe_expand_insn(), and maybe_expand_jump_insn().
|
extern |
Try to make operands [OPS, OPS + NOPS) match operands [OPNO, OPNO + NOPS) of instruction ICODE. Return true on success, leaving the new operand values in the OPS themselves. Emit no code on failure.
References can_reuse_operands_p(), copy_rtx(), delete_insns_since(), get_last_insn(), i, insn_operand_matches(), last, maybe_legitimize_operand(), rtx_equal_p(), and expand_operand::value.
Referenced by emit_stack_probe(), expand_builtin_interclass_mathfn(), maybe_gen_insn(), and vector_compare_rtx().
|
extern |
Before emitting an insn with code ICODE, make sure that X, which is going to be used for operand OPNUM of the insn, is converted from mode MODE to WIDER_MODE (UNSIGNEDP determines whether it is an unsigned conversion), and that it is accepted by the operand predicate. Return the new value.
References convert_modes(), copy_to_mode_reg(), GET_MODE, insn_data, insn_operand_matches(), NULL_RTX, and reload_completed.
Referenced by emit_cstore(), and prepare_cmp_insn().
|
extern |
Expand a binary operation with both signed and unsigned forms.
Expand a binary operator which has both signed and unsigned forms. UOPTAB is the optab for unsigned operations, and SOPTAB is for signed operations. If we widen unsigned operands, we may use a signed wider operation instead of an unsigned wider operation, since the result would be the same.
References expand_binop(), expand_operand::mode, OPTAB_DIRECT, OPTAB_LIB, OPTAB_WIDEN, and expand_operand::target.
Referenced by expand_divmod().
|
extern |
Like expand_binop, but return a constant rtx if the result can be calculated at compile time. The arguments and return value are otherwise the same as for expand_binop.
References CONSTANT_P, expand_binop(), expand_operand::mode, simplify_binary_operation(), and expand_operand::target.
Referenced by expand_doubleword_shift(), expand_subword_shift(), and force_expand_binop().
TARGET is a target of a multiword operation that we are going to implement as a series of word-mode operations. Return true if TARGET is suitable for this purpose.
References GET_MODE, GET_MODE_SIZE(), i, validate_subreg(), and word_mode.
Referenced by expand_absneg_bit(), expand_binop(), expand_copysign_bit(), expand_doubleword_bswap(), expand_unop(), and extract_integral_bit_field().
|
extern |
Return a comparison rtx of mode CMP_MODE for COND. Use UNSIGNEDP to select signed or unsigned operators. OPNO holds the index of the first comparison operand for insn ICODE. Do not generate the compare instruction itself.
References create_input_operand(), expand_expr(), EXPAND_STACK_PARM, gcc_assert, gcc_unreachable, GET_MODE, get_rtx_code(), maybe_legitimize_operands(), NULL_RTX, tcc_comparison, TREE_CODE_CLASS, TREE_TYPE, TYPE_MODE, and expand_operand::value.
Referenced by expand_vec_cmp_expr().