Commit f3222b79 by David Malcolm Committed by David Malcolm

emit_move et al return rtx_insn *

2014-08-19  David Malcolm  <dmalcolm@redhat.com>

	* expr.h (emit_move_insn): Strengthen return type from rtx to
	rtx_insn *.
	(emit_move_insn_1): Likewise.
	(emit_move_complex_push): Likewise.
	(emit_move_complex_parts): Likewise.

	* expr.c (emit_move_via_integer): Strengthen return type from rtx
	to rtx_insn *.  Replace use of NULL_RTX with NULL when working
	with insns.
	(emit_move_complex_push): Strengthen return type from rtx to
	rtx_insn *.
	(emit_move_complex): Likewise, also for local "ret".
	(emit_move_ccmode): Likewise.
	(emit_move_multi_word): Likewise for return type and locals
	"last_insn", "seq".
	(emit_move_insn_1): Likewise for return type and locals "result",
	"ret".
	(emit_move_insn): Likewise for return type and local "last_insn".
	(compress_float_constant): Likewise.

From-SVN: r214195
parent cd459bf8
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* expr.h (emit_move_insn): Strengthen return type from rtx to
rtx_insn *.
(emit_move_insn_1): Likewise.
(emit_move_complex_push): Likewise.
(emit_move_complex_parts): Likewise.
* expr.c (emit_move_via_integer): Strengthen return type from rtx
to rtx_insn *. Replace use of NULL_RTX with NULL when working
with insns.
(emit_move_complex_push): Strengthen return type from rtx to
rtx_insn *.
(emit_move_complex): Likewise, also for local "ret".
(emit_move_ccmode): Likewise.
(emit_move_multi_word): Likewise for return type and locals
"last_insn", "seq".
(emit_move_insn_1): Likewise for return type and locals "result",
"ret".
(emit_move_insn): Likewise for return type and local "last_insn".
(compress_float_constant): Likewise.
2014-08-19 David Malcolm <dmalcolm@redhat.com>
* emit-rtl.h (emit_copy_of_insn_after): Strengthen return type
from rtx to rtx_insn *.
......
......@@ -134,7 +134,7 @@ static void store_by_pieces_1 (struct store_by_pieces_d *, unsigned int);
static void store_by_pieces_2 (insn_gen_fn, machine_mode,
struct store_by_pieces_d *);
static tree clear_storage_libcall_fn (int);
static rtx compress_float_constant (rtx, rtx);
static rtx_insn *compress_float_constant (rtx, rtx);
static rtx get_subtarget (rtx);
static void store_constructor_field (rtx, unsigned HOST_WIDE_INT,
HOST_WIDE_INT, enum machine_mode,
......@@ -3159,7 +3159,7 @@ emit_move_change_mode (enum machine_mode new_mode,
an integer mode of the same size as MODE. Returns the instruction
emitted, or NULL if such a move could not be generated. */
static rtx
static rtx_insn *
emit_move_via_integer (enum machine_mode mode, rtx x, rtx y, bool force)
{
enum machine_mode imode;
......@@ -3168,19 +3168,19 @@ emit_move_via_integer (enum machine_mode mode, rtx x, rtx y, bool force)
/* There must exist a mode of the exact size we require. */
imode = int_mode_for_mode (mode);
if (imode == BLKmode)
return NULL_RTX;
return NULL;
/* The target must support moves in this mode. */
code = optab_handler (mov_optab, imode);
if (code == CODE_FOR_nothing)
return NULL_RTX;
return NULL;
x = emit_move_change_mode (imode, mode, x, force);
if (x == NULL_RTX)
return NULL_RTX;
return NULL;
y = emit_move_change_mode (imode, mode, y, force);
if (y == NULL_RTX)
return NULL_RTX;
return NULL;
return emit_insn (GEN_FCN (code) (x, y));
}
......@@ -3245,7 +3245,7 @@ emit_move_resolve_push (enum machine_mode mode, rtx x)
X is known to satisfy push_operand, and MODE is known to be complex.
Returns the last instruction emitted. */
rtx
rtx_insn *
emit_move_complex_push (enum machine_mode mode, rtx x, rtx y)
{
enum machine_mode submode = GET_MODE_INNER (mode);
......@@ -3288,7 +3288,7 @@ emit_move_complex_push (enum machine_mode mode, rtx x, rtx y)
/* A subroutine of emit_move_complex. Perform the move from Y to X
via two moves of the parts. Returns the last instruction emitted. */
rtx
rtx_insn *
emit_move_complex_parts (rtx x, rtx y)
{
/* Show the output dies here. This is necessary for SUBREGs
......@@ -3307,7 +3307,7 @@ emit_move_complex_parts (rtx x, rtx y)
/* A subroutine of emit_move_insn_1. Generate a move from Y into X.
MODE is known to be complex. Returns the last instruction emitted. */
static rtx
static rtx_insn *
emit_move_complex (enum machine_mode mode, rtx x, rtx y)
{
bool try_int;
......@@ -3347,7 +3347,7 @@ emit_move_complex (enum machine_mode mode, rtx x, rtx y)
if (try_int)
{
rtx ret;
rtx_insn *ret;
/* For memory to memory moves, optimal behavior can be had with the
existing block move logic. */
......@@ -3369,10 +3369,10 @@ emit_move_complex (enum machine_mode mode, rtx x, rtx y)
/* A subroutine of emit_move_insn_1. Generate a move from Y into X.
MODE is known to be MODE_CC. Returns the last instruction emitted. */
static rtx
static rtx_insn *
emit_move_ccmode (enum machine_mode mode, rtx x, rtx y)
{
rtx ret;
rtx_insn *ret;
/* Assume all MODE_CC modes are equivalent; if we have movcc, use it. */
if (mode != CCmode)
......@@ -3429,11 +3429,12 @@ undefined_operand_subword_p (const_rtx op, int i)
pattern. Note that you will get better code if you define such
patterns, even if they must turn into multiple assembler instructions. */
static rtx
static rtx_insn *
emit_move_multi_word (enum machine_mode mode, rtx x, rtx y)
{
rtx last_insn = 0;
rtx seq, inner;
rtx_insn *last_insn = 0;
rtx_insn *seq;
rtx inner;
bool need_clobber;
int i;
......@@ -3509,7 +3510,7 @@ emit_move_multi_word (enum machine_mode mode, rtx x, rtx y)
Called just like emit_move_insn, but assumes X and Y
are basically valid. */
rtx
rtx_insn *
emit_move_insn_1 (rtx x, rtx y)
{
enum machine_mode mode = GET_MODE (x);
......@@ -3528,7 +3529,7 @@ emit_move_insn_1 (rtx x, rtx y)
if (GET_MODE_CLASS (mode) == MODE_DECIMAL_FLOAT
|| ALL_FIXED_POINT_MODE_P (mode))
{
rtx result = emit_move_via_integer (mode, x, y, true);
rtx_insn *result = emit_move_via_integer (mode, x, y, true);
/* If we can't find an integer mode, use multi words. */
if (result)
......@@ -3546,7 +3547,7 @@ emit_move_insn_1 (rtx x, rtx y)
fits within a HOST_WIDE_INT. */
if (!CONSTANT_P (y) || GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
{
rtx ret = emit_move_via_integer (mode, x, y, lra_in_progress);
rtx_insn *ret = emit_move_via_integer (mode, x, y, lra_in_progress);
if (ret)
{
......@@ -3565,12 +3566,13 @@ emit_move_insn_1 (rtx x, rtx y)
Return the last instruction emitted. */
rtx
rtx_insn *
emit_move_insn (rtx x, rtx y)
{
enum machine_mode mode = GET_MODE (x);
rtx y_cst = NULL_RTX;
rtx last_insn, set;
rtx_insn *last_insn;
rtx set;
gcc_assert (mode != BLKmode
&& (GET_MODE (y) == mode || GET_MODE (y) == VOIDmode));
......@@ -3628,7 +3630,7 @@ emit_move_insn (rtx x, rtx y)
perform the extension directly from constant or memory, then emit the
move as an extension. */
static rtx
static rtx_insn *
compress_float_constant (rtx x, rtx y)
{
enum machine_mode dstmode = GET_MODE (x);
......@@ -3650,7 +3652,8 @@ compress_float_constant (rtx x, rtx y)
srcmode = GET_MODE_WIDER_MODE (srcmode))
{
enum insn_code ic;
rtx trunc_y, last_insn;
rtx trunc_y;
rtx_insn *last_insn;
/* Skip if the target can't extend this way. */
ic = can_extend_p (dstmode, srcmode, 0);
......@@ -3710,7 +3713,7 @@ compress_float_constant (rtx x, rtx y)
return last_insn;
}
return NULL_RTX;
return NULL;
}
/* Pushing data onto the stack. */
......
......@@ -402,13 +402,13 @@ extern rtx store_by_pieces (rtx, unsigned HOST_WIDE_INT,
void *, unsigned int, bool, int);
/* Emit insns to set X from Y. */
extern rtx emit_move_insn (rtx, rtx);
extern rtx_insn *emit_move_insn (rtx, rtx);
/* Emit insns to set X from Y, with no frills. */
extern rtx emit_move_insn_1 (rtx, rtx);
extern rtx_insn *emit_move_insn_1 (rtx, rtx);
extern rtx emit_move_complex_push (enum machine_mode, rtx, rtx);
extern rtx emit_move_complex_parts (rtx, rtx);
extern rtx_insn *emit_move_complex_push (enum machine_mode, rtx, rtx);
extern rtx_insn *emit_move_complex_parts (rtx, rtx);
extern rtx emit_move_resolve_push (enum machine_mode, rtx);
/* Push a block of length SIZE (perhaps variable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment