m68k.c (output_scc_di): Use cmpw #0 instead of tstl when testing address registers...
authorKamil Iskra <iskra@student.uci.agh.edu.pl>
Mon, 6 Jul 1998 21:23:56 +0000 (23:23 +0200)
committerJeff Law <law@gcc.gnu.org>
Mon, 6 Jul 1998 21:23:56 +0000 (15:23 -0600)
        * m68k.c (output_scc_di): Use cmpw #0 instead of tstl when
        testing address registers on the 68000.

From-SVN: r20963

gcc/ChangeLog
gcc/config/m68k/m68k.c

index 1aac5d0718aa946fd0bcb205580a2a084adf7b0c..073aadb91505854834238b7d37795345c10a6b9c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul  6 22:21:56 1998  Kamil Iskra  <iskra@student.uci.agh.edu.pl>
+
+       * m68k.c (output_scc_di): Use cmpw #0 instead of tstl when
+       testing address registers on the 68000.
+
 Mon Jul  6 22:17:19 1998  Alasdair Baird       <alasdair@wildcat.demon.co.uk>
 
        * jump.c (jump_optimize) Check for CONST_INT before using INTVAL.
index 164cf6bc223569573247efca662f390d199426a0..e6a3caba104a300b95652d0e6c4a18d71e9e88a9 100644 (file)
@@ -1059,11 +1059,25 @@ output_scc_di(op, operand1, operand2, dest)
     output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands);
 #endif
 #endif
-  else
+  else if (TARGET_68020 || TARGET_5200)
 #ifdef MOTOROLA
     output_asm_insn ("tst%.l %0\n\tjbne %l4\n\ttst%.l %1", loperands);
 #else
     output_asm_insn ("tst%.l %0\n\tjne %l4\n\ttst%.l %1", loperands);
+#endif
+  else
+#ifdef MOTOROLA
+#ifdef SGS_CMP_ORDER
+    output_asm_insn ("cmp%.w %0,%#0\n\tjbne %l4\n\tcmp%.w %1,%#0", loperands);
+#else
+    output_asm_insn ("cmp%.w %#0,%0\n\tjbne %l4\n\tcmp%.w %#0,%1", loperands);
+#endif
+#else
+#ifdef SGS_CMP_ORDER
+    output_asm_insn ("cmp%.w %0,%#0\n\tjne %l4\n\tcmp%.w %1,%#0", loperands);
+#else
+    output_asm_insn ("cmp%.w %#0,%0\n\tjne %l4\n\tcmp%.w %#0,%1", loperands);
+#endif
 #endif
   loperands[5] = dest;