* config/mn10300/mn10300.c (mn10300_split_and_operand_count):
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Sep 2011 10:58:10 +0000 (10:58 +0000)
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Sep 2011 10:58:10 +0000 (10:58 +0000)
Return a positive value to indicate that the bits at the
bottom of the register should be cleared.

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

gcc/ChangeLog
gcc/config/mn10300/mn10300.c

index aadfd7d..4ede8ce 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-09  Nick Clifton  <nickc@redhat.com>
+
+       * config/mn10300/mn10300.c (mn10300_split_and_operand_count):
+       Return a positive value to indicate that the bits at the
+       bottom of the register should be cleared.
+
 2011-09-09  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-operands.c (swap_tree_operands): Always adjust
index 2cd178a..b5f3933 100644 (file)
@@ -2878,6 +2878,23 @@ mn10300_match_ccmode (rtx insn, enum machine_mode cc_mode)
   return true;
 }
 
+/* This function is used to help split:
+   
+     (set (reg) (and (reg) (int)))
+     
+   into:
+   
+     (set (reg) (shift (reg) (int))
+     (set (reg) (shift (reg) (int))
+     
+   where the shitfs will be shorter than the "and" insn.
+
+   It returns the number of bits that should be shifted.  A positive
+   values means that the low bits are to be cleared (and hence the
+   shifts should be right followed by left) whereas a negative value
+   means that the high bits are to be cleared (left followed by right).
+   Zero is returned when it would not be economical to split the AND.  */
+
 int
 mn10300_split_and_operand_count (rtx op)
 {
@@ -2894,7 +2911,7 @@ mn10300_split_and_operand_count (rtx op)
         would be replacing 1 6-byte insn with 2 3-byte insns.  */
       if (count > (optimize_insn_for_speed_p () ? 2 : 4))
        return 0;
-      return -count;
+      return count;
     }
   else
     {