aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-09-28 14:04:29 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-09-28 14:04:29 -0400
commitd9832fd253ac2556b41919567daba72470f4043a (patch)
tree3f990f3fae57a568ec73ef9039211170a67a8ee5 /gcc
parent241fa1a22111e9cc42ef734119d1ff727b905253 (diff)
downloadgcc-d9832fd253ac2556b41919567daba72470f4043a.zip
gcc-d9832fd253ac2556b41919567daba72470f4043a.tar.gz
gcc-d9832fd253ac2556b41919567daba72470f4043a.tar.bz2
(output_scc_di): Swap operands when needed.
From-SVN: r10408
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/m68k/m68k.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 19897a9..2b5b392 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -706,7 +706,19 @@ output_scc_di(op, operand1, operand2, dest)
rtx dest;
{
rtx loperands[7];
+ enum rtx_code op_code = GET_CODE (op);
+ /* The m68k cmp.l instruction requires operand1 to be a reg as used
+ below. Swap the operands and change the op if these requirements
+ are not fulfilled. */
+ if (GET_CODE (operand2) == REG && GET_CODE (operand1) != REG)
+ {
+ rtx tmp = operand1;
+
+ operand1 = operand2;
+ operand2 = tmp;
+ op_code = swap_condition (op_code);
+ }
loperands[0] = operand1;
if (GET_CODE (operand1) == REG)
loperands[1] = gen_rtx (REG, SImode, REGNO (operand1) + 1);
@@ -743,7 +755,7 @@ output_scc_di(op, operand1, operand2, dest)
#endif
loperands[5] = dest;
- switch (GET_CODE (op))
+ switch (op_code)
{
case EQ:
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",