diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2020-12-13 20:46:17 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2020-12-13 20:46:17 +0000 |
commit | 2c3d487a9a8af00c0c462cd4e1a112804b9cc156 (patch) | |
tree | d43e662f8ae02395a8927a5c06623dcae4b5bdf0 | |
parent | d9ec27c1c385d21ee47db8be4168dbc45ebe6e11 (diff) | |
download | gcc-2c3d487a9a8af00c0c462cd4e1a112804b9cc156.zip gcc-2c3d487a9a8af00c0c462cd4e1a112804b9cc156.tar.gz gcc-2c3d487a9a8af00c0c462cd4e1a112804b9cc156.tar.bz2 |
VAX: Unify push operation selection
Avoid the possibility of code discrepancies like one fixed with the
previous change and improve the structure of code by selecting between
push and non-push operations in a single place in `vax_output_int_move'.
The PUSHAB/MOVAB address moves are never actually produced from this
code as the SImode invocation of this function is guarded with the
`nonsymbolic_operand' predicate, but let's not mess up with this code
too much on this occasion and keep the piece in place.
* config/vax/vax.c (vax_output_int_move): Unify push operation
selection.
-rw-r--r-- | gcc/config/vax/vax.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 7c0adac..f5968d6 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -1235,6 +1235,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, { rtx hi[3], lo[3]; const char *pattern_hi, *pattern_lo; + bool push_p; switch (mode) { @@ -1345,19 +1346,13 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, return "movq %1,%0"; case E_SImode: + push_p = push_operand (operands[0], SImode); + if (symbolic_operand (operands[1], SImode)) - { - if (push_operand (operands[0], SImode)) - return "pushab %a1"; - return "movab %a1,%0"; - } + return push_p ? "pushab %a1" : "movab %a1,%0"; if (operands[1] == const0_rtx) - { - if (push_operand (operands[0], SImode)) - return "pushl %1"; - return "clrl %0"; - } + return push_p ? "pushl %1" : "clrl %0"; if (CONST_INT_P (operands[1]) && (unsigned HOST_WIDE_INT) INTVAL (operands[1]) >= 64) @@ -1383,9 +1378,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, if (i >= -0x8000 && i < 0) return "cvtwl %1,%0"; } - if (push_operand (operands[0], SImode)) - return "pushl %1"; - return "movl %1,%0"; + return push_p ? "pushl %1" : "movl %1,%0"; case E_HImode: if (CONST_INT_P (operands[1])) |