This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: m68k: remove NO_ADDSUB_Q dependent code


Get rid of all blocks of code depending on the NO_ADDSUB_Q
preprocessor symbol, which wasn't been defined anywhere in
the gcc since 2.95.3 and possibly before.

Bootstraps with m68k-elf (except for pre-existing problems on
multilib build for cpu32).


2003-07-06  Bernardo Innocenti  <bernie@develer.com>

        * config/m68k/m68k.c: Strip away code depending on NO_ADDSUB_Q definition.
        * config/m68k/m68k.md: Likewise.


diff -u -p -r1.91 m68k.c
--- ./gcc/config/m68k/m68k.c	5 Jul 2003 07:38:12 -0000	1.91
+++ ./gcc/config/m68k/m68k.c	6 Jul 2003 08:05:52 -0000
@@ -345,7 +345,6 @@ m68k_output_function_prologue (stream, s
     {
       if (fsize + 4 < 0x8000)
 	{
-#ifndef NO_ADDSUB_Q
 	  if (fsize + 4 <= 8)
 	    {
 	      if (!TARGET_5200)
@@ -381,9 +380,7 @@ m68k_output_function_prologue (stream, s
 			   fsize + 4 - 8);
 #endif
 	    }
-	  else 
-#endif /* not NO_ADDSUB_Q */
-	  if (TARGET_68040)
+	  else if (TARGET_68040)
 	    {
 	      /* Adding negative number is faster on the 68040.  */
 	      /* asm_fprintf() cannot handle %.  */
@@ -801,7 +798,6 @@ m68k_output_function_epilogue (stream, s
 	     reg_names[FRAME_POINTER_REGNUM]);
   else if (fsize)
     {
-#ifndef NO_ADDSUB_Q
       if (fsize + 4 <= 8) 
 	{
 	  if (!TARGET_5200)
@@ -834,9 +830,7 @@ m68k_output_function_epilogue (stream, s
 		       fsize + 4 - 8);
 #endif
 	}
-      else
-#endif /* not NO_ADDSUB_Q */
-      if (fsize + 4 < 0x8000)
+      else if (fsize + 4 < 0x8000)
 	{
 	  if (TARGET_68040)
 	    { 
@@ -1790,11 +1784,7 @@ output_move_qimode (operands)
       if (!reg_mentioned_p (stack_pointer_rtx, operands[1]))
 	{
 	  xoperands[3] = stack_pointer_rtx;
-#ifndef NO_ADDSUB_Q
 	  output_asm_insn ("subq%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
-#else
-	  output_asm_insn ("sub%.l %#2,%3\n\tmove%.b %1,%2", xoperands);
-#endif
 	}
       else
 	output_asm_insn ("move%.b %1,%-\n\tmove%.b %@,%2", xoperands);
@@ -2299,7 +2289,6 @@ output_addsi3 (operands)
     }
   if (GET_CODE (operands[2]) == CONST_INT)
     {
-#ifndef NO_ADDSUB_Q
       if (INTVAL (operands[2]) > 0
 	  && INTVAL (operands[2]) <= 8)
 	return "addq%.l %2,%0";
@@ -2327,7 +2316,6 @@ output_addsi3 (operands)
 	      return "subq%.l %#8,%0\n\tsubq%.l %2,%0";
 	    }
 	}
-#endif
       if (ADDRESS_REG_P (operands[0])
 	  && INTVAL (operands[2]) >= -0x8000
 	  && INTVAL (operands[2]) < 0x8000)
diff -u -p -r1.60 m68k.md
--- ./gcc/config/m68k/m68k.md	5 Jul 2003 07:33:06 -0000	1.60
+++ ./gcc/config/m68k/m68k.md	6 Jul 2003 08:06:11 -0000
@@ -1953,21 +1953,11 @@
 	  if (GET_CODE (operands[1]) == CONST_INT)
 	    {
 	      if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
-		{
-#ifdef NO_ADDSUB_Q
-		  return \"add%.l %1,%R0\;addx%.l %3,%0\";
-#else
-		  return \"addq%.l %1,%R0\;addx%.l %3,%0\";
-#endif
-		}
+		return \"addq%.l %1,%R0\;addx%.l %3,%0\";
 	      else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
 		{
 		  operands[1] = GEN_INT (-INTVAL (operands[1]));
-#ifdef NO_ADDSUB_Q
-		  return \"sub%.l %1,%R0\;subx%.l %3,%0\";
-#else
 		  return \"subq%.l %1,%R0\;subx%.l %3,%0\";
-#endif
 		}
 	    }
 	  return \"add%.l %1,%R0\;addx%.l %3,%0\";
@@ -2023,11 +2013,7 @@
 #else
   output_asm_insn (\"jpl %l3\", operands);
 #endif
-#ifndef NO_ADDSUB_Q
   output_asm_insn (\"addq%.l %#1,%2\", operands);
-#else
-  output_asm_insn (\"add%.l %#1,%2\", operands);
-#endif
   (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
 				CODE_LABEL_NUMBER (operands[3]));
   return \"\";
@@ -2077,7 +2063,6 @@
 {
   if (GET_CODE (operands[2]) == CONST_INT)
     {
-#ifndef NO_ADDSUB_Q
       /* If the constant would be a negative number when interpreted as
 	 HImode, make it negative.  This is usually, but not always, done
 	 elsewhere in the compiler.  First check for constants out of range,
@@ -2113,7 +2098,6 @@
 	      return \"subq%.w %#8,%0\;subq%.w %2,%0\";
 	    }
 	}
-#endif
       if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
 #ifdef MOTOROLA  
 	    return \"lea (%c2,%0),%0\";
@@ -2139,7 +2123,6 @@
 {
   if (GET_CODE (operands[1]) == CONST_INT)
     {
-#ifndef NO_ADDSUB_Q
       /* If the constant would be a negative number when interpreted as
 	 HImode, make it negative.  This is usually, but not always, done
 	 elsewhere in the compiler.  First check for constants out of range,
@@ -2175,7 +2158,6 @@
 	      return \"subq%.w %#8,%0\;subq%.w %1,%0\";
 	    }
 	}
-#endif
       if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
 #ifdef MOTOROLA  
 	    return \"lea (%c1,%0),%0\";
@@ -2195,7 +2177,6 @@
 {
   if (GET_CODE (operands[1]) == CONST_INT)
     {
-#ifndef NO_ADDSUB_Q
       /* If the constant would be a negative number when interpreted as
 	 HImode, make it negative.  This is usually, but not always, done
 	 elsewhere in the compiler.  First check for constants out of range,
@@ -2231,7 +2212,6 @@
 	      return \"subq%.w %#8,%0\;subq%.w %1,%0\";
 	    }
 	}
-#endif
       if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
 #ifdef MOTOROLA  
 	    return \"lea (%c1,%0),%0\";
@@ -2249,7 +2229,6 @@
   "!TARGET_5200"
   "*
 {
-#ifndef NO_ADDSUB_Q
   if (GET_CODE (operands[2]) == CONST_INT)
     {
       if (INTVAL (operands[2]) >= 128)
@@ -2264,7 +2243,6 @@
 	 return \"subq%.b %2,%0\";
        }
     }
-#endif
   return \"add%.b %2,%0\";
 }")
 
@@ -2275,7 +2253,6 @@
   "!TARGET_5200"
   "*
 {
-#ifndef NO_ADDSUB_Q
   if (GET_CODE (operands[1]) == CONST_INT)
     {
       if (INTVAL (operands[1]) >= 128)
@@ -2290,7 +2267,6 @@
 	 return \"subq%.b %1,%0\";
        }
     }
-#endif
   return \"add%.b %1,%0\";
 }")
 
@@ -2301,7 +2277,6 @@
   "!TARGET_5200"
   "*
 {
-#ifndef NO_ADDSUB_Q
   if (GET_CODE (operands[1]) == CONST_INT)
     {
       if (INTVAL (operands[1]) >= 128)
@@ -2316,7 +2291,6 @@
 	 return \"subq%.b %1,%0\";
        }
     }
-#endif
   return \"add%.b %1,%0\";
 }")
 
@@ -2483,21 +2457,11 @@
 	  if (GET_CODE (operands[1]) == CONST_INT)
 	    {
 	      if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)
-		{
-#ifdef NO_ADDSUB_Q
-		  return \"sub%.l %1,%R0\;subx%.l %3,%0\";
-#else
-		  return \"subq%.l %1,%R0\;subx%.l %3,%0\";
-#endif
-		}
+		return \"subq%.l %1,%R0\;subx%.l %3,%0\";
 	      else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
 		{
 		  operands[1] = GEN_INT (-INTVAL (operands[1]));
-#ifdef NO_ADDSUB_Q
-		  return \"add%.l %1,%R0\;addx%.l %3,%0\";
-#else
 		  return \"addq%.l %1,%R0\;addx%.l %3,%0\";
-#endif
 		}
 	    }
 	  return \"sub%.l %1,%R0\;subx%.l %3,%0\";
@@ -6590,22 +6554,14 @@
   if (GET_CODE (operands[0]) == MEM)
     {
 #ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
-      return \"sub%.w %#1,%0\;jbcc %l1\";
-#else
       return \"subq%.w %#1,%0\;jbcc %l1\";
-#endif
 #else /* not MOTOROLA */
       return \"subqw %#1,%0\;jcc %l1\";
 #endif
     }
 #ifdef MOTOROLA
 #ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
-  return \"sub%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
-#else
   return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
-#endif
 #else /* not SGS_CMP_ORDER */
   return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\";
 #endif
@@ -6629,23 +6585,12 @@
 {
   CC_STATUS_INIT;
 #ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
-  if (DATA_REG_P (operands[0]))
-    return \"dbra %0,%l1\;clr%.w %0\;sub%.l %#1,%0\;jbcc %l1\";
-  if (GET_CODE (operands[0]) == MEM)
-    return \"sub%.l %#1,%0\;jbcc %l1\";
-#else
   if (DATA_REG_P (operands[0]))
     return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
   if (GET_CODE (operands[0]) == MEM)
     return \"subq%.l %#1,%0\;jbcc %l1\";
-#endif /* NO_ADDSUB_Q */
 #ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
-  return \"sub.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#else
   return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#endif
 #else /* not SGS_CMP_ORDER */
   return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
 #endif /* not SGS_CMP_ORDER */
@@ -6676,23 +6621,12 @@
 {
   CC_STATUS_INIT;
 #ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
-  if (DATA_REG_P (operands[0]))
-    return \"dbra %0,%l1\";
-  if (GET_CODE (operands[0]) == MEM)
-    return \"sub%.w %#1,%0\;jbcc %l1\";
-#else
   if (DATA_REG_P (operands[0]))
     return \"dbra %0,%l1\";
   if (GET_CODE (operands[0]) == MEM)
     return \"subq%.w %#1,%0\;jbcc %l1\";
-#endif
 #ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
-  return \"sub.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
-#else
   return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
-#endif
 #else /* not SGS_CMP_ORDER */
   return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
 #endif /* not SGS_CMP_ORDER */
@@ -6735,23 +6669,12 @@
 {
   CC_STATUS_INIT;
 #ifdef MOTOROLA
-#ifdef NO_ADDSUB_Q
-  if (DATA_REG_P (operands[0]))
-    return \"dbra %0,%l1\;clr%.w %0\;sub%.l %#1,%0\;jbcc %l1\";
-  if (GET_CODE (operands[0]) == MEM)
-    return \"sub%.l %#1,%0\;jbcc %l1\";
-#else
   if (DATA_REG_P (operands[0]))
     return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
   if (GET_CODE (operands[0]) == MEM)
     return \"subq%.l %#1,%0\;jbcc %l1\";
-#endif
 #ifdef SGS_CMP_ORDER
-#ifdef NO_ADDSUB_Q
-  return \"sub.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#else
   return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
-#endif
 #else /* not SGS_CMP_ORDER */
   return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
 #endif /* not SGS_CMP_ORDER */
@@ -7079,7 +7002,6 @@
       rtx xoperands[2];
       xoperands[0] = stack_pointer_rtx;
       xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
-#ifndef NO_ADDSUB_Q
       if (INTVAL (xoperands[1]) <= 8)
 	{
 	  if (!TARGET_5200)
@@ -7092,9 +7014,7 @@
 	  xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
 	  output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
 	}
-      else
-#endif
-        if (INTVAL (xoperands[1]) <= 0x7FFF)
+      else if (INTVAL (xoperands[1]) <= 0x7FFF)
         {
 	  if (TARGET_68040)
 	    output_asm_insn (\"add%.w %1,%0\", xoperands);
@@ -7129,7 +7049,6 @@
       rtx xoperands[2];
       xoperands[0] = stack_pointer_rtx;
       xoperands[1] = GEN_INT (INTVAL (operands[0]) - 4);
-#ifndef NO_ADDSUB_Q
       if (INTVAL (xoperands[1]) <= 8)
 	{
 	  if (!TARGET_5200)
@@ -7142,9 +7061,7 @@
 	  xoperands[1] = GEN_INT (INTVAL (xoperands[1]) - 8);
 	  output_asm_insn (\"addq%.w %#8,%0\;addq%.w %1,%0\", xoperands);
 	}
-      else
-#endif
-        if (INTVAL (xoperands[1]) <= 0x7FFF)
+      else if (INTVAL (xoperands[1]) <= 0x7FFF)
         {
 	  if (TARGET_68040)
 	    output_asm_insn (\"add%.w %1,%0\", xoperands);

-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/

Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]