c4x.md (*andqi3_255_clobber,*andqi3_65535_clobber): New logical and patterns using...
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>
Sat, 17 Apr 1999 04:52:39 +0000 (04:52 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Sat, 17 Apr 1999 04:52:39 +0000 (04:52 +0000)
* config/c4x/c4x.md (*andqi3_255_clobber,*andqi3_65535_clobber):
New logical and patterns using C40 bit-field insert instructions.
(*lshrqi3_24_clobber,*ashrqi3_24_clobber,*lshrqi3_16_clobber,
*ashrqi3_16_clobber): New shift patterns using C40 bit-field insert
instructions.

From-SVN: r26513

gcc/ChangeLog
gcc/config/c4x/c4x.md

index d1b12a80fad00461cb8fe4aca8652de2dda95611..525e4b63f1872ee5d43b4e7f3104d035f8a8e0d1 100644 (file)
@@ -1,3 +1,11 @@
+Sat Apr 17 23:47:24 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       * config/c4x/c4x.md (*andqi3_255_clobber,*andqi3_65535_clobber):
+       New logical and patterns using C40 bit-field insert instructions.
+       (*lshrqi3_24_clobber,*ashrqi3_24_clobber,*lshrqi3_16_clobber,
+       *ashrqi3_16_clobber): New shift patterns using C40 bit-field insert
+       instructions.
+       
 1999-04-16 22:44 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
 
        * system.h: Always prototype abort.  Prototype fatal.  Define
index 55c85d977dbfb96ce6a6812c88854c6d93dd2290..e7e132400d560ee6ab450f771b2622e4e37c5558 100644 (file)
@@ -1,4 +1,4 @@
-;; Machine description for the TMS320C[34]x for GNU C compiler
+];; Machine description for the TMS320C[34]x for GNU C compiler
 ;; Copyright (C) 1994-98, 1999 Free Software Foundation, Inc.
 
 ;; Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
  ""
  "legitimize_operands (AND, operands, QImode);")
 
+
+(define_insn "*andqi3_255_clobber"
+  [(set (match_operand:QI 0 "reg_operand" "=d,?c")
+        (and:QI (match_operand:QI 1 "src_operand" "mr,mr")
+                (const_int 255)))
+   (clobber (reg:CC 21))]
+ "! TARGET_C3X"
+ "lbu0\\t%1,%0"
+  [(set_attr "type" "unarycc")])
+
+
+(define_insn "*andqi3_65535_clobber"
+  [(set (match_operand:QI 0 "reg_operand" "=d,?c")
+        (and:QI (match_operand:QI 1 "src_operand" "mr,mr")
+                (const_int 65535)))
+   (clobber (reg:CC 21))]
+ "! TARGET_C3X"
+ "lhu0\\t%1,%0"
+  [(set_attr "type" "unarycc")])
+
+
 (define_insn "*andqi3_clobber"
   [(set (match_operand:QI 0 "reg_operand" "=d,?d,d,d,c,?c,c,c")
         (and:QI (match_operand:QI 1 "src_operand" "%rR,rS<>,0,0,rR,rS<>,0,0")
   ""
   "legitimize_operands (LSHIFTRT, operands, QImode);")
 
+
+(define_insn "*lshrqi3_24_clobber"
+  [(set (match_operand:QI 0 "reg_operand" "=d,c")
+        (lshiftrt:QI (match_operand:QI 1 "src_operand" "mr,mr")
+                     (const_int 24)))
+   (clobber (reg:CC 21))]
+  "! TARGET_C3X"
+  "lbu3\\t%1,%0"
+  [(set_attr "type" "unarycc")])
+
+
+(define_insn "*ashrqi3_24_clobber"
+  [(set (match_operand:QI 0 "reg_operand" "=d,c")
+        (ashiftrt:QI (match_operand:QI 1 "src_operand" "mr,mr")
+                     (const_int 24)))
+   (clobber (reg:CC 21))]
+  "! TARGET_C3X"
+  "lb3\\t%1,%0"
+  [(set_attr "type" "unarycc")])
+
+
+(define_insn "lshrqi3_16_clobber"
+  [(set (match_operand:QI 0 "reg_operand" "=d,c")
+        (lshiftrt:QI (match_operand:QI 1 "src_operand" "mr,mr")
+                     (const_int 16)))
+   (clobber (reg:CC 21))]
+  "! TARGET_C3X"
+  "lhu1\\t%1,%0"
+  [(set_attr "type" "unarycc")])
+
+
+(define_insn "*ashrqi3_16_clobber"
+  [(set (match_operand:QI 0 "reg_operand" "=d,c")
+        (ashiftrt:QI (match_operand:QI 1 "src_operand" "mr,mr")
+                     (const_int 16)))
+   (clobber (reg:CC 21))]
+  "! TARGET_C3X"
+  "lh1\\t%1,%0"
+  [(set_attr "type" "unarycc")])
+
+
 ; When the shift count is greater than the size of the word
 ; the result can be implementation specific
 (define_insn "*lshrqi3_const_clobber"
   "*
    if (INTVAL (operands[2]) == 8)
      {
+       /* 8 bit extract.  */
        operands[3] = GEN_INT (INTVAL (operands[3]) / 8);
        return \"lbu%3\\t%1,%0\";
      }
+   /* 16 bit extract.  */
    operands[3] = GEN_INT (INTVAL (operands[3]) / 16);
    return \"lhu%3\\t%1,%0\";
   "
   "*
    if (INTVAL (operands[1]) == 8)
      {
+       /* 8 bit insert.  */
        operands[2] = GEN_INT (INTVAL (operands[2]) / 8);
        return \"mb%2\\t%3,%0\";
      }
    else if (INTVAL (operands[1]) == 16)
      {
+       /* 16 bit insert.  */
        operands[2] = GEN_INT (INTVAL (operands[2]) / 16);
        return \"mh%2\\t%3,%0\";
      }
+   /* 24 bit insert.  */
    return \"lwl1\\t%3,%0\";
   "
   [(set_attr "type" "binarycc,binary")
   [(set_attr "type" "binarycc")
    (set_attr "data" "uint16")])
 
-;
+
 ; TWO OPERAND FLOAT INSTRUCTIONS
 ;
 
  "(REGNO (operands[0]) != REGNO (operands[4]))"
  "xor3\\t%2,%1,%0\\n||\\tsti\\t%4,%3")
 
-