avr.md (ashrqi3): Split alternative "n" into its remaining parts C03...
authorGeorg-Johann Lay <avr@gjlay.de>
Tue, 27 Sep 2011 08:08:16 +0000 (08:08 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Tue, 27 Sep 2011 08:08:16 +0000 (08:08 +0000)
* config/avr/avr.md (ashrqi3): Split alternative "n"
into its remaining parts C03, C04, C05, C06, C07 and describe
impact in CC by attribute "cc" appropriately.
* config/avr/avr.c (notice_update_cc): Clean-up: Don't patch CC0
by digging RTX.

From-SVN: r179241

gcc/ChangeLog
gcc/config/avr/avr.c
gcc/config/avr/avr.md

index 52c2e9b1a6567513a75c76903bc39a946d2b845f..27f31c7c2486dc212bf51d699951c92d7c430b05 100644 (file)
@@ -1,3 +1,11 @@
+2011-09-27  Georg-Johann Lay  <avr@gjlay.de>
+
+       * config/avr/avr.md (ashrqi3): Split alternative "n"
+       into its remaining parts C03, C04, C05, C06, C07 and describe
+       impact in CC by attribute "cc" appropriately.
+       * config/avr/avr.c (notice_update_cc): Clean-up: Don't patch CC0
+       by digging RTX.
+
 2011-09-27  Jakub Jelinek  <jakub@redhat.com>
 
        * rtl.h (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
index 8675845fb9dad871029f501ab8c47ec1642721a8..5ffa7fc2a17f3bf38b12b70c967dca9501e48d47 100644 (file)
@@ -1574,26 +1574,6 @@ notice_update_cc (rtx body ATTRIBUTE_UNUSED, rtx insn)
     case CC_CLOBBER:
       /* Insn doesn't leave CC in a usable state.  */
       CC_STATUS_INIT;
-
-      /* Correct CC for the ashrqi3 with the shift count as CONST_INT < 6 */
-      set = single_set (insn);
-      if (set)
-       {
-         rtx src = SET_SRC (set);
-         
-         if (GET_CODE (src) == ASHIFTRT
-             && GET_MODE (src) == QImode)
-           {
-             rtx x = XEXP (src, 1);
-
-             if (CONST_INT_P (x)
-                 && IN_RANGE (INTVAL (x), 1, 5))
-               {
-                 cc_status.value1 = SET_DEST (set);
-                 cc_status.flags |= CC_OVERFLOW_UNUSABLE;
-               }
-           }
-       }
       break;
     }
 }
index 790f696748244dcb2ee92ca8e8a8b57b40ee94bd..3b1800d3fb07eb4999ff27c27f3b35281f512ab5 100644 (file)
 ;; arithmetic shift right
 
 (define_insn "ashrqi3"
-  [(set (match_operand:QI 0 "register_operand" "=r,r,r,r,r,r")
-       (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0,0")
-                    (match_operand:QI 2 "general_operand"  "r,L,P,K,n,Qm")))]
+  [(set (match_operand:QI 0 "register_operand"             "=r,r,r,r,r          ,r      ,r")
+        (ashiftrt:QI (match_operand:QI 1 "register_operand" "0,0,0,0,0          ,0      ,0")
+                     (match_operand:QI 2 "general_operand"  "r,L,P,K,C03 C04 C05,C06 C07,Qm")))]
   ""
   "* return ashrqi3_out (insn, operands, NULL);"
-  [(set_attr "length" "5,0,1,2,5,9")
+  [(set_attr "length" "5,0,1,2,5,4,9")
    (set_attr "adjust_len" "ashrqi")
-   (set_attr "cc" "clobber,none,clobber,clobber,clobber,clobber")])
+   (set_attr "cc" "clobber,none,set_czn,set_czn,set_czn,clobber,clobber")])
 
 (define_insn "ashrhi3"
   [(set (match_operand:HI 0 "register_operand"             "=r,r,r,r,r,r,r")