GCC Middle and Back End API Reference
|
Data Structures | |
struct | no_conflict_data |
struct | atomic_op_functions |
Enumerations | |
enum | extraction_type { ET_unaligned_mem, ET_reg } |
Functions | |
static void | prepare_float_lib_cmp (rtx, rtx, enum rtx_code, rtx *, enum machine_mode *) |
static rtx | expand_unop_direct (enum machine_mode, optab, rtx, rtx, int) |
static void | emit_libcall_block_1 (rtx, rtx, rtx, rtx, bool) |
void | debug_optab_libfuncs (void) |
static hashval_t | hash_libfunc () |
static int | eq_libfunc () |
rtx | convert_optab_libfunc (convert_optab optab, enum machine_mode mode1, enum machine_mode mode2) |
rtx | optab_libfunc () |
static int | add_equal_note () |
static enum machine_mode | widened_mode () |
enum insn_code | find_widening_optab_handler_and_mode (optab op, enum machine_mode to_mode, enum machine_mode from_mode, int permit_non_widening, enum machine_mode *found_mode) |
static rtx | widen_operand (rtx op, enum machine_mode mode, enum machine_mode oldmode, int unsignedp, int no_extend) |
optab | optab_for_tree_code (enum tree_code code, const_tree type, enum optab_subtype subtype) |
rtx | expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op, rtx target, int unsignedp) |
rtx | expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0, rtx op1, rtx op2, rtx target, int unsignedp) |
rtx | simplify_expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, rtx target, int unsignedp, enum optab_methods methods) |
bool | force_expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, rtx target, int unsignedp, enum optab_methods methods) |
rtx | expand_vec_shift_expr () |
static rtx | expand_vector_broadcast () |
static bool | expand_superword_shift (optab binoptab, rtx outof_input, rtx superword_op1, rtx outof_target, rtx into_target, int unsignedp, enum optab_methods methods) |
static bool | expand_subword_shift (enum machine_mode op1_mode, optab binoptab, rtx outof_input, rtx into_input, rtx op1, rtx outof_target, rtx into_target, int unsignedp, enum optab_methods methods, unsigned HOST_WIDE_INT shift_mask) |
static bool | expand_doubleword_shift_condmove (enum machine_mode op1_mode, optab binoptab, enum rtx_code cmp_code, rtx cmp1, rtx cmp2, rtx outof_input, rtx into_input, rtx subword_op1, rtx superword_op1, rtx outof_target, rtx into_target, int unsignedp, enum optab_methods methods, unsigned HOST_WIDE_INT shift_mask) |
static bool | expand_doubleword_shift (enum machine_mode op1_mode, optab binoptab, rtx outof_input, rtx into_input, rtx op1, rtx outof_target, rtx into_target, int unsignedp, enum optab_methods methods, unsigned HOST_WIDE_INT shift_mask) |
static rtx | expand_doubleword_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target, bool umulp, enum optab_methods methods) |
rtx | expand_simple_binop (enum machine_mode mode, enum rtx_code code, rtx op0, rtx op1, rtx target, int unsignedp, enum optab_methods methods) |
static bool | swap_commutative_operands_with_target () |
static bool | shift_optab_p () |
static bool | commutative_optab_p () |
static rtx | avoid_expensive_constant (enum machine_mode mode, optab binoptab, int opn, rtx x, bool unsignedp) |
static rtx | expand_binop_directly (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, rtx target, int unsignedp, enum optab_methods methods, rtx last) |
rtx | expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, rtx target, int unsignedp, enum optab_methods methods) |
rtx | sign_expand_binop (enum machine_mode mode, optab uoptab, optab soptab, rtx op0, rtx op1, rtx target, int unsignedp, enum optab_methods methods) |
int | expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1, int unsignedp) |
int | expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1, int unsignedp) |
bool | expand_twoval_binop_libfunc (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1, enum rtx_code code) |
rtx | expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0, rtx target, int unsignedp) |
static rtx | widen_leading () |
static rtx | expand_doubleword_clz () |
static rtx | widen_bswap () |
static rtx | expand_doubleword_bswap () |
static rtx | expand_parity () |
static rtx | expand_ctz () |
static rtx | expand_ffs () |
static rtx | lowpart_subreg_maybe_copy (enum machine_mode omode, rtx val, enum machine_mode imode) |
static rtx | expand_absneg_bit (enum rtx_code code, enum machine_mode mode, rtx op0, rtx target) |
rtx | expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, int unsignedp) |
rtx | expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target, int result_unsignedp) |
rtx | expand_abs (enum machine_mode mode, rtx op0, rtx target, int result_unsignedp, int safe) |
rtx | expand_one_cmpl_abs_nojump () |
static rtx | expand_copysign_absneg (enum machine_mode mode, rtx op0, rtx op1, rtx target, int bitpos, bool op0_is_abs) |
static rtx | expand_copysign_bit (enum machine_mode mode, rtx op0, rtx op1, rtx target, int bitpos, bool op0_is_abs) |
rtx | expand_copysign () |
bool | maybe_emit_unop_insn (enum insn_code icode, rtx target, rtx op0, enum rtx_code code) |
void | emit_unop_insn () |
static void | no_conflict_move_test () |
void | emit_libcall_block () |
int | can_compare_p (enum rtx_code code, enum machine_mode mode, enum can_compare_purpose purpose) |
static void | prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size, int unsignedp, enum optab_methods methods, rtx *ptest, enum machine_mode *pmode) |
rtx | prepare_operand (enum insn_code icode, rtx x, int opnum, enum machine_mode mode, enum machine_mode wider_mode, int unsignedp) |
static void | emit_cmp_and_jump_insn_1 () |
void | emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size, enum machine_mode mode, int unsignedp, rtx label, int prob) |
void | emit_indirect_jump () |
rtx | emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1, enum machine_mode cmode, rtx op2, rtx op3, enum machine_mode mode, int unsignedp) |
int | can_conditionally_move_p () |
rtx | emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1, enum machine_mode cmode, rtx op2, rtx op3, enum machine_mode mode, int unsignedp) |
rtx | gen_add2_insn () |
rtx | gen_add3_insn () |
int | have_add2_insn () |
rtx | gen_sub2_insn () |
rtx | gen_sub3_insn () |
int | have_sub2_insn () |
rtx | gen_move_insn () |
enum insn_code | can_extend_p (enum machine_mode to_mode, enum machine_mode from_mode, int unsignedp) |
rtx | gen_extend_insn (rtx x, rtx y, enum machine_mode mto, enum machine_mode mfrom, int unsignedp) |
static enum insn_code | can_fix_p (enum machine_mode fixmode, enum machine_mode fltmode, int unsignedp, int *truncp_ptr) |
enum insn_code | can_float_p (enum machine_mode fltmode, enum machine_mode fixmode, int unsignedp) |
bool | supportable_convert_operation (enum tree_code code, tree vectype_out, tree vectype_in, tree *decl, enum tree_code *code1) |
void | expand_float () |
void | expand_fix () |
void | expand_fixed_convert () |
bool | expand_sfix_optab () |
int | have_insn_for () |
static void | gen_libfunc (optab optable, const char *opname, int suffix, enum machine_mode mode) |
void | gen_int_libfunc (optab optable, const char *opname, char suffix, enum machine_mode mode) |
void | gen_fp_libfunc (optab optable, const char *opname, char suffix, enum machine_mode mode) |
void | gen_fixed_libfunc (optab optable, const char *opname, char suffix, enum machine_mode mode) |
void | gen_signed_fixed_libfunc (optab optable, const char *opname, char suffix, enum machine_mode mode) |
void | gen_unsigned_fixed_libfunc (optab optable, const char *opname, char suffix, enum machine_mode mode) |
void | gen_int_fp_libfunc (optab optable, const char *name, char suffix, enum machine_mode mode) |
void | gen_intv_fp_libfunc (optab optable, const char *name, char suffix, enum machine_mode mode) |
void | gen_int_fp_fixed_libfunc (optab optable, const char *name, char suffix, enum machine_mode mode) |
void | gen_int_fp_signed_fixed_libfunc (optab optable, const char *name, char suffix, enum machine_mode mode) |
void | gen_int_fixed_libfunc (optab optable, const char *name, char suffix, enum machine_mode mode) |
void | gen_int_signed_fixed_libfunc (optab optable, const char *name, char suffix, enum machine_mode mode) |
void | gen_int_unsigned_fixed_libfunc (optab optable, const char *name, char suffix, enum machine_mode mode) |
void | gen_interclass_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_int_to_fp_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_ufloat_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_int_to_fp_nondecimal_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_fp_to_int_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_intraclass_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_trunc_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_extend_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_fract_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_fractuns_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_satfract_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
void | gen_satfractuns_conv_libfunc (convert_optab tab, const char *opname, enum machine_mode tmode, enum machine_mode fmode) |
static hashval_t | libfunc_decl_hash () |
static int | libfunc_decl_eq () |
tree | build_libfunc_function () |
rtx | init_one_libfunc () |
rtx | set_user_assembler_libfunc () |
void | set_optab_libfunc () |
void | set_conv_libfunc (convert_optab optab, enum machine_mode tmode, enum machine_mode fmode, const char *name) |
void | init_optabs () |
void | init_tree_optimization_optabs () |
static void | init_sync_libfuncs_1 () |
void | init_sync_libfuncs () |
rtx | gen_cond_trap () |
static enum rtx_code | get_rtx_code () |
static rtx | vector_compare_rtx (enum tree_code tcode, tree t_op0, tree t_op1, bool unsignedp, enum insn_code icode) |
bool | can_vec_perm_p (enum machine_mode mode, bool variable, const unsigned char *sel) |
static rtx | expand_vec_perm_1 (enum insn_code icode, rtx target, rtx v0, rtx v1, rtx sel) |
rtx | expand_vec_perm () |
static enum insn_code | get_vcond_icode () |
bool | expand_vec_cond_expr_p () |
rtx | expand_vec_cond_expr (tree vec_cond_type, tree op0, tree op1, tree op2, rtx target) |
int | can_mult_highpart_p () |
rtx | expand_mult_highpart (enum machine_mode mode, rtx op0, rtx op1, rtx target, bool uns_p) |
bool | can_compare_and_swap_p () |
bool | can_atomic_exchange_p () |
static void | find_cc_set () |
static bool | expand_compare_and_swap_loop () |
static rtx | maybe_emit_atomic_exchange () |
static rtx | maybe_emit_sync_lock_test_and_set (rtx target, rtx mem, rtx val, enum memmodel model) |
static rtx | maybe_emit_compare_and_swap_exchange_loop () |
static rtx | maybe_emit_atomic_test_and_set () |
rtx | expand_sync_lock_test_and_set () |
rtx | expand_atomic_test_and_set () |
rtx | expand_atomic_exchange () |
bool | expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval, rtx mem, rtx expected, rtx desired, bool is_weak, enum memmodel succ_model, enum memmodel fail_model) |
static void | expand_asm_memory_barrier () |
void | expand_mem_thread_fence () |
void | expand_mem_signal_fence () |
rtx | expand_atomic_load () |
rtx | expand_atomic_store () |
static void | get_atomic_op_for_code () |
static rtx | maybe_optimize_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code, enum memmodel model, bool after) |
static rtx | maybe_emit_op (const struct atomic_op_functions *optab, rtx target, rtx mem, rtx val, bool use_memmodel, enum memmodel model, bool after) |
static rtx | expand_atomic_fetch_op_no_fallback (rtx target, rtx mem, rtx val, enum rtx_code code, enum memmodel model, bool after) |
rtx | expand_atomic_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code, enum memmodel model, bool after) |
bool | insn_operand_matches () |
bool | valid_multiword_target_p () |
static bool | maybe_legitimize_operand_same_code (enum insn_code icode, unsigned int opno, struct expand_operand *op) |
static bool | maybe_legitimize_operand (enum insn_code icode, unsigned int opno, struct expand_operand *op) |
void | create_convert_operand_from_type (struct expand_operand *op, rtx value, tree type) |
bool | maybe_legitimize_operands (enum insn_code icode, unsigned int opno, unsigned int nops, struct expand_operand *ops) |
rtx | maybe_gen_insn (enum insn_code icode, unsigned int nops, struct expand_operand *ops) |
bool | maybe_expand_insn (enum insn_code icode, unsigned int nops, struct expand_operand *ops) |
bool | maybe_expand_jump_insn (enum insn_code icode, unsigned int nops, struct expand_operand *ops) |
void | expand_insn (enum insn_code icode, unsigned int nops, struct expand_operand *ops) |
void | expand_jump_insn (enum insn_code icode, unsigned int nops, struct expand_operand *ops) |
static bool | get_traditional_extraction_insn (extraction_insn *insn, enum extraction_type type, enum machine_mode mode, enum insn_code icode, int struct_op, int field_op) |
static bool | get_optab_extraction_insn (struct extraction_insn *insn, enum extraction_type type, enum machine_mode mode, direct_optab reg_optab, direct_optab misalign_optab, int pos_op) |
static bool | get_extraction_insn (extraction_insn *insn, enum extraction_pattern pattern, enum extraction_type type, enum machine_mode mode) |
static bool | get_best_extraction_insn (extraction_insn *insn, enum extraction_pattern pattern, enum extraction_type type, unsigned HOST_WIDE_INT struct_bits, enum machine_mode field_mode) |
bool | get_best_reg_extraction_insn (extraction_insn *insn, enum extraction_pattern pattern, unsigned HOST_WIDE_INT struct_bits, enum machine_mode field_mode) |
bool | get_best_mem_extraction_insn (extraction_insn *insn, enum extraction_pattern pattern, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitnum, enum machine_mode field_mode) |
Variables | |
struct target_optabs | default_target_optabs |
struct target_libfuncs | default_target_libfuncs |
struct target_optabs * | this_fn_optabs = &default_target_optabs |
struct target_optabs * | this_target_optabs = &default_target_optabs |
struct target_libfuncs * | this_target_libfuncs = &default_target_libfuncs |
static htab_t | libfunc_decls |
enum extraction_type |
|
static |
Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to the result of operation CODE applied to OP0 (and OP1 if it is a binary operation). If the last insn does not set TARGET, don't do anything, but return 1. If the last insn or a previous insn sets TARGET and TARGET is one of OP0 or OP1, don't add the REG_EQUAL note but return 0. Our caller can then try again, ensuring that TARGET is not one of the operands.
References copy_rtx(), reg_overlap_mentioned_p(), RTX_BIN_ARITH, RTX_COMM_ARITH, RTX_COMM_COMPARE, RTX_COMPARE, rtx_equal_p(), RTX_UNARY, set_unique_reg_note(), and simplify_gen_unary().
Referenced by expand_binop_directly(), expand_ctz(), expand_doubleword_clz(), expand_ffs(), expand_unop_direct(), and maybe_emit_unop_insn().
|
static |
X is to be used in mode MODE as operand OPN to BINOPTAB. If we're optimizing, and if the operand is a constant that costs more than 1 instruction, force the constant into a register and return that register. Return X otherwise. UNSIGNEDP says whether X is unsigned.
References convert_modes(), force_reg(), HOST_WIDE_INT, optab_to_code(), optimize_insn_for_speed_p(), rtx_cost(), set_src_cost(), and trunc_int_for_mode().
Referenced by expand_binop(), expand_binop_directly(), and expand_twoval_binop().
tree build_libfunc_function | ( | ) |
Build a decl for a libfunc named NAME.
References build_function_type(), and get_identifier().
bool can_atomic_exchange_p | ( | ) |
Return true if an atomic exchange can be performed.
References can_compare_and_swap_p(), and direct_optab_handler().
Referenced by expand_omp_atomic_store().
bool can_compare_and_swap_p | ( | ) |
Return true if there is a compare_and_swap pattern.
References direct_optab_handler(), optab_handler(), and optab_libfunc().
Referenced by can_atomic_exchange_p(), expand_atomic_fetch_op(), expand_omp_atomic_fetch_op(), expand_omp_atomic_pipeline(), fold_builtin_atomic_always_lock_free(), maybe_emit_compare_and_swap_exchange_loop(), and maybe_emit_sync_lock_test_and_set().
int can_compare_p | ( | enum rtx_code | code, |
enum machine_mode | mode, | ||
enum can_compare_purpose | purpose | ||
) |
Nonzero 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, insn_operand_matches(), and optab_handler().
Referenced by do_compare_rtx_and_jump(), do_jump_1(), emit_cmp_and_jump_insns(), emit_store_flag(), emit_store_flag_force(), and prepare_cmp_insn().
int can_conditionally_move_p | ( | ) |
Return nonzero if a conditional move of mode MODE is supported. This function is for combine so it can tell whether an insn that looks like a conditional move is actually supported by the hardware. If we guess wrong we lose a bit on optimization, but that's it.
??? sparc64 supports conditionally moving integers values based on fp comparisons, and vice versa. How do we handle them?
References direct_optab_handler().
enum insn_code can_extend_p | ( | enum machine_mode | to_mode, |
enum machine_mode | from_mode, | ||
int | unsignedp | ||
) |
Return the insn code used to extend FROM_MODE to TO_MODE. UNSIGNEDP specifies zero-extension instead of sign-extension. If no such operation exists, CODE_FOR_nothing will be returned.
References convert_optab_handler().
Referenced by assign_parm_setup_reg(), compress_float_constant(), convert_move(), gen_extend_insn(), and init_expr_target().
|
static |
can_fix_p and can_float_p say whether the target machine can directly convert a given fixed point type to a given floating point type, or vice versa. The returned value is the CODE_FOR_... value to use, or CODE_FOR_nothing if these modes cannot be directly converted. *TRUNCP_PTR is set to 1 if it is necessary to output an explicit FTRUNC insn before the fix insn; otherwise 0.
References convert_optab_handler(), and optab_handler().
Referenced by expand_fix(), and supportable_convert_operation().
enum insn_code can_float_p | ( | enum | machine_mode, |
enum | machine_mode, | ||
int | |||
) |
Return the insn_code for a FLOAT_EXPR.
References convert_optab_handler().
Referenced by expand_float(), simplify_float_conversion_using_ranges(), and supportable_convert_operation().
int can_mult_highpart_p | ( | ) |
Return non-zero if a highpart multiply is supported of can be synthisized. For the benefit of expand_mult_highpart, the return value is 1 for direct, 2 for even/odd widening, and 3 for hi/lo widening.
References can_vec_perm_p(), and optab_handler().
Referenced by expand_mult_highpart(), expand_vector_divmod(), expand_vector_operations_1(), vect_recog_divmod_pattern(), and vectorizable_operation().
bool can_vec_perm_p | ( | enum machine_mode | mode, |
bool | variable, | ||
const unsigned char * | sel | ||
) |
Return true if VEC_PERM_EXPR can be expanded using SIMD extensions of the CPU. SEL may be NULL, which stands for an unknown constant.
References direct_optab_handler(), mode_for_vector(), optab_handler(), and targetm.
Referenced by can_mult_highpart_p(), lower_vec_perm(), simplify_vector_constructor(), vect_gen_perm_mask(), vect_grouped_load_supported(), vect_grouped_store_supported(), and vect_transform_slp_perm_load().
|
static |
Return true if BINOPTAB implements a commutative binary operation.
References optab_to_code(), and RTX_COMM_ARITH.
Referenced by expand_binop(), and expand_binop_directly().
rtx convert_optab_libfunc | ( | convert_optab | optab, |
enum machine_mode | mode1, | ||
enum machine_mode | mode2 | ||
) |
Return libfunc corresponding operation defined by OPTAB converting from MODE2 to MODE1. Trigger lazy initialization if needed, return NULL if no libfunc is available.
References convlib_def, convert_optab_libcall_d::libcall_basename, convert_optab_libcall_d::libcall_gen, libfunc_entry::libfunc, libfunc_entry::mode1, libfunc_entry::mode2, and libfunc_entry::op.
Referenced by convert_move(), debug_optab_libfuncs(), expand_fix(), expand_fixed_convert(), and expand_float().
void create_convert_operand_from_type | ( | struct expand_operand * | op, |
rtx | value, | ||
tree | type | ||
) |
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().
Referenced by expand_vec_shift_expr(), and try_casesi().
DEBUG_FUNCTION void debug_optab_libfuncs | ( | void | ) |
Debug facility for use in GDB.
Print information about the current contents of the optabs on STDERR.
References convert_optab_libfunc(), optab_libfunc(), and optab_to_code().
|
static |
Subroutine of emit_cmp_and_jump_insns; this function is called when we know we can do the branch.
References add_reg_note(), any_condjump_p(), emit_jump_insn(), find_reg_note(), no_conflict_data::insn, insn_operand_matches(), optab_handler(), and PROFILE_ABSENT.
Referenced by emit_cmp_and_jump_insns().
void emit_cmp_and_jump_insns | ( | rtx | x, |
rtx | y, | ||
enum rtx_code | comparison, | ||
rtx | size, | ||
enum machine_mode | mode, | ||
int | unsignedp, | ||
rtx | label, | ||
int | prob | ||
) |
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.
References can_compare_p(), ccp_jump, emit_cmp_and_jump_insn_1(), force_reg(), OPTAB_LIB_WIDEN, prepare_cmp_insn(), swap_commutative_operands_p(), swap_condition(), and unsigned_condition().
Referenced by allocate_dynamic_stack_space(), anti_adjust_stack_and_probe(), asan_clear_shadow(), do_compare_rtx_and_jump(), do_tablejump(), emit_block_move_via_loop(), emit_case_nodes(), expand_compare_and_swap_loop(), expand_copysign_absneg(), expand_doubleword_clz(), expand_ffs(), expand_fix(), expand_float(), probe_stack_range(), sjlj_emit_function_enter(), stack_protect_epilogue(), store_expr(), and try_casesi().
rtx emit_conditional_add | ( | rtx | target, |
enum rtx_code | code, | ||
rtx | op0, | ||
rtx | op1, | ||
enum machine_mode | cmode, | ||
rtx | op2, | ||
rtx | op3, | ||
enum 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 convert_move(), create_fixed_operand(), create_input_operand(), create_output_operand(), delete_insns_since(), do_pending_stack_adjust(), gen_reg_rtx(), get_last_insn(), last, maybe_expand_insn(), optab_handler(), OPTAB_WIDEN, prepare_cmp_insn(), simplify_gen_relational(), swap_commutative_operands_p(), swap_condition(), unsigned_condition(), and expand_operand::value.
Referenced by noce_try_addcc().
rtx emit_conditional_move | ( | rtx | target, |
enum rtx_code | code, | ||
rtx | op0, | ||
rtx | op1, | ||
enum machine_mode | cmode, | ||
rtx | op2, | ||
rtx | op3, | ||
enum machine_mode | mode, | ||
int | unsignedp | ||
) |
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 convert_move(), create_fixed_operand(), create_input_operand(), create_output_operand(), delete_insns_since(), direct_optab_handler(), do_pending_stack_adjust(), gen_reg_rtx(), get_last_insn(), last, maybe_expand_insn(), OPTAB_WIDEN, prepare_cmp_insn(), reversed_comparison_code_parts(), simplify_gen_relational(), swap_commutative_operands_p(), swap_condition(), unsigned_condition(), and expand_operand::value.
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().
void emit_indirect_jump | ( | ) |
Generate code to indirectly jump to a location given in the rtx LOC.
References create_address_operand(), emit_barrier(), and expand_jump_insn().
void emit_libcall_block | ( | ) |
References emit_libcall_block_1().
|
static |
Emit code to make a call to a constant function or a library call. INSNS is a list containing all insns emitted in the call. These insns leave the result in RESULT. Our block is to copy RESULT to TARGET, which is logically equivalent to EQUIV. We first emit any insns that set a pseudo on the assumption that these are loading constants into registers; doing so allows them to be safely cse'ed between blocks. Then we emit all the other insns in the block, followed by an insn to move RESULT to TARGET. This last insn will have a REQ_EQUAL note with an operand of EQUIV.
References add_insn(), function::can_throw_non_call_exceptions, cfun, copy_rtx(), emit_move_insn(), find_reg_note(), no_conflict_data::first, gen_reg_rtx(), no_conflict_data::insn, last, make_reg_eh_region_note_nothrow_nononlocal(), may_trap_p(), no_conflict_data::must_stay, no_conflict_move_test(), note_stores(), remove_note(), set_dst_reg_note(), and no_conflict_data::target.
Referenced by emit_libcall_block(), expand_binop(), and expand_unop().
void emit_unop_insn | ( | ) |
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 maybe_emit_unop_insn().
Referenced by compress_float_constant(), convert_move(), expand_copysign_absneg(), expand_fixed_convert(), and expand_float().
|
static |
Used for libfunc_hash.
References libfunc_entry::mode1, libfunc_entry::mode2, and libfunc_entry::op.
Referenced by init_optabs().
References do_compare_rtx_and_jump(), emit_label(), emit_move_insn(), expand_abs_nojump(), expand_unop(), gen_label_rtx(), and gen_reg_rtx().
Referenced by expand_builtin_fabs(), expand_divmod(), and expand_expr_real_2().
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(), last, optab_handler(), OPTAB_LIB_WIDEN, OPTAB_WIDEN, and optimize_insn_for_speed_p().
Referenced by expand_abs(), and noce_try_abs().
|
static |
Expand a floating point absolute value or negation operation via a logical operation on the sign bit.
References copy_rtx(), emit_insn(), emit_move_insn(), end_sequence(), expand_binop(), gen_reg_rtx(), get_insns(), get_last_insn(), real_format::has_signed_zero, immed_double_int_const(), int_mode_for_mode(), lowpart_subreg_maybe_copy(), operand_subword(), operand_subword_force(), OPTAB_LIB_WIDEN, double_int::set_bit(), set_dst_reg_note(), real_format::signbit_rw, start_sequence(), valid_multiword_target_p(), and word_mode.
Referenced by expand_abs_nojump(), and expand_unop().
|
static |
Generate asm volatile("" : : : "memory") as the memory barrier.
References emit_insn(), empty_string, gen_rtvec(), gen_rtx_MEM(), and rtvec_alloc().
Referenced by expand_mem_signal_fence(), and expand_mem_thread_fence().
bool expand_atomic_compare_and_swap | ( | rtx * | ptarget_bool, |
rtx * | ptarget_oval, | ||
rtx | mem, | ||
rtx | expected, | ||
rtx | desired, | ||
bool | is_weak, | ||
enum memmodel | succ_model, | ||
enum memmodel | fail_model | ||
) |
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 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 copy_to_reg(), create_convert_operand_to(), create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), emit_library_call_value(), emit_store_flag_force(), expand_insn(), find_cc_set(), gen_reg_rtx(), get_last_insn(), have_insn_for(), insn_data, LCT_NORMAL, maybe_expand_insn(), note_stores(), insn_data_d::operand, optab_handler(), optab_libfunc(), ptr_mode, reg_overlap_mentioned_p(), and expand_operand::value.
Referenced by expand_atomic_load(), expand_builtin_atomic_compare_exchange(), expand_builtin_compare_and_swap(), and expand_compare_and_swap_loop().
rtx expand_atomic_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 maybe_emit_atomic_exchange(), and maybe_emit_compare_and_swap_exchange_loop().
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_compare_and_swap_p(), 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(), atomic_op_functions::fetch_after, atomic_op_functions::fetch_before, gen_reg_rtx(), get_atomic_op_for_code(), get_insns(), LCT_NORMAL, OPTAB_LIB_WIDEN, optab_libfunc(), ptr_mode, register_operand(), atomic_op_functions::reverse_code, and start_sequence().
Referenced by expand_builtin_atomic_fetch_op(), and expand_builtin_sync_operation().
|
static |
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). This function will *only* generate instructions if there is a direct optab. No compare and swap loops or libcalls will be generated.
References expand_simple_binop(), expand_simple_unop(), get_atomic_op_for_code(), maybe_emit_op(), maybe_optimize_fetch_op(), OPTAB_LIB_WIDEN, and atomic_op_functions::reverse_code.
Referenced by expand_atomic_fetch_op().
rtx expand_atomic_load | ( | ) |
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 create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), emit_move_insn(), expand_atomic_compare_and_swap(), expand_mem_thread_fence(), gen_reg_rtx(), maybe_expand_insn(), MEMMODEL_SEQ_CST, and expand_operand::value.
rtx expand_atomic_store | ( | ) |
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 create_fixed_operand(), create_input_operand(), create_integer_operand(), direct_optab_handler(), emit_move_insn(), expand_mem_thread_fence(), maybe_emit_atomic_exchange(), maybe_emit_compare_and_swap_exchange_loop(), maybe_expand_insn(), and MEMMODEL_SEQ_CST.
rtx expand_atomic_test_and_set | ( | ) |
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 emit_move_insn(), emit_store_flag_force(), gen_int_mode(), gen_reg_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(), and targetm.
rtx expand_binop | ( | enum machine_mode | mode, |
optab | binoptab, | ||
rtx | op0, | ||
rtx | op1, | ||
rtx | target, | ||
int | unsignedp, | ||
enum optab_methods | methods | ||
) |
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 avoid_expensive_constant(), commutative_optab_p(), convert_move(), 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_mult(), expand_doubleword_shift(), expand_vector_broadcast(), force_reg(), gen_reg_rtx(), get_insns(), get_last_insn(), HOST_WIDE_INT, last, LCT_CONST, negate_rtx(), operand_subword(), operand_subword_force(), OPTAB_DIRECT, optab_handler(), OPTAB_LIB, OPTAB_LIB_WIDEN, optab_libfunc(), OPTAB_MUST_WIDEN, optab_to_code(), OPTAB_WIDEN, optimize_insn_for_speed_p(), rtx_equal_p(), set_dst_reg_note(), shift_optab_p(), start_sequence(), swap_commutative_operands_with_target(), targetm, trapv_binoptab_p(), unknown_optab, valid_multiword_target_p(), expand_operand::value, widen_operand(), widened_mode(), widening_optab_handler(), and word_mode.
Referenced by adjust_stack_1(), allocate_dynamic_stack_space(), asan_emit_stack_protection(), do_jump_by_parts_zero_rtx(), emit_push_insn(), emit_single_push_insn_1(), emit_store_flag(), emit_store_flag_1(), expand_abs_nojump(), expand_absneg_bit(), expand_and(), expand_binop(), expand_binop_directly(), expand_builtin_mathfn_2(), expand_builtin_next_arg(), expand_builtin_signbit(), expand_copysign(), expand_copysign_absneg(), expand_copysign_bit(), expand_ctz(), expand_dec(), expand_divmod(), expand_doubleword_clz(), expand_doubleword_mult(), expand_expr_real_2(), expand_ffs(), expand_fix(), expand_float(), expand_inc(), expand_mult(), expand_mult_highpart(), expand_one_cmpl_abs_nojump(), expand_parity(), expand_sdiv_pow2(), expand_shift_1(), expand_simple_binop(), expand_smod_pow2(), expand_subword_shift(), expand_unop(), expand_widening_mult(), expmed_mult_highpart_optab(), extract_fixed_bit_field(), extract_split_bit_field(), find_shift_sequence(), 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_expr(), store_fixed_bit_field(), and widen_leading().
|
static |
Helper function for expand_binop: handle the case where there is an insn that directly implements the indicated operation. Returns null if this is not possible.
References add_equal_note(), avoid_expensive_constant(), commutative_optab_p(), convert_modes(), create_input_operand(), create_output_operand(), delete_insns_since(), emit_insn(), expand_binop(), insn_data, maybe_gen_insn(), optab_to_code(), shift_optab_p(), swap(), swap_commutative_operands_with_target(), expand_operand::value, and widened_mode().
Referenced by expand_binop().
|
static |
This is a helper function for the other atomic operations. This function emits a loop that contains SEQ that iterates until a compare-and-swap operation at the end succeeds. MEM is the memory to be modified. SEQ is a set of instructions that takes a value from OLD_REG as an input and produces a value in NEW_REG as an output. Before SEQ, OLD_REG will be set to the current contents of MEM. After SEQ, a compare-and-swap will attempt to update MEM with NEW_REG. The function returns true when the loop was generated successfully.
References emit_cmp_and_jump_insns(), emit_insn(), emit_label(), emit_move_insn(), expand_atomic_compare_and_swap(), gen_label_rtx(), gen_reg_rtx(), MEMMODEL_RELAXED, and MEMMODEL_SEQ_CST.
Referenced by expand_atomic_fetch_op(), and maybe_emit_compare_and_swap_exchange_loop().
rtx expand_copysign | ( | ) |
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 expand_binop(), expand_copysign_absneg(), expand_copysign_bit(), real_format::has_signed_zero, OPTAB_DIRECT, optab_handler(), real_isneg(), real_format::signbit_ro, real_format::signbit_rw, and simplify_unary_operation().
Referenced by expand_builtin_copysign().
|
static |
A subroutine of expand_copysign, perform the copysign operation using the abs and neg primitives advertised to exist on the target. The assumption is that we have a split register file, and leaving op0 in fp registers, and not playing with subregs so much, will help the register allocator.
References copy_to_reg(), emit_cmp_and_jump_insns(), emit_label(), emit_move_insn(), emit_unop_insn(), expand_binop(), expand_unop(), gen_label_rtx(), gen_reg_rtx(), immed_double_int_const(), insn_data, int_mode_for_mode(), operand_subword_force(), optab_handler(), OPTAB_LIB_WIDEN, double_int::set_bit(), simplify_unary_operation(), and word_mode.
Referenced by expand_copysign().
|
static |
A subroutine of expand_copysign, perform the entire copysign operation with integer bitmasks. BITPOS is the position of the sign bit; OP0_IS_ABS is true if op0 is known to have its sign bit clear.
References emit_insn(), emit_move_insn(), end_sequence(), expand_binop(), gen_reg_rtx(), get_insns(), immed_double_int_const(), int_mode_for_mode(), lowpart_subreg_maybe_copy(), operand_subword(), operand_subword_force(), OPTAB_LIB_WIDEN, double_int::set_bit(), start_sequence(), valid_multiword_target_p(), and word_mode.
Referenced by expand_copysign().
|
static |
Try calculating ctz(x) as K - clz(x & -x) , where K is GET_MODE_PRECISION(mode) - 1. Both __builtin_ctz and __builtin_clz are undefined at zero, so we don't have to worry about what the hardware does in that case. (If the clz instruction produces the usual value at 0, which is K, the result of this code sequence will be -1; expand_ffs, below, relies on this. It might be nice to have it be K instead, for consistency with the (very few) processors that provide a ctz with a defined value, but that would take one more instruction, and it would be less convenient for expand_ffs anyway.
References add_equal_note(), emit_insn(), end_sequence(), expand_binop(), expand_unop_direct(), get_insns(), OPTAB_DIRECT, optab_handler(), and start_sequence().
Referenced by expand_ffs(), and expand_unop().
|
static |
Try calculating bswap as two bswaps of two word-sized operands.
References emit_clobber(), emit_move_insn(), expand_unop(), gen_reg_rtx(), operand_subword(), operand_subword_force(), valid_multiword_target_p(), and word_mode.
Referenced by expand_unop().
|
static |
Try calculating clz of a double-word quantity as two clz's of word-sized quantities, choosing which based on whether the high word is nonzero.
References add_equal_note(), convert_move(), emit_barrier(), emit_cmp_and_jump_insns(), emit_insn(), emit_jump_insn(), emit_label(), end_sequence(), expand_binop(), expand_unop_direct(), force_reg(), gen_highpart(), gen_label_rtx(), gen_reg_rtx(), get_insns(), OPTAB_DIRECT, start_sequence(), and word_mode.
Referenced by expand_unop().
|
static |
Subroutine of expand_binop. Perform a double word multiplication of operands OP0 and OP1 both of mode MODE, which is exactly twice as wide as the target's word_mode. This function return NULL_RTX if anything goes wrong, in which case it may have already emitted instructions which need to be deleted. If we want to multiply two two-word values and have normal and widening multiplies of single-word values, we can do this with three smaller multiplications. The multiplication proceeds as follows: _______________________ [__op0_high_|__op0_low__] _______________________ * [__op1_high_|__op1_low__] _______________________________________________ _______________________ (1) [__op0_low__*__op1_low__] _______________________ (2a) [__op0_low__*__op1_high_] _______________________ (2b) [__op0_high_*__op1_low__] _______________________ (3) [__op0_high_*__op1_high_] This gives a 4-word result. Since we are only interested in the lower 2 words, partial result (3) and the upper words of (2a) and (2b) don't need to be calculated. Hence (2a) and (2b) can be calculated using non-widening multiplication. (1), however, needs to be calculated with an unsigned widening multiplication. If this operation is not directly supported we try using a signed widening multiplication and adjust the result. This adjustment works as follows: If both operands are positive then no adjustment is needed. If the operands have different signs, for example op0_low < 0 and op1_low >= 0, the instruction treats the most significant bit of op0_low as a sign bit instead of a bit with significance 2**(BITS_PER_WORD-1), i.e. the instruction multiplies op1_low with 2**BITS_PER_WORD - op0_low, and two's complements the result. Conclusion: We need to add op1_low * 2**BITS_PER_WORD to the result. Similarly, if both operands are negative, we need to add (op0_low + op1_low) * 2**BITS_PER_WORD. We use a trick to adjust quickly. We logically shift op0_low right (op1_low) BITS_PER_WORD-1 steps to get 0 or 1, and add this to op0_high (op1_high) before it is used to calculate 2b (2a). If no logical shift exists, we do an arithmetic right shift and subtract the 0 or -1.
References emit_move_insn(), expand_binop(), operand_subword(), operand_subword_force(), OPTAB_DIRECT, and word_mode.
Referenced by expand_binop().
|
static |
Expand a doubleword shift (ashl, ashr or lshr) using word-mode shifts. OUTOF_INPUT and INTO_INPUT are the two word-sized halves of the first input operand; the shift moves bits in the direction OUTOF_INPUT-> INTO_TARGET. OUTOF_TARGET and INTO_TARGET are the equivalent words of the target. OP1 is the shift count and OP1_MODE is its mode. If OP1 is constant, it will have been truncated as appropriate and is known to be nonzero. If SHIFT_MASK is zero, the result of word shifts is undefined when the shift count is outside the range [0, BITS_PER_WORD). This routine must avoid generating such shifts for OP1s in the range [0, BITS_PER_WORD * 2). If SHIFT_MASK is nonzero, all word-mode shift counts are effectively masked by it and shifts in the range [BITS_PER_WORD, SHIFT_MASK) will fill with zeros or sign bits as appropriate. If SHIFT_MASK is BITS_PER_WORD - 1, this routine will synthesize a doubleword shift whose equivalent mask is BITS_PER_WORD * 2 - 1. Doing this preserves semantics required by SHIFT_COUNT_TRUNCATED. In all other cases, shifts by values outside [0, BITS_PER_UNIT * 2) are undefined. BINOPTAB, UNSIGNEDP and METHODS are as for expand_binop. This function may not use INTO_INPUT after modifying INTO_TARGET, and similarly for OUTOF_INPUT and OUTOF_TARGET. OUTOF_TARGET can be null if the parent function wants to calculate it itself. Return true if the shift could be successfully synthesized.
References delete_insns_since(), do_compare_rtx_and_jump(), emit_barrier(), emit_jump_insn(), emit_label(), expand_doubleword_shift_condmove(), expand_subword_shift(), expand_superword_shift(), force_expand_binop(), gen_label_rtx(), get_last_insn(), immed_double_const(), simplify_expand_binop(), simplify_relational_operation(), and word_mode.
Referenced by expand_binop().
|
static |
Try implementing expand_doubleword_shift using conditional moves. The shift is by < BITS_PER_WORD if (CMP_CODE CMP1 CMP2) is true, otherwise it is by >= BITS_PER_WORD. SUBWORD_OP1 and SUPERWORD_OP1 are the shift counts to use in the former and latter case. All other arguments are the same as the parent routine.
References emit_conditional_move(), expand_subword_shift(), expand_superword_shift(), gen_reg_rtx(), and word_mode.
Referenced by expand_doubleword_shift().
|
static |
Try calculating ffs(x) using ctz(x) if we have that instruction, or else with the sequence used by expand_clz. The ffs builtin promises to return zero for a zero value and ctz/clz may have an undefined value in that case. If they do not give us a convenient value, we have to generate a test and branch.
References add_equal_note(), convert_move(), emit_cmp_and_jump_insns(), emit_insn(), emit_label(), end_sequence(), expand_binop(), expand_ctz(), expand_unop_direct(), gen_label_rtx(), get_insns(), HOST_WIDE_INT, OPTAB_DIRECT, optab_handler(), and start_sequence().
Referenced by expand_unop().
void expand_fix | ( | ) |
Generate code to convert FROM to fixed point and store in TO. FROM must be floating point.
References can_fix_p(), convert_move(), convert_optab_libfunc(), convert_to_mode(), copy_rtx(), 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_unop(), gen_int_mode(), gen_label_rtx(), gen_reg_rtx(), get_insns(), get_last_insn(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, last, LCT_CONST, limit, maybe_emit_unop_insn(), offset, optab_handler(), OPTAB_LIB_WIDEN, real_2expN(), set_dst_reg_note(), start_sequence(), and expand_operand::value.
Referenced by expand_builtin_int_roundingfn(), expand_expr_real_2(), and force_operand().
void expand_fixed_convert | ( | ) |
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(), get_insns(), LCT_CONST, optab_to_code(), start_sequence(), and expand_operand::value.
Referenced by convert_move(), and expand_expr_real_2().
void expand_float | ( | ) |
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(), 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(), expand_binop(), expand_shift(), gen_label_rtx(), gen_reg_rtx(), get_insns(), LCT_CONST, offset, OPTAB_LIB_WIDEN, real_2expN(), significand_size(), start_sequence(), and expand_operand::value.
Referenced by expand_expr_real_2(), and force_operand().
void expand_insn | ( | enum insn_code | icode, |
unsigned int | nops, | ||
struct expand_operand * | ops | ||
) |
Emit instruction ICODE, using operands [OPS, OPS + NOPS) as its operands.
References maybe_expand_insn().
Referenced by allocate_dynamic_stack_space(), expand_assignment(), expand_atomic_compare_and_swap(), expand_builtin_set_thread_pointer(), expand_builtin_thread_pointer(), expand_expr_real_1(), expand_LOAD_LANES(), expand_movstr(), expand_mult_highpart(), expand_STORE_LANES(), expand_ternary_op(), expand_vec_cond_expr(), expand_vec_shift_expr(), and expand_widen_pattern_expr().
void expand_jump_insn | ( | enum insn_code | icode, |
unsigned int | nops, | ||
struct expand_operand * | ops | ||
) |
Like expand_insn, but for jumps.
References maybe_expand_jump_insn().
Referenced by emit_indirect_jump(), and try_casesi().
void expand_mem_signal_fence | ( | ) |
References emit_insn(), expand_asm_memory_barrier(), and MEMMODEL_RELAXED.
Referenced by expand_builtin_atomic_signal_fence().
void expand_mem_thread_fence | ( | ) |
Expand a highpart multiply.
References can_mult_highpart_p(), create_input_operand(), create_output_operand(), expand_binop(), expand_insn(), expand_vec_perm(), gen_reg_rtx(), gen_rtx_CONST_VECTOR(), insn_data, insn_data_d::operand, optab_handler(), OPTAB_LIB_WIDEN, rtvec_alloc(), and expand_operand::value.
Referenced by expand_expr_real_2().
rtx expand_one_cmpl_abs_nojump | ( | ) |
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(), get_last_insn(), last, optab_handler(), OPTAB_LIB_WIDEN, OPTAB_WIDEN, and optimize_insn_for_speed_p().
Referenced by noce_try_abs().
|
static |
Try calculating (parity x) as (and (popcount x) 1), where popcount can also be done in a wider mode.
References delete_insns_since(), expand_binop(), expand_unop(), gen_reg_rtx(), get_last_insn(), last, OPTAB_DIRECT, optab_handler(), and widen_operand().
Referenced by expand_unop().
bool expand_sfix_optab | ( | ) |
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(), gen_reg_rtx(), get_last_insn(), last, and maybe_emit_unop_insn().
Referenced by expand_builtin_int_roundingfn(), and expand_builtin_int_roundingfn_2().
rtx expand_simple_binop | ( | enum machine_mode | mode, |
enum rtx_code | code, | ||
rtx | op0, | ||
rtx | op1, | ||
rtx | target, | ||
int | unsignedp, | ||
enum optab_methods | methods | ||
) |
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 code_to_optab(), and expand_binop().
Referenced by asan_clear_shadow(), emit_block_move_via_loop(), emit_case_nodes(), emit_move_resolve_push(), expand_atomic_fetch_op(), expand_atomic_fetch_op_no_fallback(), expand_builtin_apply(), expand_builtin_atomic_fetch_op(), expand_expr_addr_expr_1(), expand_vec_perm(), force_operand(), generate_prolog_epilog(), instantiate_virtual_regs_in_insn(), noce_try_addcc(), noce_try_minmax(), noce_try_store_flag_constants(), noce_try_store_flag_mask(), round_trampoline_addr(), and unroll_loop_runtime_iterations().
rtx expand_simple_unop | ( | enum machine_mode | mode, |
enum rtx_code | code, | ||
rtx | op0, | ||
rtx | target, | ||
int | unsignedp | ||
) |
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 code_to_optab(), and expand_unop().
Referenced by expand_atomic_fetch_op(), expand_atomic_fetch_op_no_fallback(), expand_builtin_atomic_fetch_op(), force_operand(), and noce_try_abs().
|
static |
This subroutine of expand_doubleword_shift handles the cases in which the effective shift value is < BITS_PER_WORD. The arguments and return value are the same as for the parent routine.
References expand_binop(), force_expand_binop(), immed_double_const(), simplify_expand_binop(), and word_mode.
Referenced by expand_doubleword_shift(), and expand_doubleword_shift_condmove().
|
static |
This subroutine of expand_doubleword_shift handles the cases in which the effective shift value is >= BITS_PER_WORD. The arguments and return value are the same as for the parent routine, except that SUPERWORD_OP1 is the shift count to use when shifting OUTOF_INPUT into INTO_TARGET. INTO_TARGET may be null if the caller has decided to calculate it.
References emit_move_insn(), force_expand_binop(), and word_mode.
Referenced by expand_doubleword_shift(), and expand_doubleword_shift_condmove().
rtx expand_sync_lock_test_and_set | ( | ) |
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 maybe_emit_atomic_exchange(), maybe_emit_atomic_test_and_set(), maybe_emit_compare_and_swap_exchange_loop(), maybe_emit_sync_lock_test_and_set(), and MEMMODEL_ACQUIRE.
rtx expand_ternary_op | ( | enum machine_mode | mode, |
optab | ternary_optab, | ||
rtx | op0, | ||
rtx | op1, | ||
rtx | op2, | ||
rtx | target, | ||
int | unsignedp | ||
) |
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(), optab_handler(), and expand_operand::value.
Referenced by expand_builtin_mathfn_ternary(), and expand_expr_real_2().
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 1 if this operation can be performed; 0 if not.
References avoid_expensive_constant(), convert_modes(), convert_move(), create_convert_operand_from(), create_fixed_operand(), delete_insns_since(), expand_twoval_binop(), gen_reg_rtx(), get_last_insn(), insn_data, last, maybe_expand_insn(), insn_data_d::operand, and optab_handler().
Referenced by expand_divmod(), and expand_twoval_binop().
bool expand_twoval_binop_libfunc | ( | optab | binoptab, |
rtx | op0, | ||
rtx | op1, | ||
rtx | targ0, | ||
rtx | targ1, | ||
enum rtx_code | code | ||
) |
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(), get_insns(), LCT_CONST, optab_libfunc(), simplify_gen_subreg(), smallest_mode_for_size(), and start_sequence().
Referenced by expand_divmod().
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 1 if this operation can be performed; 0 if not.
References convert_modes(), convert_move(), create_convert_operand_from(), create_fixed_operand(), delete_insns_since(), expand_twoval_unop(), gen_reg_rtx(), get_last_insn(), last, maybe_expand_insn(), and optab_handler().
Referenced by expand_builtin_cexpi(), expand_builtin_mathfn_3(), expand_builtin_sincos(), and expand_twoval_unop().
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 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_ctz(), expand_doubleword_bswap(), expand_doubleword_clz(), expand_ffs(), expand_parity(), expand_shift(), expand_unop(), expand_unop_direct(), gen_reg_rtx(), get_insns(), get_last_insn(), hard_libcall_value(), last, LCT_CONST, operand_subword(), operand_subword_force(), OPTAB_DIRECT, optab_handler(), OPTAB_LIB_WIDEN, optab_libfunc(), optab_to_code(), OPTAB_WIDEN, simplify_gen_unary(), start_sequence(), trapv_unoptab_p(), valid_multiword_target_p(), expand_operand::value, widen_bswap(), widen_leading(), widen_operand(), and word_mode.
Referenced by emit_cstore(), emit_store_flag(), emit_store_flag_1(), expand_abs(), expand_abs_nojump(), expand_builtin_bswap(), expand_builtin_mathfn(), expand_builtin_mathfn_3(), expand_builtin_unop(), expand_copysign_absneg(), expand_divmod(), expand_doubleword_bswap(), expand_expr_real_2(), expand_fix(), expand_mult(), expand_mult_const(), expand_one_cmpl_abs_nojump(), expand_parity(), expand_simple_unop(), expand_unop(), expand_unop_direct(), negate_rtx(), noce_emit_move_insn(), widen_bswap(), and widen_leading().
|
static |
As expand_unop, but will fail rather than attempt the operation in a different mode or with a libcall.
References add_equal_note(), create_convert_operand_from(), create_output_operand(), delete_insns_since(), emit_insn(), expand_unop(), get_last_insn(), last, maybe_gen_insn(), optab_handler(), optab_to_code(), and expand_operand::value.
Referenced by expand_ctz(), expand_doubleword_clz(), expand_ffs(), and expand_unop().
Generate insns for a VEC_COND_EXPR, given its TYPE and its three operands.
References build_zero_cst(), create_fixed_operand(), create_input_operand(), create_output_operand(), expand_insn(), expand_normal(), get_vcond_icode(), expand_operand::value, and vector_compare_rtx().
Referenced by do_store_flag(), and expand_expr_real_2().
bool expand_vec_cond_expr_p | ( | ) |
Return TRUE iff, appropriate vector insns are available for vector cond expr with vector type VALUE_TYPE and a comparison with operand vector types in CMP_OP_TYPE.
References get_vcond_icode().
Referenced by check_bool_pattern(), expand_vector_comparison(), expand_vector_condition(), expand_vector_divmod(), vect_recog_mixed_size_cond_pattern(), and vectorizable_condition().
rtx expand_vec_perm | ( | ) |
Generate instructions for vec_perm optab given its mode and three operands.
References direct_optab_handler(), exact_log2(), expand_simple_binop(), expand_vec_perm_1(), gen_reg_rtx(), gen_rtx_CONST_VECTOR(), mode_for_vector(), OPTAB_DIRECT, and rtvec_alloc().
Referenced by expand_expr_real_2(), and expand_mult_highpart().
A subroutine of expand_vec_perm for expanding one vec_perm insn.
References create_fixed_operand(), create_input_operand(), create_output_operand(), force_reg(), insn_operand_matches(), maybe_expand_insn(), rtx_equal_p(), and expand_operand::value.
Referenced by expand_vec_perm().
rtx expand_vec_shift_expr | ( | ) |
Generate insns for VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR.
References separate_ops::code, create_convert_operand_from_type(), create_input_operand(), create_output_operand(), expand_insn(), expand_normal(), separate_ops::op0, separate_ops::op1, optab_handler(), separate_ops::type, and expand_operand::value.
Referenced by expand_expr_real_2().
|
static |
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 emit_insn(), gen_reg_rtx(), gen_rtx_CONST_VECTOR(), optab_handler(), and rtvec_alloc().
Referenced by expand_binop().
rtx expand_widen_pattern_expr | ( | sepops | ops, |
rtx | op0, | ||
rtx | op1, | ||
rtx | wide_op, | ||
rtx | target, | ||
int | unsignedp | ||
) |
Expand vector widening operations. There are two different classes of operations handled here: 1) Operations whose result is wider than all the arguments to the operation. Examples: VEC_UNPACK_HI/LO_EXPR, VEC_WIDEN_MULT_HI/LO_EXPR In this case OP0 and optionally OP1 would be initialized, but WIDE_OP wouldn't (not relevant for this case). 2) Operations whose result is of the same size as the last argument to the operation, but wider than all the other arguments to the operation. Examples: WIDEN_SUM_EXPR, VEC_DOT_PROD_EXPR. In the case WIDE_OP, OP0 and optionally OP1 would be initialized. E.g, when called to expand the following operations, this is how the arguments will be initialized: nops OP0 OP1 WIDE_OP widening-sum 2 oprnd0 - oprnd1 widening-dot-product 3 oprnd0 oprnd1 oprnd2 widening-mult 2 oprnd0 oprnd1 - type-promotion (vec-unpack) 1 oprnd0 - -
References separate_ops::code, create_convert_operand_from(), create_output_operand(), expand_insn(), separate_ops::op0, separate_ops::op1, separate_ops::op2, optab_default, optab_for_tree_code(), optab_handler(), separate_ops::type, and expand_operand::value.
Referenced by expand_expr_real_2().
|
static |
Helper function to find the MODE_CC set in a sync_compare_and_swap pattern.
References SET.
Referenced by expand_atomic_compare_and_swap().
enum insn_code find_widening_optab_handler_and_mode | ( | optab | op, |
enum machine_mode | to_mode, | ||
enum machine_mode | from_mode, | ||
int | permit_non_widening, | ||
enum machine_mode * | found_mode | ||
) |
Find a widening optab even if it doesn't widen as much as we want. E.g. if from_mode is HImode, and to_mode is DImode, and there is no direct HI->SI insn, then return SI->DI, if that exists. If PERMIT_NON_WIDENING is non-zero then this can be used with non-widening optabs also.
References handler(), and widening_optab_handler().
Referenced by convert_mult_to_widen(), and convert_plusminus_to_widen().
bool force_expand_binop | ( | enum machine_mode | mode, |
optab | binoptab, | ||
rtx | op0, | ||
rtx | op1, | ||
rtx | target, | ||
int | unsignedp, | ||
enum optab_methods | methods | ||
) |
Like simplify_expand_binop, but always put the result in TARGET. Return true if the expansion succeeded.
References emit_move_insn(), and simplify_expand_binop().
Referenced by expand_doubleword_shift(), expand_sjlj_dispatch_table(), expand_subword_shift(), expand_superword_shift(), and shift_return_value().
rtx gen_add2_insn | ( | ) |
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 insn_operand_matches(), and optab_handler().
rtx gen_add3_insn | ( | ) |
Generate and return an insn body to add r1 and c, storing the result in r0.
References insn_operand_matches(), and optab_handler().
rtx gen_cond_trap | ( | ) |
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(), insn_operand_matches(), OPTAB_DIRECT, optab_handler(), prepare_cmp_insn(), and start_sequence().
void gen_extend_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Pick proper libcall for extend_optab. We need to chose if we do truncation or extension and interclass or intraclass.
References gen_interclass_conv_libfunc(), and gen_intraclass_conv_libfunc().
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().
Referenced by assign_parm_setup_reg().
void gen_fixed_libfunc | ( | optab | optable, |
const char * | opname, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that fixed-point operation is involved.
References gen_libfunc().
Referenced by gen_int_fixed_libfunc(), and gen_int_fp_fixed_libfunc().
void gen_fp_libfunc | ( | optab | optable, |
const char * | opname, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that FP and set decimal prefix if needed.
References gen_libfunc(), memcpy(), and strlen().
Referenced by gen_int_fp_fixed_libfunc(), gen_int_fp_libfunc(), gen_int_fp_signed_fixed_libfunc(), and gen_intv_fp_libfunc().
void gen_fp_to_int_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Same as gen_interclass_conv_libfunc but verify that we are producing fp->int conversion with no decimal floating point involved.
References gen_interclass_conv_libfunc().
void gen_fract_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Pick proper libcall for fract_optab. We need to chose if we do interclass or intraclass.
References gen_interclass_conv_libfunc(), and gen_intraclass_conv_libfunc().
void gen_fractuns_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Pick proper libcall for fractuns_optab.
References gen_interclass_conv_libfunc().
void gen_int_fixed_libfunc | ( | optab | optable, |
const char * | name, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that INT or FIXED operation is involved.
References gen_fixed_libfunc(), and gen_int_libfunc().
void gen_int_fp_fixed_libfunc | ( | optab | optable, |
const char * | name, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that FP or INT or FIXED operation is involved.
References gen_fixed_libfunc(), gen_fp_libfunc(), and gen_int_libfunc().
void gen_int_fp_libfunc | ( | optab | optable, |
const char * | name, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that FP or INT operation is involved.
References gen_fp_libfunc(), and gen_int_libfunc().
void gen_int_fp_signed_fixed_libfunc | ( | optab | optable, |
const char * | name, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that FP or INT or signed FIXED operation is involved.
References gen_fp_libfunc(), gen_int_libfunc(), and gen_signed_fixed_libfunc().
void gen_int_libfunc | ( | optab | optable, |
const char * | opname, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that integer operation is involved.
References gen_libfunc(), and word_mode.
Referenced by gen_int_fixed_libfunc(), gen_int_fp_fixed_libfunc(), gen_int_fp_libfunc(), gen_int_fp_signed_fixed_libfunc(), gen_int_signed_fixed_libfunc(), gen_int_unsigned_fixed_libfunc(), and gen_intv_fp_libfunc().
void gen_int_signed_fixed_libfunc | ( | optab | optable, |
const char * | name, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that INT or signed FIXED operation is involved.
References gen_int_libfunc(), and gen_signed_fixed_libfunc().
void gen_int_to_fp_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Same as gen_interclass_conv_libfunc but verify that we are producing int->fp conversion.
References gen_interclass_conv_libfunc().
Referenced by gen_ufloat_conv_libfunc().
void gen_int_to_fp_nondecimal_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Same as gen_interclass_conv_libfunc but verify that we are producing fp->int conversion.
References gen_interclass_conv_libfunc().
void gen_int_unsigned_fixed_libfunc | ( | optab | optable, |
const char * | name, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that INT or unsigned FIXED operation is involved.
References gen_int_libfunc(), and gen_unsigned_fixed_libfunc().
void gen_interclass_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Initialize the libfunc fields of an entire group of entries of an inter-mode-class conversion optab. The string formation rules are similar to the ones for init_libfuncs, above, but instead of having a mode name and an operand count these functions have two mode names and no operand count.
References memcpy(), set_conv_libfunc(), strlen(), and targetm.
Referenced by gen_extend_conv_libfunc(), gen_fp_to_int_conv_libfunc(), gen_fract_conv_libfunc(), gen_fractuns_conv_libfunc(), gen_int_to_fp_conv_libfunc(), gen_int_to_fp_nondecimal_conv_libfunc(), gen_satfract_conv_libfunc(), gen_satfractuns_conv_libfunc(), and gen_trunc_conv_libfunc().
void gen_intraclass_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Initialize the libfunc fields of an of an intra-mode-class conversion optab. The string formation rules are similar to the ones for init_libfunc, above.
References memcpy(), set_conv_libfunc(), strlen(), and targetm.
Referenced by gen_extend_conv_libfunc(), gen_fract_conv_libfunc(), gen_satfract_conv_libfunc(), and gen_trunc_conv_libfunc().
void gen_intv_fp_libfunc | ( | optab | optable, |
const char * | name, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that FP or INT operation is involved and add 'v' suffix for integer operation.
References gen_fp_libfunc(), gen_int_libfunc(), len, and strlen().
|
static |
Initialize the libfunc fields of an entire group of entries in some optab. Each entry is set equal to a string consisting of a leading pair of underscores followed by a generic operation name followed by a mode name (downshifted to lowercase) followed by a single character representing the number of operands for the given operation (which is usually one of the characters '2', '3', or '4'). OPTABLE is the table in which libfunc fields are to be initialized. OPNAME is the generic (string) name of the operation. SUFFIX is the character which specifies the number of operands for the given generic operation. MODE is the mode to generate for.
References len, set_optab_libfunc(), strlen(), and targetm.
Referenced by gen_fixed_libfunc(), gen_fp_libfunc(), gen_int_libfunc(), gen_signed_fixed_libfunc(), and gen_unsigned_fixed_libfunc().
rtx gen_move_insn | ( | ) |
Generate the body of an instruction to copy Y into X. It may be a list of insns, if one insn isn't enough.
References emit_move_insn_1(), end_sequence(), get_insns(), and start_sequence().
void gen_satfract_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Pick proper libcall for satfract_optab. We need to chose if we do interclass or intraclass.
References gen_interclass_conv_libfunc(), and gen_intraclass_conv_libfunc().
void gen_satfractuns_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Pick proper libcall for satfractuns_optab.
References gen_interclass_conv_libfunc().
void gen_signed_fixed_libfunc | ( | optab | optable, |
const char * | opname, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that signed fixed-point operation is involved.
References gen_libfunc().
Referenced by gen_int_fp_signed_fixed_libfunc(), and gen_int_signed_fixed_libfunc().
rtx gen_sub2_insn | ( | ) |
Generate and return an insn body to subtract Y from X.
References insn_operand_matches(), and optab_handler().
rtx gen_sub3_insn | ( | ) |
Generate and return an insn body to subtract r1 and c, storing the result in r0.
References insn_operand_matches(), and optab_handler().
void gen_trunc_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
Pick proper libcall for trunc_optab. We need to chose if we do truncation or extension and interclass or intraclass.
References gen_interclass_conv_libfunc(), and gen_intraclass_conv_libfunc().
void gen_ufloat_conv_libfunc | ( | convert_optab | tab, |
const char * | opname, | ||
enum machine_mode | tmode, | ||
enum machine_mode | fmode | ||
) |
ufloat_optab is special by using floatun for FP and floatuns decimal fp naming scheme.
References gen_int_to_fp_conv_libfunc().
void gen_unsigned_fixed_libfunc | ( | optab | optable, |
const char * | opname, | ||
char | suffix, | ||
enum machine_mode | mode | ||
) |
Like gen_libfunc, but verify that unsigned fixed-point operation is involved.
References gen_libfunc().
Referenced by gen_int_unsigned_fixed_libfunc().
|
static |
Fill in structure pointed to by OP with the various optab entries for an operation of type CODE.
References atomic_op_functions::fetch_after, atomic_op_functions::fetch_before, atomic_op_functions::mem_fetch_after, atomic_op_functions::mem_fetch_before, atomic_op_functions::mem_no_result, atomic_op_functions::no_result, and atomic_op_functions::reverse_code.
Referenced by expand_atomic_fetch_op(), and expand_atomic_fetch_op_no_fallback().
|
static |
Return true if an instruction exists to access a field of mode FIELDMODE in a structure that has STRUCT_BITS significant bits. Describe the "best" such instruction in *INSN if so. PATTERN and TYPE describe the type of insertion or extraction we want to perform. For an insertion, the number of significant structure bits includes all bits of the target. For an extraction, it need only include the most significant bit of the field. Larger widths are acceptable in both cases.
References extraction_insn::field_mode, get_extraction_insn(), and smallest_mode_for_size().
Referenced by get_best_mem_extraction_insn(), and get_best_reg_extraction_insn().
bool get_best_mem_extraction_insn | ( | extraction_insn * | insn, |
enum extraction_pattern | pattern, | ||
HOST_WIDE_INT | bitsize, | ||
HOST_WIDE_INT | bitnum, | ||
enum machine_mode | field_mode | ||
) |
Return true if an instruction exists to access a field of BITSIZE bits starting BITNUM bits into a memory structure. Describe the "best" such instruction in *INSN if so. PATTERN describes the type of insertion or extraction we want to perform and FIELDMODE is the natural mode of the extracted field. The instructions considered here only access bytes that overlap the bitfield; they do not touch any surrounding bytes.
References ET_unaligned_mem, get_best_extraction_insn(), and HOST_WIDE_INT.
Referenced by extract_bit_field_1(), and store_bit_field_1().
bool get_best_reg_extraction_insn | ( | extraction_insn * | insn, |
enum extraction_pattern | pattern, | ||
unsigned HOST_WIDE_INT | struct_bits, | ||
enum machine_mode | field_mode | ||
) |
Return true if an instruction exists to access a field of mode FIELDMODE in a register structure that has STRUCT_BITS significant bits. Describe the "best" such instruction in *INSN if so. PATTERN describes the type of insertion or extraction we want to perform. For an insertion, the number of significant structure bits includes all bits of the target. For an extraction, it need only include the most significant bit of the field. Larger widths are acceptable in both cases.
References ET_reg, and get_best_extraction_insn().
Referenced by adjust_bit_field_mem_for_reg(), extract_bit_field_1(), make_extraction(), and store_bit_field_1().
|
static |
Return true if an instruction exists to perform an insertion or extraction (PATTERN says which) of type TYPE in mode MODE. Describe the instruction in *INSN if so.
References EP_extv, EP_extzv, EP_insv, get_optab_extraction_insn(), and get_traditional_extraction_insn().
Referenced by get_best_extraction_insn().
|
static |
Return true if an optab exists to perform an insertion or extraction of type TYPE in mode MODE. Describe the instruction in *INSN if so. REG_OPTAB is the optab to use for register structures and MISALIGN_OPTAB is the optab to use for misaligned memory structures. POS_OP is the operand number of the bit position.
References direct_optab_handler(), ET_unaligned_mem, extraction_insn::field_mode, extraction_insn::icode, insn_data, insn_data_d::operand, extraction_insn::pos_mode, extraction_insn::struct_mode, and word_mode.
Referenced by get_extraction_insn().
|
static |
Return rtx code for TCODE. Use UNSIGNEDP to select signed or unsigned operation code.
Referenced by vector_compare_rtx().
|
static |
Check whether insv, extv or extzv pattern ICODE can be used for an insertion or extraction of type TYPE on a structure of mode MODE. Return true if so and fill in *INSN accordingly. STRUCT_OP is the operand number of the structure (the first sign_extract or zero_extract operand) and FIELD_OP is the operand number of the field (the other side of the set from the sign_extract or zero_extract).
References byte_mode, ET_unaligned_mem, extraction_insn::field_mode, extraction_insn::icode, insn_data, insn_data_d::operand, extraction_insn::pos_mode, extraction_insn::struct_mode, and word_mode.
Referenced by get_extraction_insn().
|
inlinestatic |
Return insn code for a conditional operator with a comparison in mode CMODE, unsigned if UNS is true, resulting in a value of mode VMODE.
References convert_optab_handler().
Referenced by expand_vec_cond_expr(), and expand_vec_cond_expr_p().
|
static |
Used for libfunc_hash.
References libfunc_entry::mode1, libfunc_entry::mode2, and libfunc_entry::op.
Referenced by init_optabs().
int have_add2_insn | ( | ) |
References insn_operand_matches(), and optab_handler().
int have_insn_for | ( | ) |
Report whether we have an instruction to perform the operation specified by CODE on operands of mode MODE.
References code_to_optab(), and optab_handler().
int have_sub2_insn | ( | ) |
References insn_operand_matches(), and optab_handler().
rtx init_one_libfunc | ( | ) |
References build_libfunc_function(), get_identifier(), libfunc_decl_eq(), libfunc_decl_hash(), and libfunc_decls.
void init_optabs | ( | void | ) |
Call this to initialize the contents of the optabs appropriately for the current target machine.
References eq_libfunc(), hash_libfunc(), init_all_optabs(), init_one_libfunc(), mode_for_size(), set_optab_libfunc(), and targetm.
Referenced by lang_dependent_init_target().
void init_sync_libfuncs | ( | ) |
References init_sync_libfuncs_1().
|
static |
A helper function for init_sync_libfuncs. Using the basename BASE, install libfuncs into TAB for BASE_N for 1 <= N <= MAX.
References len, memcpy(), set_optab_libfunc(), and strlen().
Referenced by init_sync_libfuncs().
void init_tree_optimization_optabs | ( | ) |
Use the current target and options to initialize TREE_OPTIMIZATION_OPTABS (OPTNODE).
References ggc_free(), init_all_optabs(), memset(), and this_target_optabs.
Referenced by invoke_set_current_function_hook().
bool insn_operand_matches | ( | ) |
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(), 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_cond_trap(), gen_reload(), gen_sub2_insn(), gen_sub3_insn(), have_add2_insn(), have_sub2_insn(), init_expr_target(), maybe_legitimize_operand(), maybe_legitimize_operand_same_code(), prepare_cmp_insn(), prepare_operand(), and safe_insn_predicate().
|
static |
Referenced by init_one_libfunc().
|
static |
Hashtable callbacks for libfunc_decls.
Referenced by init_one_libfunc().
|
static |
Extract the OMODE lowpart from VAL, which has IMODE. Under certain conditions, VAL may already be a SUBREG against which we cannot generate a further SUBREG. In this case, we expect forcing the value into a register will work around the situation.
References force_reg(), and lowpart_subreg().
Referenced by expand_absneg_bit(), and expand_copysign_bit().
|
static |
This function tries to emit an atomic_exchange intruction. VAL is written to *MEM using memory model MODEL. The previous contents of *MEM are returned, using TARGET if possible.
References create_convert_operand_to(), create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), maybe_expand_insn(), and expand_operand::value.
Referenced by expand_atomic_exchange(), expand_atomic_store(), expand_atomic_test_and_set(), expand_sync_lock_test_and_set(), and maybe_optimize_fetch_op().
|
static |
References create_fixed_operand(), create_integer_operand(), create_output_operand(), insn_data, maybe_expand_insn(), insn_data_d::operand, and expand_operand::value.
Referenced by expand_atomic_test_and_set(), and expand_sync_lock_test_and_set().
|
static |
This function tries to implement an atomic exchange operation using a compare_and_swap loop. VAL is written to *MEM. The previous contents of *MEM are returned, using TARGET if possible. No memory model is required since a compare_and_swap loop is seq-cst.
References can_compare_and_swap_p(), convert_modes(), expand_compare_and_swap_loop(), gen_reg_rtx(), and register_operand().
Referenced by expand_atomic_exchange(), expand_atomic_store(), expand_atomic_test_and_set(), and expand_sync_lock_test_and_set().
|
static |
Try to emit an instruction for a specific operation varaition. OPTAB contains the OP functions. TARGET is an optional place to return the result. const0_rtx means unused. MEM is the memory location to operate on. VAL is the value to use in the operation. USE_MEMMODEL is TRUE if the variation with a memory model should be tried. MODEL is the memory model, if used. AFTER is true if the returned result is the value after the operation.
References create_convert_operand_to(), create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), atomic_op_functions::fetch_after, atomic_op_functions::fetch_before, maybe_expand_insn(), atomic_op_functions::mem_fetch_after, atomic_op_functions::mem_fetch_before, atomic_op_functions::mem_no_result, atomic_op_functions::no_result, optab_handler(), and expand_operand::value.
Referenced by expand_atomic_fetch_op_no_fallback().
|
static |
This function tries to implement an atomic exchange operation using __sync_lock_test_and_set. VAL is written to *MEM using memory model MODEL. The previous contents of *MEM are returned, using TARGET if possible. Since this instructionn is an acquire barrier only, stronger memory models may require additional barriers to be emitted.
References can_compare_and_swap_p(), create_convert_operand_to(), create_fixed_operand(), create_output_operand(), delete_insns_since(), emit_library_call_value(), expand_mem_thread_fence(), get_last_insn(), LCT_NORMAL, maybe_expand_insn(), MEMMODEL_ACQ_REL, MEMMODEL_RELEASE, MEMMODEL_SEQ_CST, optab_handler(), optab_libfunc(), ptr_mode, and expand_operand::value.
Referenced by expand_atomic_test_and_set(), and expand_sync_lock_test_and_set().
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(), maybe_gen_insn(), and expand_operand::value.
Referenced by emit_unop_insn(), expand_builtin_interclass_mathfn(), expand_builtin_signbit(), expand_fix(), and expand_sfix_optab().
bool maybe_expand_insn | ( | enum insn_code | icode, |
unsigned int | nops, | ||
struct expand_operand * | ops | ||
) |
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_movmem(), emit_conditional_add(), emit_conditional_move(), emit_cstore(), emit_single_push_insn_1(), emit_storent_insn(), expand_atomic_compare_and_swap(), expand_atomic_load(), expand_atomic_store(), expand_builtin___clear_cache(), expand_builtin_prefetch(), expand_builtin_strlen(), expand_insn(), expand_twoval_binop(), expand_twoval_unop(), expand_vec_perm_1(), 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(), probe_stack_range(), set_storage_via_setmem(), store_bit_field_1(), and store_bit_field_using_insv().
bool maybe_expand_jump_insn | ( | enum insn_code | icode, |
unsigned int | nops, | ||
struct expand_operand * | ops | ||
) |
Like maybe_expand_insn, but for jumps.
References emit_jump_insn(), and maybe_gen_insn().
Referenced by expand_jump_insn().
rtx maybe_gen_insn | ( | enum insn_code | icode, |
unsigned int | nops, | ||
struct expand_operand * | ops | ||
) |
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 insn_data, maybe_legitimize_operands(), and expand_operand::value.
Referenced by expand_binop_directly(), expand_unop_direct(), maybe_emit_unop_insn(), maybe_expand_insn(), and maybe_expand_jump_insn().
|
static |
Try to make OP match operand OPNO of instruction ICODE. Return true on success, storing the new operand value back in OP.
References const_int_operand(), convert_modes(), convert_to_mode(), copy_to_mode_reg(), EXPAND_ADDRESS, EXPAND_CONVERT_FROM, EXPAND_CONVERT_TO, EXPAND_FIXED, EXPAND_INPUT, EXPAND_INTEGER, EXPAND_OUTPUT, gen_reg_rtx(), insn_data, insn_operand_matches(), maybe_legitimize_operand_same_code(), expand_operand::unsigned_p, expand_operand::value, and volatile_ok.
Referenced by maybe_legitimize_operands().
|
static |
Like maybe_legitimize_operand, but do not change the code of the current rtx value.
References copy_to_mode_reg(), delete_insns_since(), get_address_mode(), get_last_insn(), insn_data, insn_operand_matches(), last, replace_equiv_address(), side_effects_p(), and expand_operand::value.
Referenced by maybe_legitimize_operand().
bool maybe_legitimize_operands | ( | enum insn_code | icode, |
unsigned int | opno, | ||
unsigned int | nops, | ||
struct expand_operand * | ops | ||
) |
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 delete_insns_since(), get_last_insn(), last, and maybe_legitimize_operand().
Referenced by expand_builtin_interclass_mathfn(), maybe_gen_insn(), and vector_compare_rtx().
|
static |
See if there is a more optimal way to implement the operation "*MEM CODE VAL" using memory order MODEL. If AFTER is true the operation needs to return the value of *MEM after the operation, otherwise the previous value. TARGET is an optional place to place the result. The result is unused if it is const0_rtx. Return the result if there is a better sequence, otherwise NULL_RTX.
References gen_reg_rtx(), and maybe_emit_atomic_exchange().
Referenced by expand_atomic_fetch_op_no_fallback().
|
static |
Called via note_stores by emit_libcall_block. Set P->must_stay if the currently examined clobber / store has to stay in the list of insns that constitute the actual libcall block.
References find_reg_fusage(), no_conflict_data::first, no_conflict_data::insn, modified_between_p(), modified_in_p(), no_conflict_data::must_stay, reg_overlap_mentioned_p(), reg_used_between_p(), SET, and no_conflict_data::target.
Referenced by emit_libcall_block_1().
optab optab_for_tree_code | ( | enum tree_code | code, |
const_tree | type, | ||
enum optab_subtype | subtype | ||
) |
Return the optab used for computing the operation given by the tree code, CODE and the tree EXP. This function is not always usable (for example, it cannot give complete results for multiplication or division) but probably ought to be relied on more widely throughout the expander.
References optab_scalar, optab_vector, and unknown_optab.
Referenced by add_rshift(), convert_plusminus_to_widen(), expand_expr_real_2(), expand_vector_divmod(), expand_vector_operations_1(), expand_widen_pattern_expr(), supportable_narrowing_operation(), supportable_widening_operation(), vect_build_slp_tree_1(), vect_create_epilog_for_reduction(), vect_model_reduction_cost(), vect_pattern_recog_1(), vect_recog_divmod_pattern(), vect_recog_rotate_pattern(), vect_supportable_shift(), vectorizable_operation(), vectorizable_reduction(), and vectorizable_shift().
rtx optab_libfunc | ( | ) |
Return libfunc corresponding operation defined by OPTAB in MODE. Trigger lazy initialization if needed, return NULL if no libfunc is available.
References optab_libcall_d::libcall_basename, optab_libcall_d::libcall_gen, optab_libcall_d::libcall_suffix, libfunc_entry::libfunc, libfunc_entry::mode1, libfunc_entry::mode2, normlib_def, and libfunc_entry::op.
Referenced by can_compare_and_swap_p(), debug_optab_libfuncs(), expand_atomic_compare_and_swap(), expand_atomic_fetch_op(), expand_binop(), expand_builtin_powi(), expand_divmod(), expand_twoval_binop_libfunc(), expand_unop(), maybe_emit_sync_lock_test_and_set(), prepare_cmp_insn(), and prepare_float_lib_cmp().
|
static |
This function is called when we are going to emit a compare instruction that compares the values found in *PX and *PY, using the rtl operator COMPARISON. *PMODE is the mode of the inputs (in case they are const_int). *PUNSIGNEDP nonzero says that the operands are unsigned; this matters if they need to be widened (as given by METHODS). If they have mode BLKmode, then SIZE specifies the size of both operands. This function performs all the setup necessary so that the caller only has to emit a single comparison insn. This setup can involve doing a BLKmode comparison or emitting a library call to perform the comparison if no insn is available to handle it. The values which are passed in through pointers can be modified; the caller should perform the comparison on the modified values. Constant comparisons must have already been folded.
References can_compare_p(), function::can_throw_non_call_exceptions, ccp_jump, cfun, convert_to_mode(), delete_insns_since(), direct_optab_handler(), emit_insn(), emit_library_call_value(), force_reg(), gen_reg_rtx(), get_last_insn(), insn_data, insn_operand_matches(), last, LCT_CONST, LCT_PURE, may_trap_p(), insn_data_d::operand, OPTAB_DIRECT, optab_handler(), OPTAB_LIB, OPTAB_LIB_WIDEN, optab_libfunc(), OPTAB_WIDEN, optimize_insn_for_speed_p(), plus_constant(), prepare_float_lib_cmp(), prepare_operand(), rtx_cost(), targetm, and word_mode.
Referenced by emit_cmp_and_jump_insns(), emit_conditional_add(), emit_conditional_move(), and gen_cond_trap().
|
static |
Emit a library call comparison between floating point X and Y. COMPARISON is the rtl operator to compare with (EQ, NE, GT, etc.).
References code_to_optab(), const_true_rtx, convert_to_mode(), emit_libcall_block(), emit_library_call_value(), end_sequence(), false_rtx, gen_reg_rtx(), get_insns(), LCT_CONST, optab_libfunc(), reverse_condition_maybe_unordered(), simplify_gen_relational(), simplify_gen_ternary(), start_sequence(), swap_condition(), no_conflict_data::target, targetm, and true_rtx.
Referenced by prepare_cmp_insn().
rtx prepare_operand | ( | enum insn_code | icode, |
rtx | x, | ||
int | opnum, | ||
enum machine_mode | mode, | ||
enum machine_mode | wider_mode, | ||
int | unsignedp | ||
) |
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(), insn_data, insn_operand_matches(), and reload_completed.
Referenced by emit_cstore(), and prepare_cmp_insn().
void set_conv_libfunc | ( | convert_optab | optab, |
enum machine_mode | tmode, | ||
enum machine_mode | fmode, | ||
const char * | name | ||
) |
Call this to reset the function entry for one conversion optab (OPTABLE) from mode FMODE to mode TMODE to NAME, which should be either 0 or a string constant.
References init_one_libfunc(), libfunc_entry::mode1, libfunc_entry::mode2, and libfunc_entry::op.
Referenced by gen_interclass_conv_libfunc(), and gen_intraclass_conv_libfunc().
void set_optab_libfunc | ( | ) |
Call this to reset the function entry for one optab (OPTABLE) in mode MODE to NAME, which should be either 0 or a string constant.
References init_one_libfunc(), libfunc_entry::mode1, libfunc_entry::mode2, and libfunc_entry::op.
Referenced by gen_libfunc(), init_optabs(), init_sync_libfuncs_1(), and set_builtin_user_assembler_name().
rtx set_user_assembler_libfunc | ( | ) |
Adjust the assembler name of libfunc NAME to ASMSPEC.
References get_identifier(), libfunc_decls, and set_user_assembler_name().
|
static |
Return true if BINOPTAB implements a shift operation.
References optab_to_code().
Referenced by expand_binop(), and expand_binop_directly().
rtx sign_expand_binop | ( | enum machine_mode | mode, |
optab | uoptab, | ||
optab | soptab, | ||
rtx | op0, | ||
rtx | op1, | ||
rtx | target, | ||
int | unsignedp, | ||
enum optab_methods | methods | ||
) |
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(), OPTAB_DIRECT, OPTAB_LIB, OPTAB_WIDEN, and swap_optab_enable().
Referenced by expand_divmod().
rtx simplify_expand_binop | ( | enum machine_mode | mode, |
optab | binoptab, | ||
rtx | op0, | ||
rtx | op1, | ||
rtx | target, | ||
int | unsignedp, | ||
enum optab_methods | methods | ||
) |
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 expand_binop(), optab_to_code(), and simplify_binary_operation().
Referenced by expand_doubleword_shift(), expand_subword_shift(), force_expand_binop(), and store_bit_field_1().
bool supportable_convert_operation | ( | enum tree_code | code, |
tree | vectype_out, | ||
tree | vectype_in, | ||
tree * | decl, | ||
enum tree_code * | code1 | ||
) |
Function supportable_convert_operation Check whether an operation represented by the code CODE is a convert operation that is supported by the target platform in vector form (i.e., when operating on arguments of type VECTYPE_IN producing a result of type VECTYPE_OUT). Convert operations we currently support directly are FIX_TRUNC and FLOAT. This function checks if these operations are supported by the target platform either directly (via vector tree-codes), or via target builtins. Output: - CODE1 is code of vector operation to be used when vectorizing the operation, if available. - DECL is decl of target builtin functions to be used when vectorizing the operation, if available. In this case, CODE1 is CALL_EXPR.
References can_fix_p(), can_float_p(), and targetm.
Referenced by vectorizable_conversion().
|
static |
Return whether OP0 and OP1 should be swapped when expanding a commutative binop. Order them according to commutative_operand_precedence and, if possible, try to put TARGET or a pseudo first.
References commutative_operand_precedence(), and rtx_equal_p().
Referenced by expand_binop(), and expand_binop_directly().
bool valid_multiword_target_p | ( | ) |
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 validate_subreg(), and word_mode.
Referenced by expand_absneg_bit(), expand_binop(), expand_copysign_bit(), expand_doubleword_bswap(), expand_unop(), and extract_bit_field_1().
|
static |
Return comparison rtx for COND. Use UNSIGNEDP to select signed or unsigned operators. Do not generate compare instruction.
References create_input_operand(), expand_expr(), EXPAND_STACK_PARM, get_rtx_code(), maybe_legitimize_operands(), tcc_comparison, and expand_operand::value.
Referenced by expand_vec_cond_expr().
|
static |
Try calculating (bswap:narrow x) as (lshiftrt:wide (bswap:wide x) ((width wide) - (width narrow))).
References delete_insns_since(), emit_move_insn(), expand_shift(), expand_unop(), gen_reg_rtx(), get_last_insn(), last, optab_handler(), and widen_operand().
Referenced by expand_unop().
|
static |
Try calculating (clz:narrow x) as (clz:wide (zero_extend:wide x)) - ((width wide) - (width narrow)). A similar operation can be used for clrsb. UNOPTAB says which operation we are trying to expand.
References delete_insns_since(), expand_binop(), expand_unop(), gen_reg_rtx(), get_last_insn(), last, OPTAB_DIRECT, optab_handler(), and widen_operand().
Referenced by expand_unop().
|
static |
Widen OP to MODE and return the rtx for the widened operand. UNSIGNEDP says whether OP is signed or unsigned. NO_EXTEND is nonzero if we need not actually do a sign-extend or zero-extend, but can leave the higher-order bits of the result rtx undefined, for example, in the case of logical operations, but not right shifts.
References convert_modes(), emit_clobber(), emit_move_insn(), force_reg(), gen_reg_rtx(), and libfunc_entry::op.
Referenced by expand_binop(), expand_parity(), expand_unop(), widen_bswap(), and widen_leading().
|
static |
Given two input operands, OP0 and OP1, determine what the correct from_mode for a widening operation would be. In most cases this would be OP0, but if that's a constant it'll be VOIDmode, which isn't useful.
Referenced by expand_binop(), and expand_binop_directly().
struct target_libfuncs default_target_libfuncs |
struct target_optabs default_target_optabs |
@verbatim Expand the basic unary and binary arithmetic operations, for GNU compiler.
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/.
Include insn-config.h before expr.h so that HAVE_conditional_move is properly defined.
|
static |
A table of previously-created libfuncs, hashed by name.
Referenced by init_one_libfunc(), and set_user_assembler_libfunc().
struct target_optabs* this_fn_optabs = &default_target_optabs |
Referenced by invoke_set_current_function_hook(), and save_target_globals().
struct target_libfuncs* this_target_libfuncs = &default_target_libfuncs |
struct target_optabs* this_target_optabs = &default_target_optabs |
Referenced by init_tree_optimization_optabs(), invoke_set_current_function_hook(), and save_target_globals().