(alpha_emit_set_const_1): Renamed from alpha_emit_set_const and static.
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 13 Apr 1996 11:55:30 +0000 (07:55 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 13 Apr 1996 11:55:30 +0000 (07:55 -0400)
Remove change of Nov 26; again use normal mechanism for SImode.
(alpha_emit_set_const): New function.

From-SVN: r11752

gcc/config/alpha/alpha.c

index 306f1bf4ac721de4fb691f28dc52cfa59a652ecd..3eaf8e461a4c8a7f49312ec831f35ce6c39208d8 100644 (file)
@@ -84,6 +84,8 @@ extern int rtx_equal_function_value_matters;
 
 /* Declarations of static functions.  */
 static void alpha_set_memflags_1  PROTO((rtx, int, int, int));
+static rtx alpha_emit_set_const_1 PROTO((rtx, enum machine_mode,
+                                        HOST_WIDE_INT, int));
 static void add_long_const     PROTO((FILE *, HOST_WIDE_INT, int, int, int));
 \f
 /* Parse target option strings. */
@@ -787,6 +789,26 @@ alpha_emit_set_const (target, mode, c, n)
      enum machine_mode mode;
      HOST_WIDE_INT c;
      int n;
+{
+  rtx pat;
+  int i;
+
+  /* Try 1 insn, then 2, then up to N. */
+  for (i = 1; i <= n; i++)
+    if ((pat = alpha_emit_set_const_1 (target, mode, c, i)) != 0)
+      return pat;
+
+  return 0;
+}
+
+/* Internal routine for the above to check for N or below insns.  */
+
+static rtx
+alpha_emit_set_const_1 (target, mode, c, n)
+     rtx target;
+     enum machine_mode mode;
+     HOST_WIDE_INT c;
+     int n;
 {
   HOST_WIDE_INT new = c;
   int i, bits;
@@ -832,12 +854,7 @@ alpha_emit_set_const (target, mode, c, n)
 
       if (c == low || (low == 0 && extra == 0))
        return copy_to_suggested_reg (GEN_INT (c), target, mode);
-      else if (n >= 2 + (extra != 0)
-              /* We can't do this when SImode if HIGH required adjustment.
-                 This is because the code relies on an implicit overflow
-                 which is invisible to the RTL.  We can thus get incorrect
-                 code if the two ldah instructions are combined.  */
-              && ! (mode == SImode && extra != 0))
+      else if (n >= 2 + (extra != 0))
        {
          temp = copy_to_suggested_reg (GEN_INT (low), subtarget, mode);