Lines Matching refs:mode

61 /* Tables of patterns for converting one mode to another.  */
79 /* Indexed by the machine mode, gives the insn code to make a conditional
87 /* Indexed by the machine mode, gives the insn code for vector conditional
210 widen_operand (rtx op, enum machine_mode mode, enum machine_mode oldmode,
225 return convert_modes (mode, oldmode, op, unsignedp);
229 if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
230 return gen_rtx_SUBREG (mode, force_reg (GET_MODE (op), op), 0);
235 result = gen_reg_rtx (mode);
345 on operands OP0, OP1 and OP2, with result having machine-mode MODE.
356 expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0,
359 int icode = (int) ternary_optab->handlers[(int) mode].insn_code;
360 enum machine_mode mode0 = insn_data[icode].operand[1].mode;
361 enum machine_mode mode1 = insn_data[icode].operand[2].mode;
362 enum machine_mode mode2 = insn_data[icode].operand[3].mode;
367 gcc_assert (ternary_optab->handlers[(int) mode].insn_code
370 if (!target || !insn_data[icode].operand[0].predicate (target, mode))
371 temp = gen_reg_rtx (mode);
379 for their mode. */
385 : mode,
392 : mode,
399 : mode,
429 simplify_expand_binop (enum machine_mode mode, optab binoptab,
435 rtx x = simplify_binary_operation (binoptab->code, mode, op0, op1);
441 return expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods);
448 force_expand_binop (enum machine_mode mode, optab binoptab,
452 rtx x = simplify_expand_binop (mode, binoptab, op0, op1,
470 enum machine_mode mode = TYPE_MODE (TREE_TYPE (vec_shift_expr));
488 icode = (int) shift_optab->handlers[(int) mode].insn_code;
491 mode1 = insn_data[icode].operand[1].mode;
492 mode2 = insn_data[icode].operand[2].mode;
505 || ! (*insn_data[icode].operand[0].predicate) (target, mode))
506 target = gen_reg_rtx (mode);
580 are truncated to the mode size. */
687 /* Expand a doubleword shift (ashl, ashr or lshr) using word-mode shifts.
691 of the target. OP1 is the shift count and OP1_MODE is its mode.
699 If SHIFT_MASK is nonzero, all word-mode shift counts are effectively
727 /* See if word-mode shifts by BITS_PER_WORD...BITS_PER_WORD * 2 - 1 will
838 operands OP0 and OP1 both of mode MODE, which is exactly twice as wide
894 expand_doubleword_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
902 rtx op0_high = operand_subword_force (op0, high, mode);
903 rtx op0_low = operand_subword_force (op0, low, mode);
904 rtx op1_high = operand_subword_force (op1, high, mode);
905 rtx op1_low = operand_subword_force (op1, low, mode);
982 product = expand_binop (mode, umul_widen_optab, op0_low, op1_low,
985 product = expand_binop (mode, smul_widen_optab, op0_low, op1_low,
991 product_high = operand_subword (product, high, 1, mode);
1004 expand_simple_binop (enum machine_mode mode, enum rtx_code code, rtx op0,
1011 return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
1015 on operands OP0 and OP1, with result having machine-mode MODE.
1026 expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
1045 class = GET_MODE_CLASS (mode);
1052 op1 = negate_rtx (mode, op1);
1062 op0 = convert_modes (mode, VOIDmode, op0, unsignedp);
1063 op0 = force_reg (mode, op0);
1070 op1 = convert_modes (mode, VOIDmode, op1, unsignedp);
1071 op1 = force_reg (mode, op1);
1107 && binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
1109 int icode = (int) binoptab->handlers[(int) mode].insn_code;
1110 enum machine_mode mode0 = insn_data[icode].operand[1].mode;
1111 enum machine_mode mode1 = insn_data[icode].operand[2].mode;
1118 temp = gen_reg_rtx (mode);
1138 for their mode. */
1144 : mode,
1151 : mode,
1165 if (!insn_data[icode].operand[0].predicate (temp, mode))
1166 temp = gen_reg_rtx (mode);
1178 return expand_binop (mode, binoptab, op0, op1, NULL_RTX,
1197 && (unsigned int) INTVAL (op1) < GET_MODE_BITSIZE (mode))
1200 op1 = GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (op1));
1206 takes operands of this mode and makes a wider mode. */
1208 if (binoptab == smul_optab && GET_MODE_WIDER_MODE (mode) != VOIDmode
1210 ->handlers[(int) GET_MODE_WIDER_MODE (mode)].insn_code)
1213 temp = expand_binop (GET_MODE_WIDER_MODE (mode),
1219 if (GET_MODE_CLASS (mode) == MODE_INT
1220 && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
1222 return gen_lowpart (mode, temp);
1224 return convert_to_mode (mode, temp, unsignedp);
1228 /* Look for a wider mode of the same class for which we think we
1230 wider mode as well. */
1234 for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
1258 xop0 = widen_operand (xop0, wider_mode, mode, unsignedp, no_extend);
1261 xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
1269 || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
1273 target = gen_reg_rtx (mode);
1278 return gen_lowpart (mode, temp);
1288 && GET_MODE_SIZE (mode) > UNITS_PER_WORD
1298 target = gen_reg_rtx (mode);
1303 for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
1305 rtx target_piece = operand_subword (target, i, 1, mode);
1307 operand_subword_force (op0, i, mode),
1308 operand_subword_force (op1, i, mode),
1321 if (i == GET_MODE_BITSIZE (mode) / BITS_PER_WORD)
1325 = gen_rtx_fmt_ee (binoptab->code, mode,
1340 && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
1348 double_shift_mask = targetm.shift_truncation_mask (mode);
1373 target = gen_reg_rtx (mode);
1385 outof_target = operand_subword (target, outof_word, 1, mode);
1386 into_target = operand_subword (target, 1 - outof_word, 1, mode);
1388 outof_input = operand_subword_force (op0, outof_word, mode);
1389 into_input = operand_subword_force (op0, 1 - outof_word, mode);
1399 equiv_value = gen_rtx_fmt_ee (binoptab->code, mode, op0, op1);
1411 && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
1428 target = gen_reg_rtx (mode);
1442 outof_target = operand_subword (target, outof_word, 1, mode);
1443 into_target = operand_subword (target, 1 - outof_word, 1, mode);
1445 outof_input = operand_subword_force (op0, outof_word, mode);
1446 into_input = operand_subword_force (op0, 1 - outof_word, mode);
1523 && GET_MODE_SIZE (mode) >= 2 * UNITS_PER_WORD
1528 const unsigned int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
1542 xop0 = force_reg (mode, op0);
1543 xop1 = force_reg (mode, op1);
1545 xtarget = gen_reg_rtx (mode);
1558 rtx target_piece = operand_subword (xtarget, index, 1, mode);
1559 rtx op0_piece = operand_subword_force (xop0, index, mode);
1560 rtx op1_piece = operand_subword_force (xop1, index, mode);
1619 if (i == GET_MODE_BITSIZE (mode) / (unsigned) BITS_PER_WORD)
1621 if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing
1628 gen_rtx_fmt_ee (binoptab->code, mode,
1643 mode multiplications. We first attempt to generate a sequence using a
1649 && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
1655 if (umul_widen_optab->handlers[(int) mode].insn_code
1658 product = expand_doubleword_mult (mode, op0, op1, target,
1665 && smul_widen_optab->handlers[(int) mode].insn_code
1668 product = expand_doubleword_mult (mode, op0, op1, target,
1676 if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
1681 gen_rtx_fmt_ee (MULT, mode,
1689 /* It can't be open-coded in this mode.
1692 if (binoptab->handlers[(int) mode].libfunc
1697 enum machine_mode op1_mode = mode;
1711 && GET_MODE (op0) != mode)
1712 op0 = convert_to_mode (mode, op0, unsignedp);
1716 value = emit_library_call_value (binoptab->handlers[(int) mode].libfunc,
1717 NULL_RTX, LCT_CONST, mode, 2,
1718 op0, mode, op1x, op1_mode);
1723 target = gen_reg_rtx (mode);
1725 gen_rtx_fmt_ee (binoptab->code, mode, op0, op1));
1732 /* It can't be done in this mode. Can we do it in a wider mode? */
1747 /* Look for a wider mode of the same class for which it appears we can do
1752 for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
1774 xop0 = widen_operand (xop0, wider_mode, mode,
1778 xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
1786 || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
1790 target = gen_reg_rtx (mode);
1795 return gen_lowpart (mode, temp);
1816 sign_expand_binop (enum machine_mode mode, optab uoptab, optab soptab,
1825 temp = expand_binop (mode, direct_optab, op0, op1, target,
1833 wide_soptab.handlers[(int) mode].insn_code = CODE_FOR_nothing;
1834 wide_soptab.handlers[(int) mode].libfunc = 0;
1836 temp = expand_binop (mode, &wide_soptab, op0, op1, target,
1841 temp = expand_binop (mode, uoptab, op0, op1, target,
1847 temp = expand_binop (mode, direct_optab, op0, op1, target, unsignedp, OPTAB_LIB);
1852 temp = expand_binop (mode, &wide_soptab, op0, op1, target,
1857 return expand_binop (mode, uoptab, op0, op1, target,
1878 enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
1884 class = GET_MODE_CLASS (mode);
1887 targ0 = gen_reg_rtx (mode);
1889 targ1 = gen_reg_rtx (mode);
1894 if (unoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
1896 int icode = (int) unoptab->handlers[(int) mode].insn_code;
1897 enum machine_mode mode0 = insn_data[icode].operand[2].mode;
1911 gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode));
1912 gcc_assert (insn_data[icode].operand[1].predicate (targ1, mode));
1924 /* It can't be done in this mode. Can we do it in a wider mode? */
1928 for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
1936 rtx cop0 = convert_modes (wider_mode, mode, op0, unsignedp);
1971 enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
1977 class = GET_MODE_CLASS (mode);
1983 op0 = force_reg (mode, op0);
1987 op1 = force_reg (mode, op1);
1990 targ0 = gen_reg_rtx (mode);
1992 targ1 = gen_reg_rtx (mode);
1997 if (binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
1999 int icode = (int) binoptab->handlers[(int) mode].insn_code;
2000 enum machine_mode mode0 = insn_data[icode].operand[1].mode;
2001 enum machine_mode mode1 = insn_data[icode].operand[2].mode;
2009 for their mode. */
2015 : mode,
2022 : mode,
2034 gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode));
2035 gcc_assert (insn_data[icode].operand[3].predicate (targ1, mode));
2047 /* It can't be done in this mode. Can we do it in a wider mode? */
2051 for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
2059 rtx cop0 = convert_modes (wider_mode, mode, op0, unsignedp);
2060 rtx cop1 = convert_modes (wider_mode, mode, op1, unsignedp);
2085 as if the return value was of an integral mode twice as wide as the
2086 mode of OP0. Returns 1 if the call was successful. */
2092 enum machine_mode mode;
2100 mode = GET_MODE (op0);
2101 if (!binoptab->handlers[(int) mode].libfunc)
2106 libval_mode = smallest_mode_for_size (2 * GET_MODE_BITSIZE (mode),
2109 libval = emit_library_call_value (binoptab->handlers[(int) mode].libfunc,
2112 op0, mode,
2113 op1, mode);
2115 libval = simplify_gen_subreg (mode, libval, libval_mode,
2116 targ0 ? 0 : GET_MODE_SIZE (mode));
2121 gen_rtx_fmt_ee (code, mode, op0, op1));
2132 expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0,
2138 return expand_unop (mode, unop, op0, target, unsignedp);
2146 widen_clz (enum machine_mode mode, rtx op0, rtx target)
2148 enum mode_class class = GET_MODE_CLASS (mode);
2152 for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
2163 target = gen_reg_rtx (mode);
2164 xop0 = widen_operand (op0, wider_mode, mode, true, false);
2169 - GET_MODE_BITSIZE (mode)),
2182 popcount can also be done in a wider mode. */
2184 expand_parity (enum machine_mode mode, rtx op0, rtx target)
2186 enum mode_class class = GET_MODE_CLASS (mode);
2190 for (wider_mode = mode; wider_mode != VOIDmode;
2201 target = gen_reg_rtx (mode);
2202 xop0 = widen_operand (op0, wider_mode, mode, true, false);
2242 expand_absneg_bit (enum rtx_code code, enum machine_mode mode,
2252 fmt = REAL_MODE_FORMAT (mode);
2264 if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
2266 imode = int_mode_for_mode (mode);
2277 word = (GET_MODE_BITSIZE (mode) - bitpos) / BITS_PER_WORD;
2281 nwords = (GET_MODE_BITSIZE (mode) + BITS_PER_WORD - 1) / BITS_PER_WORD;
2298 target = gen_reg_rtx (mode);
2306 rtx targ_piece = operand_subword (target, i, 1, mode);
2307 rtx op0_piece = operand_subword_force (op0, i, mode);
2325 temp = gen_rtx_fmt_e (code, mode, copy_rtx (op0));
2334 target = lowpart_subreg_maybe_copy (mode, temp, imode);
2337 gen_rtx_fmt_e (code, mode, copy_rtx (op0)));
2344 on operand OP0, with result having machine-mode MODE.
2355 expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
2364 class = GET_MODE_CLASS (mode);
2366 if (unoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
2368 int icode = (int) unoptab->handlers[(int) mode].insn_code;
2369 enum machine_mode mode0 = insn_data[icode].operand[1].mode;
2375 temp = gen_reg_rtx (mode);
2386 if (!insn_data[icode].operand[0].predicate (temp, mode))
2387 temp = gen_reg_rtx (mode);
2396 return expand_unop (mode, unoptab, op0, NULL_RTX, unsignedp);
2407 /* It can't be done in this mode. Can we open-code it in a wider mode? */
2412 temp = widen_clz (mode, op0, target);
2420 for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
2431 xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
2442 || !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
2446 target = gen_reg_rtx (mode);
2451 return gen_lowpart (mode, temp);
2461 && GET_MODE_SIZE (mode) > UNITS_PER_WORD
2468 target = gen_reg_rtx (mode);
2473 for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
2475 rtx target_piece = operand_subword (target, i, 1, mode);
2477 operand_subword_force (op0, i, mode),
2488 gen_rtx_fmt_e (unoptab->code, mode,
2498 temp = expand_absneg_bit (NEG, mode, op0, target);
2505 if (!HONOR_SIGNED_ZEROS (mode))
2507 temp = expand_binop (mode, (unoptab == negv_optab
2509 CONST0_RTX (mode), op0, target,
2519 temp = expand_parity (mode, op0, target);
2525 /* Now try a library call in this mode. */
2526 if (unoptab->handlers[(int) mode].libfunc)
2530 enum machine_mode outmode = mode;
2543 value = emit_library_call_value (unoptab->handlers[(int) mode].libfunc,
2545 1, op0, mode);
2551 gen_rtx_fmt_e (unoptab->code, mode, op0));
2556 /* It can't be done in this mode. Can we do it in a wider mode? */
2560 for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode;
2573 xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
2581 /* If we are generating clz using wider mode, adjust the
2586 - GET_MODE_BITSIZE (mode)),
2594 target = gen_reg_rtx (mode);
2599 return gen_lowpart (mode, temp);
2609 if (unoptab->code == NEG && !HONOR_SIGNED_ZEROS (mode))
2612 temp = expand_binop (mode,
2614 CONST0_RTX (mode), op0,
2628 MODE is the mode of the operand; the mode of the result is
2634 expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
2643 temp = expand_unop (mode, result_unsignedp ? abs_optab : absv_optab,
2649 if (GET_MODE_CLASS (mode) == MODE_FLOAT)
2651 temp = expand_absneg_bit (ABS, mode, op0, target);
2657 if (smax_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing
2658 && !HONOR_SIGNED_ZEROS (mode))
2662 temp = expand_unop (mode, neg_optab, op0, NULL_RTX, 0);
2664 temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
2677 if (GET_MODE_CLASS (mode) == MODE_INT && BRANCH_COST >= 2)
2679 rtx extended = expand_shift (RSHIFT_EXPR, mode, op0,
2680 size_int (GET_MODE_BITSIZE (mode) - 1),
2683 temp = expand_binop (mode, xor_optab, extended, op0, target, 0,
2686 temp = expand_binop (mode, result_unsignedp ? sub_optab : subv_optab,
2697 expand_abs (enum machine_mode mode, rtx op0, rtx target,
2705 temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
2719 || GET_MODE (target) != mode
2723 target = gen_reg_rtx (mode);
2728 /* If this mode is an integer too wide to compare properly,
2730 if (GET_MODE_CLASS (mode) == MODE_INT
2731 && ! can_compare_p (GE, mode, ccp_jump))
2732 do_jump_by_parts_greater_rtx (mode, 0, target, const0_rtx,
2735 do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
2738 op0 = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
2753 expand_copysign_absneg (enum machine_mode mode, rtx op0, rtx op1, rtx target,
2766 op0 = expand_unop (mode, abs_optab, op0, target, 0);
2779 if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
2781 imode = int_mode_for_mode (mode);
2790 word = (GET_MODE_BITSIZE (mode) - bitpos) / BITS_PER_WORD;
2794 op1 = operand_subword_force (op1, word, mode);
2816 op0 = simplify_unary_operation (NEG, mode, op0, mode);
2818 op0 = expand_unop (mode, neg_optab, op0, target, 0);
2833 expand_copysign_bit (enum machine_mode mode, rtx op0, rtx op1, rtx target,
2841 if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
2843 imode = int_mode_for_mode (mode);
2854 word = (GET_MODE_BITSIZE (mode) - bitpos) / BITS_PER_WORD;
2858 nwords = (GET_MODE_BITSIZE (mode) + BITS_PER_WORD - 1) / BITS_PER_WORD;
2873 target = gen_reg_rtx (mode);
2881 rtx targ_piece = operand_subword (target, i, 1, mode);
2882 rtx op0_piece = operand_subword_force (op0, i, mode);
2892 operand_subword_force (op1, i, mode),
2924 target = lowpart_subreg_maybe_copy (mode, temp, imode);
2931 scalar floating point mode. Return NULL if we do not know how to
2937 enum machine_mode mode = GET_MODE (op0);
2942 gcc_assert (SCALAR_FLOAT_MODE_P (mode));
2943 gcc_assert (GET_MODE (op1) == mode);
2946 temp = expand_binop (mode, copysign_optab, op0, op1,
2951 fmt = REAL_MODE_FORMAT (mode);
2959 op0 = simplify_unary_operation (ABS, mode, op0, mode);
2965 || (neg_optab->handlers[mode].insn_code != CODE_FOR_nothing
2966 && abs_optab->handlers[mode].insn_code != CODE_FOR_nothing)))
2968 temp = expand_copysign_absneg (mode, op0, op1, target,
2976 return expand_copysign_bit (mode, op0, op1, target,
2991 enum machine_mode mode0 = insn_data[icode].operand[1].mode;
3363 /* Nonzero if we can perform a comparison of mode MODE straightforwardly.
3372 can_compare_p (enum rtx_code code, enum machine_mode mode,
3377 if (cmp_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
3388 && cbranch_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
3391 && cmov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
3394 && cstore_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
3396 mode = GET_MODE_WIDER_MODE (mode);
3398 while (mode != VOIDmode);
3406 *PMODE is the mode of the inputs (in case they are const_int).
3410 If they have mode BLKmode, then SIZE specifies the size of both operands.
3425 enum machine_mode mode = *pmode;
3430 class = GET_MODE_CLASS (mode);
3436 x = force_reg (mode, x);
3440 y = force_reg (mode, y);
3449 /* Don't let both operands fail to indicate the mode. */
3451 x = force_reg (mode, x);
3455 if (mode == BLKmode)
3481 /* Must make sure the size fits the insn's mode. */
3488 result_mode = insn_data[cmp_code].operand[0].mode;
3523 x = force_reg (mode, x);
3525 y = force_reg (mode, y);
3530 if (can_compare_p (*pcomparison, mode, purpose))
3533 /* Handle a lib call just for the mode we are using. */
3535 if (cmp_optab->handlers[(int) mode].libfunc && class != MODE_FLOAT)
3537 rtx libfunc = cmp_optab->handlers[(int) mode].libfunc;
3540 /* If we want unsigned, and this mode has a distinct unsigned
3542 if (unsignedp && ucmp_optab->handlers[(int) mode].libfunc)
3543 libfunc = ucmp_optab->handlers[(int) mode].libfunc;
3546 word_mode, 2, x, mode, y, mode);
3575 to be used for operand OPNUM of the insn, is converted from mode MODE to
3580 prepare_operand (int icode, rtx x, int opnum, enum machine_mode mode,
3583 if (mode != wider_mode)
3584 x = convert_modes (wider_mode, mode, x, unsignedp);
3587 (x, insn_data[icode].operand[opnum].mode))
3591 x = copy_to_mode_reg (insn_data[icode].operand[opnum].mode, x);
3603 emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode,
3606 rtx test = gen_rtx_fmt_ee (comparison, mode, x, y);
3607 enum mode_class class = GET_MODE_CLASS (mode);
3608 enum machine_mode wider_mode = mode;
3623 x = prepare_operand (icode, x, 1, mode, wider_mode, unsignedp);
3624 y = prepare_operand (icode, y, 2, mode, wider_mode, unsignedp);
3632 if (y == CONST0_RTX (mode) && icode != CODE_FOR_nothing)
3634 x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
3646 x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
3647 y = prepare_operand (icode, y, 1, mode, wider_mode, unsignedp);
3674 If X and Y have mode BLKmode, then SIZE specifies the size of both X and Y.
3676 MODE is the mode of the inputs (in case they are const_int).
3684 enum machine_mode mode, int unsignedp, rtx label)
3703 op0 = force_reg (mode, op0);
3709 prepare_cmp_insn (&op0, &op1, &comparison, size, &mode, &unsignedp,
3711 emit_cmp_and_jump_insn_1 (op0, op1, mode, comparison, unsignedp, label);
3718 enum machine_mode mode, int unsignedp)
3720 emit_cmp_and_jump_insns (x, y, comparison, size, mode, unsignedp, 0);
3737 enum machine_mode mode;
3742 for (mode = orig_mode; mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode))
3744 if ((libfunc = code_to_optab[comparison]->handlers[mode].libfunc))
3747 if ((libfunc = code_to_optab[swapped]->handlers[mode].libfunc))
3755 if ((libfunc = code_to_optab[reversed]->handlers[mode].libfunc)
3756 && FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, reversed))
3764 gcc_assert (mode != VOIDmode);
3766 if (mode != orig_mode)
3768 x = convert_to_mode (mode, x, 0);
3769 y = convert_to_mode (mode, y, 0);
3777 rtx temp = simplify_gen_relational (NE, word_mode, mode, x, x);
3778 equiv = simplify_gen_relational (NE, word_mode, mode, y, y);
3784 equiv = simplify_gen_relational (comparison, word_mode, mode, x, y);
3785 if (! FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison))
3831 word_mode, 2, x, mode, y, mode);
3839 || FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison))
3867 condition and machine mode.
3870 the mode to use should they be constants. If it is VOIDmode, they cannot
3874 should be stored there. MODE is the mode to use should they be constants.
3883 enum machine_mode mode, int unsignedp)
3921 if (mode == VOIDmode)
3922 mode = GET_MODE (op2);
3924 icode = movcc_gen_code[mode];
3930 target = gen_reg_rtx (mode);
3937 (subtarget, insn_data[icode].operand[0].mode))
3938 subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
3941 (op2, insn_data[icode].operand[2].mode))
3942 op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
3945 (op3, insn_data[icode].operand[3].mode))
3946 op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
3975 /* Return nonzero if a conditional move of mode MODE is supported.
3984 can_conditionally_move_p (enum machine_mode mode)
3986 if (movcc_gen_code[mode] != CODE_FOR_nothing)
3995 condition and machine mode.
3998 the mode to use should they be constants. If it is VOIDmode, they cannot
4002 should be stored there. MODE is the mode to use should they be constants.
4011 enum machine_mode mode, int unsignedp)
4049 if (mode == VOIDmode)
4050 mode = GET_MODE (op2);
4052 icode = addcc_optab->handlers[(int) mode].insn_code;
4058 target = gen_reg_rtx (mode);
4063 (target, insn_data[icode].operand[0].mode))
4064 subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
4069 (op2, insn_data[icode].operand[2].mode))
4070 op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
4073 (op3, insn_data[icode].operand[3].mode))
4074 op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
4116 (x, insn_data[icode].operand[0].mode));
4118 (x, insn_data[icode].operand[1].mode));
4120 (y, insn_data[icode].operand[2].mode));
4134 (r0, insn_data[icode].operand[0].mode))
4136 (r1, insn_data[icode].operand[1].mode))
4138 (c, insn_data[icode].operand[2].mode)))
4157 (x, insn_data[icode].operand[0].mode))
4159 (x, insn_data[icode].operand[1].mode))
4161 (y, insn_data[icode].operand[2].mode)))
4175 (x, insn_data[icode].operand[0].mode));
4177 (x, insn_data[icode].operand[1].mode));
4179 (y, insn_data[icode].operand[2].mode));
4193 (r0, insn_data[icode].operand[0].mode))
4195 (r1, insn_data[icode].operand[1].mode))
4197 (c, insn_data[icode].operand[2].mode)))
4216 (x, insn_data[icode].operand[0].mode))
4218 (x, insn_data[icode].operand[1].mode))
4220 (y, insn_data[icode].operand[2].mode)))
4260 /* Generate the body of an insn to extend Y (with mode MFROM)
4261 into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */
4336 /* Crash now, because we won't be able to decide which mode to use. */
4341 wider mode. If the integer mode is wider than the mode of FROM,
4384 /* Look for a usable floating mode FMODE wider than the source and at
4396 /* There is no such mode. Pretend the target is wide enough. */
4407 or is the wrong mode. */
4534 this conversion. If the integer mode is wider than the mode of TO,
4578 anything with a wider integer mode.
4580 This code used to extend FP value into mode wider than the destination.
4656 that the mode of TO is at least as wide as SImode, since those are the
4699 specified by CODE on operands of mode MODE. */
4701 have_insn_for (enum rtx_code code, enum machine_mode mode)
4704 && (code_to_optab[(int) code]->handlers[(int) mode].insn_code
4770 a mode name (downshifted to lowercase) followed by a single character
4775 FIRST_MODE is the first machine mode index in the given optab to
4777 LAST_MODE is the last machine mode index in the given optab to
4788 int mode;
4791 for (mode = first_mode; (int) mode <= (int) last_mode;
4792 mode = (enum machine_mode) ((int) mode + 1))
4794 const char *mname = GET_MODE_NAME (mode);
4810 optable->handlers[(int) mode].libfunc
4816 optab which correspond to all integer mode operations. The parameters
4832 optab which correspond to all real mode operations. The parameters
4843 inter-mode-class conversion optab. The string formation rules are
4845 a mode name and an operand count these functions have two mode names
4902 intra-mode-class conversion optab. The string formation rules are
4905 have two mode names _and_ an operand count. */
4979 /* Call this to reset the function entry for one optab (OPTABLE) in mode
4982 set_optab_libfunc (optab optable, enum machine_mode mode, const char *name)
4985 optable->handlers[mode].libfunc = init_one_libfunc (name);
4987 optable->handlers[mode].libfunc = 0;
4991 (OPTABLE) from mode FMODE to mode TMODE to NAME, which should be
5374 enum machine_mode mode = GET_MODE (op1);
5381 if (mode == VOIDmode)
5384 icode = cmp_optab->handlers[(int) mode].insn_code;
5389 op1 = prepare_operand (icode, op1, 0, mode, mode, 0);
5390 op2 = prepare_operand (icode, op2, 1, mode, mode, 0);
5506 get_vcond_icode (tree expr, enum machine_mode mode)
5511 icode = vcondu_gen_code[mode];
5513 icode = vcond_gen_code[mode];
5518 for vector cond expr expr in VMODE mode. */
5535 enum machine_mode mode = TYPE_MODE (TREE_TYPE (vec_cond_expr));
5538 icode = get_vcond_icode (vec_cond_expr, mode);
5542 if (!target || !insn_data[icode].operand[0].predicate (target, mode))
5543 target = gen_reg_rtx (mode);
5553 if (!insn_data[icode].operand[1].predicate (rtx_op1, mode)
5554 && mode != VOIDmode)
5555 rtx_op1 = force_reg (mode, rtx_op1);
5559 if (!insn_data[icode].operand[2].predicate (rtx_op2, mode)
5560 && mode != VOIDmode)
5561 rtx_op2 = force_reg (mode, rtx_op2);
5582 enum machine_mode mode = GET_MODE (mem);
5585 if (!target || !insn_data[icode].operand[0].predicate (target, mode))
5586 target = gen_reg_rtx (mode);
5588 if (GET_MODE (old_val) != VOIDmode && GET_MODE (old_val) != mode)
5589 old_val = convert_modes (mode, GET_MODE (old_val), old_val, 1);
5590 if (!insn_data[icode].operand[2].predicate (old_val, mode))
5591 old_val = force_reg (mode, old_val);
5593 if (GET_MODE (new_val) != VOIDmode && GET_MODE (new_val) != mode)
5594 new_val = convert_modes (mode, GET_MODE (new_val), new_val, 1);
5595 if (!insn_data[icode].operand[3].predicate (new_val, mode))
5596 new_val = force_reg (mode, new_val);
5611 enum machine_mode mode = GET_MODE (mem);
5612 enum insn_code icode = sync_compare_and_swap[mode];
5627 enum machine_mode mode = GET_MODE (mem);
5634 icode = sync_compare_and_swap_cc[mode];
5645 icode = sync_compare_and_swap[mode];
5652 old_val = force_reg (mode, old_val);
5659 emit_cmp_insn (subtarget, old_val, EQ, const0_rtx, mode, true);
5670 enum machine_mode cmode = insn_data[icode].operand[0].mode;
5721 enum machine_mode mode = GET_MODE (mem);
5739 cmp_reg = gen_reg_rtx (mode);
5750 icode = sync_compare_and_swap_cc[mode];
5764 icode = sync_compare_and_swap[mode];
5775 emit_cmp_insn (cmp_reg, old_reg, EQ, const0_rtx, mode, true);
5791 enum machine_mode mode = GET_MODE (mem);
5799 icode = sync_add_optab[mode];
5802 icode = sync_ior_optab[mode];
5805 icode = sync_xor_optab[mode];
5808 icode = sync_and_optab[mode];
5811 icode = sync_nand_optab[mode];
5815 icode = sync_sub_optab[mode];
5818 icode = sync_add_optab[mode];
5821 val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
5834 if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
5835 val = convert_modes (mode, GET_MODE (val), val, 1);
5836 if (!insn_data[icode].operand[1].predicate (val, mode))
5837 val = force_reg (mode, val);
5849 if (sync_compare_and_swap[mode] != CODE_FOR_nothing)
5851 rtx t0 = gen_reg_rtx (mode), t1;
5858 t1 = expand_simple_unop (mode, NOT, t1, NULL_RTX, true);
5861 t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX,
5884 enum machine_mode mode = GET_MODE (mem);
5893 old_code = sync_old_add_optab[mode];
5894 new_code = sync_new_add_optab[mode];
5897 old_code = sync_old_ior_optab[mode];
5898 new_code = sync_new_ior_optab[mode];
5901 old_code = sync_old_xor_optab[mode];
5902 new_code = sync_new_xor_optab[mode];
5905 old_code = sync_old_and_optab[mode];
5906 new_code = sync_new_and_optab[mode];
5909 old_code = sync_old_nand_optab[mode];
5910 new_code = sync_new_nand_optab[mode];
5914 old_code = sync_old_sub_optab[mode];
5915 new_code = sync_new_sub_optab[mode];
5918 old_code = sync_old_add_optab[mode];
5919 new_code = sync_new_add_optab[mode];
5922 val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
5964 if (!target || !insn_data[icode].operand[0].predicate (target, mode))
5965 target = gen_reg_rtx (mode);
5967 if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
5968 val = convert_modes (mode, GET_MODE (val), val, 1);
5969 if (!insn_data[icode].operand[2].predicate (val, mode))
5970 val = force_reg (mode, val);
5990 target = expand_simple_unop (mode, NOT, target, NULL_RTX, true);
5991 target = expand_simple_binop (mode, code, target, val, NULL_RTX,
6001 if (sync_compare_and_swap[mode] != CODE_FOR_nothing)
6003 rtx t0 = gen_reg_rtx (mode), t1;
6005 if (!target || !register_operand (target, mode))
6006 target = gen_reg_rtx (mode);
6015 t1 = expand_simple_unop (mode, NOT, t1, NULL_RTX, true);
6018 t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX,
6043 enum machine_mode mode = GET_MODE (mem);
6048 icode = sync_lock_test_and_set[mode];
6051 if (!target || !insn_data[icode].operand[0].predicate (target, mode))
6052 target = gen_reg_rtx (mode);
6054 if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
6055 val = convert_modes (mode, GET_MODE (val), val, 1);
6056 if (!insn_data[icode].operand[2].predicate (val, mode))
6057 val = force_reg (mode, val);
6068 if (sync_compare_and_swap[mode] != CODE_FOR_nothing)
6070 if (!target || !register_operand (target, mode))
6071 target = gen_reg_rtx (mode);
6072 if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
6073 val = convert_modes (mode, GET_MODE (val), val, 1);