Replace gen_rtx_PLUS with a GEN_INT with plus_constant.
2020-05-03 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/i386-expand.c (ix86_expand_int_movcc):
Use plus_constant instead of gen_rtx_PLUS with GEN_INT.
(emit_memmov): Ditto.
(emit_memset): Ditto.
(ix86_expand_strlensi_unroll_1): Ditto.
(release_scratch_register_on_entry): Ditto.
(gen_frame_set): Ditto.
(ix86_emit_restore_reg_using_pop): Ditto.
(ix86_emit_outlined_ms2sysv_restore): Ditto.
(ix86_expand_epilogue): Ditto.
(ix86_expand_split_stack_prologue): Ditto.
* config/i386/i386.md (push immediate splitter): Ditto.
(strmov): Ditto.
(strset): Ditto.
+2020-05-03 Uroš Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386-expand.c (ix86_expand_int_movcc):
+ Use plus_constant instead of gen_rtx_PLUS with GEN_INT.
+ (emit_memmov): Ditto.
+ (emit_memset): Ditto.
+ (ix86_expand_strlensi_unroll_1): Ditto.
+ (release_scratch_register_on_entry): Ditto.
+ (gen_frame_set): Ditto.
+ (ix86_emit_restore_reg_using_pop): Ditto.
+ (ix86_emit_outlined_ms2sysv_restore): Ditto.
+ (ix86_expand_epilogue): Ditto.
+ (ix86_expand_split_stack_prologue): Ditto.
+ * config/i386/i386.md (push immediate splitter): Ditto.
+ (strmov): Ditto.
+ (strset): Ditto.
+
2020-05-02 Iain Sandoe <iain@sandoe.co.uk>
PR translation/93861
}
if (cf != 0)
{
- tmp = gen_rtx_PLUS (mode, tmp, GEN_INT (cf));
+ tmp = plus_constant (mode, tmp, cf);
nops++;
}
if (!rtx_equal_p (tmp, out))
emit_memmov (rtx destmem, rtx *srcmem, rtx destptr, rtx srcptr,
HOST_WIDE_INT size_to_move)
{
- rtx dst = destmem, src = *srcmem, adjust, tempreg;
+ rtx dst = destmem, src = *srcmem, tempreg;
enum insn_code code;
machine_mode move_mode;
int piece_size, i;
/* Emit moves. We'll need SIZE_TO_MOVE/PIECE_SIZES moves. */
gcc_assert (size_to_move % piece_size == 0);
- adjust = GEN_INT (piece_size);
+
for (i = 0; i < size_to_move; i += piece_size)
{
/* We move from memory to memory, so we'll need to do it via
emit_insn (GEN_FCN (code) (dst, tempreg));
emit_move_insn (destptr,
- gen_rtx_PLUS (Pmode, copy_rtx (destptr), adjust));
+ plus_constant (Pmode, copy_rtx (destptr), piece_size));
emit_move_insn (srcptr,
- gen_rtx_PLUS (Pmode, copy_rtx (srcptr), adjust));
+ plus_constant (Pmode, copy_rtx (srcptr), piece_size));
dst = adjust_automodify_address_nv (dst, move_mode, destptr,
piece_size);
emit_memset (rtx destmem, rtx destptr, rtx promoted_val,
HOST_WIDE_INT size_to_move)
{
- rtx dst = destmem, adjust;
+ rtx dst = destmem;
enum insn_code code;
machine_mode move_mode;
int piece_size, i;
/* Emit moves. We'll need SIZE_TO_MOVE/PIECE_SIZES moves. */
gcc_assert (size_to_move % piece_size == 0);
- adjust = GEN_INT (piece_size);
+
for (i = 0; i < size_to_move; i += piece_size)
{
if (piece_size <= GET_MODE_SIZE (word_mode))
emit_insn (GEN_FCN (code) (dst, promoted_val));
emit_move_insn (destptr,
- gen_rtx_PLUS (Pmode, copy_rtx (destptr), adjust));
+ plus_constant (Pmode, copy_rtx (destptr), piece_size));
dst = adjust_automodify_address_nv (dst, move_mode, destptr,
piece_size);
reg,
tmpreg)));
/* Emit lea manually to avoid clobbering of flags. */
- emit_insn (gen_rtx_SET (reg2, gen_rtx_PLUS (Pmode, out, const2_rtx)));
+ emit_insn (gen_rtx_SET (reg2, plus_constant (Pmode, out, 2)));
tmp = gen_rtx_REG (CCNOmode, FLAGS_REG);
tmp = gen_rtx_EQ (VOIDmode, tmp, const0_rtx);
/* The RX FRAME_RELATED_P mechanism doesn't know about pop. */
RTX_FRAME_RELATED_P (insn) = 1;
- x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (UNITS_PER_WORD));
+ x = plus_constant (Pmode, stack_pointer_rtx, UNITS_PER_WORD);
x = gen_rtx_SET (stack_pointer_rtx, x);
add_reg_note (insn, REG_FRAME_RELATED_EXPR, x);
m->fs.sp_offset -= UNITS_PER_WORD;
}
else
{
- rtx x = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (offset));
+ rtx x = plus_constant (Pmode, stack_pointer_rtx, offset);
x = gen_rtx_SET (sr->reg, gen_rtx_MEM (word_mode, x));
emit_insn (x);
}
rtx addr, mem;
if (offset)
- addr = gen_rtx_PLUS (Pmode, frame_reg, GEN_INT (offset));
+ addr = plus_constant (Pmode, frame_reg, offset);
mem = gen_frame_mem (GET_MODE (reg), offset ? addr : frame_reg);
return gen_rtx_SET (store ? mem : reg, store ? reg : mem);
}
m->fs.cfa_offset -= UNITS_PER_WORD;
add_reg_note (insn, REG_CFA_DEF_CFA,
- gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (m->fs.cfa_offset)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ m->fs.cfa_offset));
RTX_FRAME_RELATED_P (insn) = 1;
}
}
gcc_assert (m->fs.fp_valid);
gcc_assert (m->fs.cfa_reg == hard_frame_pointer_rtx);
- tmp = gen_rtx_PLUS (DImode, rbp, GEN_INT (8));
+ tmp = plus_constant (DImode, rbp, 8);
RTVEC_ELT (v, vi++) = gen_rtx_SET (stack_pointer_rtx, tmp);
RTVEC_ELT (v, vi++) = gen_rtx_SET (rbp, gen_rtx_MEM (DImode, rbp));
tmp = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode));
gcc_assert (m->fs.sp_valid);
r10 = gen_rtx_REG (DImode, R10_REG);
- tmp = gen_rtx_PLUS (Pmode, rsi, GEN_INT (stub_ptr_offset));
+ tmp = plus_constant (Pmode, rsi, stub_ptr_offset);
emit_insn (gen_rtx_SET (r10, tmp));
RTVEC_ELT (v, vi++) = gen_rtx_SET (stack_pointer_rtx, r10);
insn = emit_insn (gen_rtx_SET
(stack_pointer_rtx,
- gen_rtx_PLUS (Pmode,
- crtl->drap_reg,
- GEN_INT (-param_ptr_offset))));
+ plus_constant (Pmode, crtl->drap_reg,
+ -param_ptr_offset)));
m->fs.cfa_reg = stack_pointer_rtx;
m->fs.cfa_offset = param_ptr_offset;
m->fs.sp_offset = param_ptr_offset;
m->fs.realigned = false;
add_reg_note (insn, REG_CFA_DEF_CFA,
- gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (param_ptr_offset)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ param_ptr_offset));
RTX_FRAME_RELATED_P (insn) = 1;
if (!call_used_or_fixed_reg_p (REGNO (crtl->drap_reg)))
*/
words = TARGET_64BIT ? 3 : 5;
emit_insn (gen_rtx_SET (scratch_reg,
- gen_rtx_PLUS (Pmode, frame_reg,
- GEN_INT (words * UNITS_PER_WORD))));
+ plus_constant (Pmode, frame_reg,
+ words * UNITS_PER_WORD)));
varargs_label = gen_label_rtx ();
emit_jump_insn (gen_jump (varargs_label));
if (cfun->machine->split_stack_varargs_pointer != NULL_RTX)
{
emit_insn (gen_rtx_SET (scratch_reg,
- gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (UNITS_PER_WORD))));
+ plus_constant (Pmode, stack_pointer_rtx,
+ UNITS_PER_WORD)));
emit_label (varargs_label);
LABEL_NUSES (varargs_label) = 1;
split_double_mode (DImode, &operands[1], 1, &operands[2], &operands[3]);
operands[1] = gen_lowpart (DImode, operands[2]);
- operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (4)));
+ operands[2] = gen_rtx_MEM (SImode,
+ plus_constant (Pmode, stack_pointer_rtx, 4));
})
(define_insn "*pushsi2"
if (!ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (operands[3])))
FAIL;
- rtx adjust = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[1])));
+ int piece_size = GET_MODE_SIZE (GET_MODE (operands[1]));
/* If .md ever supports :P for Pmode, these can be directly
in the pattern above. */
- operands[5] = gen_rtx_PLUS (Pmode, operands[0], adjust);
- operands[6] = gen_rtx_PLUS (Pmode, operands[2], adjust);
+ operands[5] = plus_constant (Pmode, operands[0], piece_size);
+ operands[6] = plus_constant (Pmode, operands[2], piece_size);
/* Can't use this if the user has appropriated esi or edi. */
if ((TARGET_SINGLE_STRINGOP || optimize_insn_for_size_p ())
/* If .md ever supports :P for Pmode, this can be directly
in the pattern above. */
- operands[3] = gen_rtx_PLUS (Pmode, operands[0],
- GEN_INT (GET_MODE_SIZE (GET_MODE
- (operands[2]))));
+ operands[3] = plus_constant (Pmode, operands[0],
+ GET_MODE_SIZE (GET_MODE (operands[2])));
+
/* Can't use this if the user has appropriated eax or edi. */
if ((TARGET_SINGLE_STRINGOP || optimize_insn_for_size_p ())
&& !(fixed_regs[AX_REG] || fixed_regs[DI_REG]))