]> gcc.gnu.org Git - gcc.git/commitdiff
rs6000.c (rs6000_emit_set_const): Inline multi-instruction SImode constant.
authorDavid Edelsohn <edelsohn@gnu.org>
Mon, 19 Aug 2002 16:32:54 +0000 (16:32 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Mon, 19 Aug 2002 16:32:54 +0000 (12:32 -0400)
        * config/rs6000/rs6000.c (rs6000_emit_set_const): Inline
        multi-instruction SImode constant.  Add REG_EQUAL note.
        * config/rs6000/rs6000.md (movsi splitter): Use
        rs6000_emit_set_const.

From-SVN: r56439

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.md

index 8675cf07a274f29b7294f12b22230bc915ac7e68..8d3077e41e1c616068186f7304fc876725f8d7a6 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-19  David Edelsohn  <edelsohn@gnu.org>
+
+       * config/rs6000/rs6000.c (rs6000_emit_set_const): Inline
+       multi-instruction SImode constant.  Add REG_EQUAL note.
+       * config/rs6000/rs6000.md (movsi splitter): Use
+       rs6000_emit_set_const. 
+
 2002-08-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * tree-inline.c (initialize_inlined_parameters): Wrap variable in
index 5b69dd58a19b9f0a0a9f6b551647c0bc4ed8ecea..399608af5dbe2fc31ff4ae96793234223f3fd624 100644 (file)
@@ -2368,35 +2368,59 @@ rs6000_emit_set_const (dest, mode, source, n)
      enum machine_mode mode;
      int n ATTRIBUTE_UNUSED;
 {
+  rtx result, insn, set;
   HOST_WIDE_INT c0, c1;
 
-  if (mode == QImode || mode == HImode || mode == SImode)
+  if (mode == QImode || mode == HImode)
     {
       if (dest == NULL)
         dest = gen_reg_rtx (mode);
       emit_insn (gen_rtx_SET (VOIDmode, dest, source));
       return dest;
     }
-
-  if (GET_CODE (source) == CONST_INT)
+  else if (mode == SImode)
     {
-      c0 = INTVAL (source);
-      c1 = -(c0 < 0);
+      result = no_new_pseudos ? dest : gen_reg_rtx (SImode);
+
+      emit_insn (gen_rtx_SET (VOIDmode, result,
+                             GEN_INT (INTVAL (source)
+                                      & (~ (HOST_WIDE_INT) 0xffff))));
+      emit_insn (gen_rtx_SET (VOIDmode, dest,
+                             gen_rtx_IOR (SImode, result,
+                                          GEN_INT (INTVAL (source) & 0xffff))));
+      result = dest;
     }
-  else if (GET_CODE (source) == CONST_DOUBLE)
+  else if (mode == DImode)
     {
+      if (GET_CODE (source) == CONST_INT)
+       {
+         c0 = INTVAL (source);
+         c1 = -(c0 < 0);
+       }
+      else if (GET_CODE (source) == CONST_DOUBLE)
+       {
 #if HOST_BITS_PER_WIDE_INT >= 64
-      c0 = CONST_DOUBLE_LOW (source);
-      c1 = -(c0 < 0);
+         c0 = CONST_DOUBLE_LOW (source);
+         c1 = -(c0 < 0);
 #else
-      c0 = CONST_DOUBLE_LOW (source);
-      c1 = CONST_DOUBLE_HIGH (source);
+         c0 = CONST_DOUBLE_LOW (source);
+         c1 = CONST_DOUBLE_HIGH (source);
 #endif
+       }
+      else
+       abort ();
+
+      result = rs6000_emit_set_long_const (dest, c0, c1);
     }
   else
     abort ();
 
-  return rs6000_emit_set_long_const (dest, c0, c1);
+  insn = get_last_insn ();
+  set = single_set (insn);
+  if (! CONSTANT_P (SET_SRC (set)))
+    set_unique_reg_note (insn, REG_EQUAL, source);
+
+  return result;
 }
 
 /* Having failed to find a 3 insn sequence in rs6000_emit_set_const,
index 4a441e224477e7d1f4388a7571c1fdb4cc9cd7d9..c3ff213832ec5b8249783415e34349492168ae94 100644 (file)
        (ior:SI (match_dup 0)
                (match_dup 3)))]
   "
-{
-  operands[2] = GEN_INT (INTVAL (operands[1]) & (~ (HOST_WIDE_INT) 0xffff));
-  operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
+{ rtx tem = rs6000_emit_set_const (operands[0], SImode, operands[1], 2);
+
+  if (tem == operands[0])
+    DONE;
+  else
+    FAIL;
 }")
 
 (define_insn "*movsi_internal2"
This page took 0.116735 seconds and 5 git commands to generate.