Align code at the start of loops and after branches.
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 4 Jun 1996 18:13:21 +0000 (18:13 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 4 Jun 1996 18:13:21 +0000 (18:13 +0000)
Align code at the start of loops and after branches.  Don't accept
negative zero in fp_zero_operand.

From-SVN: r12155

gcc/config/sh/sh.c

index 3bad072d6124a0883c383b1462cffd8ca168801b..d3f1e0f03ad354a51d4dcf5212142a5e438c1601 100644 (file)
@@ -552,8 +552,16 @@ output_branch (logic, insn, operands)
      rtx *operands;
 {
   int label = lf++;
+  int length = get_attr_length (insn);
+  int adjusted_length;
 
-  switch (get_attr_length (insn))
+  /* Undo the effects of ADJUST_INSN_LENGTH, so that we get the real
+     length.  */
+  adjusted_length = length;
+  ADJUST_INSN_LENGTH (insn, adjusted_length);
+  length -= (adjusted_length - length);
+
+  switch (length)
     {
     case 2:
       /* A branch with an unfilled delay slot.  */
@@ -626,7 +634,8 @@ output_branch (logic, insn, operands)
       }
       return "";
     }
-  return "bad";
+
+  abort ();
 }
 \f
 /* Output to FILE the start of the assembler file.  */
@@ -1206,6 +1215,27 @@ find_barrier (from)
       hi_limit = 500;
     }
 
+  /* If not optimizing for space, then the constant pool will be
+     aligned to a 4 to 16 byte boundary.  We must make room for that
+     alignment that by reducing the limits.
+     ??? It would be better to not align the constant pool, but
+     ASM_OUTPUT_ALIGN_CODE does not make any provision for basing the
+     alignment on the instruction.  */
+
+  if (! TARGET_SMALLCODE)
+    {
+      if (TARGET_SH3 || TARGET_SH3E)
+       {
+         si_limit -= 14;
+         hi_limit -= 14;
+       }
+      else
+       {
+         si_limit -= 2;
+         hi_limit -= 2;
+       }
+    }
+
   while (from && count_si < si_limit && count_hi < hi_limit)
     {
       int inc = get_attr_length (from);
@@ -2228,7 +2258,7 @@ fp_zero_operand (op)
     return 0;
 
   REAL_VALUE_FROM_CONST_DOUBLE (r, op);
-  return REAL_VALUES_EQUAL (r, dconst0);
+  return REAL_VALUES_EQUAL (r, dconst0) && ! REAL_VALUE_MINUS_ZERO (r);
 }
 
 /* Nonzero if OP is a floating point value with value 1.0.  */