+2015-07-04 Sandra Loosemore <sandra@codesourcery.com>
+
+ * config/nios2/nios2.c (save_reg, restore_reg): Use plus_constant.
+ Use rtx_insn * instead of rtx.
+ (nios2_emit_add_constant): Use rtx_insn * instead of rtx.
+ (nios2_expand_prologue, nios2_expand_epilogue): Likewise.
+ (nios2_call_tls_get_addr): Likewise.
+ (nios2_emit_expensive_div): Likewise.
+ (nios2_emit_move_sequence): Change return type to bool.
+ * config/nios2/nios2-protos.h (nios2_emit_move_sequence):
+ Change return type to bool.
+
2015-07-04 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR target/66747
save_reg (int regno, unsigned offset)
{
rtx reg = gen_rtx_REG (SImode, regno);
- rtx addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- gen_int_mode (offset, Pmode));
- rtx insn = emit_move_insn (gen_frame_mem (Pmode, addr), reg);
+ rtx addr = plus_constant (Pmode, stack_pointer_rtx, offset, false);
+ rtx_insn *insn = emit_move_insn (gen_frame_mem (Pmode, addr), reg);
RTX_FRAME_RELATED_P (insn) = 1;
}
restore_reg (int regno, unsigned offset)
{
rtx reg = gen_rtx_REG (SImode, regno);
- rtx addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- gen_int_mode (offset, Pmode));
- rtx insn = emit_move_insn (reg, gen_frame_mem (Pmode, addr));
+ rtx addr = plus_constant (Pmode, stack_pointer_rtx, offset, false);
+ rtx_insn *insn = emit_move_insn (reg, gen_frame_mem (Pmode, addr));
/* Tag epilogue unwind note. */
add_reg_note (insn, REG_CFA_RESTORE, reg);
RTX_FRAME_RELATED_P (insn) = 1;
/* Temp regno used inside prologue/epilogue. */
#define TEMP_REG_NUM 8
-static rtx
+static rtx_insn *
nios2_emit_add_constant (rtx reg, HOST_WIDE_INT immed)
{
- rtx insn;
+ rtx_insn *insn;
if (SMALL_INT (immed))
insn = emit_insn (gen_add2_insn (reg, gen_int_mode (immed, Pmode)));
else
int total_frame_size, save_offset;
int sp_offset; /* offset from base_reg to final stack value. */
int save_regs_base; /* offset from base_reg to register save area. */
- rtx insn;
+ rtx_insn *insn;
total_frame_size = nios2_compute_frame_layout ();
void
nios2_expand_epilogue (bool sibcall_p)
{
- rtx insn, cfa_adj;
+ rtx_insn *insn;
+ rtx cfa_adj;
int total_frame_size;
int sp_adjust, save_offset;
unsigned int regno;
{
rtx arg = gen_rtx_REG (Pmode, FIRST_ARG_REGNO);
rtx ret = gen_rtx_REG (Pmode, FIRST_RETVAL_REGNO);
- rtx fn, insn;
+ rtx fn;
+ rtx_insn *insn;
if (!nios2_tls_symbol)
nios2_tls_symbol = init_one_libfunc ("__tls_get_addr");
rtx or_result, shift_left_result;
rtx lookup_value;
rtx_code_label *lab1, *lab3;
- rtx insns;
+ rtx_insn *insns;
rtx libfunc;
rtx final_result;
- rtx tmp;
+ rtx_insn *tmp;
rtx table;
/* It may look a little generic, but only SImode is supported for now. */
}
/* Main expander function for RTL moves. */
-int
+bool
nios2_emit_move_sequence (rtx *operands, machine_mode mode)
{
rtx to = operands[0];
operands[0] = to;
operands[1] = from;
- return 0;
+ return false;
}
/* The function with address *ADDR is being called. If the address