OSDN Git Service

* config/rs6000/rs6000.c (rs6000_emit_set_long_const): Shorten
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Jan 2010 17:56:12 +0000 (17:56 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 9 Jan 2010 17:56:12 +0000 (17:56 +0000)
sequence for DImode constants >= 0x80000000UL <= 0xFFFFFFFFUL by
1 insn.
(num_insns_constant_wide): Adjust for that change.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155770 138bc75d-0d04-0410-961f-82ee72b054a4

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

index ea2df0a..73263cd 100644 (file)
@@ -1,3 +1,10 @@
+2010-01-09  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/rs6000/rs6000.c (rs6000_emit_set_long_const): Shorten
+       sequence for DImode constants >= 0x80000000UL <= 0xFFFFFFFFUL by
+       1 insn.
+       (num_insns_constant_wide): Adjust for that change.
+
 2010-01-09  Alexandre Oliva  <aoliva@redhat.com>
 
        PR debug/42631
index ee55fbb..48f43da 100644 (file)
@@ -3794,6 +3794,8 @@ num_insns_constant_wide (HOST_WIDE_INT value)
 
       if (low == 0)
        return num_insns_constant_wide (high) + 1;
+      else if (high == 0)
+       return num_insns_constant_wide (low) + 1;
       else
        return (num_insns_constant_wide (high)
                + num_insns_constant_wide (low) + 1);
@@ -6143,6 +6145,20 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2)
                            gen_rtx_IOR (DImode, copy_rtx (dest),
                                         GEN_INT (ud1)));
        }
+      else if (ud3 == 0 && ud4 == 0)
+       {
+         gcc_assert (ud2 & 0x8000);
+         emit_move_insn (dest, GEN_INT (((ud2 << 16) ^ 0x80000000)
+                                        - 0x80000000));
+         if (ud1 != 0)
+           emit_move_insn (copy_rtx (dest),
+                           gen_rtx_IOR (DImode, copy_rtx (dest),
+                                        GEN_INT (ud1)));
+         emit_move_insn (copy_rtx (dest),
+                         gen_rtx_ZERO_EXTEND (DImode,
+                                              gen_lowpart (SImode,
+                                                           copy_rtx (dest))));
+       }
       else if ((ud4 == 0xffff && (ud3 & 0x8000))
               || (ud4 == 0 && ! (ud3 & 0x8000)))
        {