[NDS32] Add subtype attribute for instructions.
authorChung-Ju Wu <jasonwucj@gmail.com>
Thu, 5 Apr 2018 01:35:00 +0000 (01:35 +0000)
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>
Thu, 5 Apr 2018 01:35:00 +0000 (01:35 +0000)
gcc/
* config/nds32/nds32.md (subtype): New attribute.

From-SVN: r259112

gcc/ChangeLog
gcc/config/nds32/nds32.md

index e090230..d07fe81 100644 (file)
@@ -1,3 +1,7 @@
+2018-04-05  Chung-Ju Wu  <jasonwucj@gmail.com>
+
+       * config/nds32/nds32.md (subtype): New attribute.
+
 2018-04-04  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        PR target/85203
index afbea8b..a216507 100644 (file)
   "unknown,load,store,load_multiple,store_multiple,alu,alu_shift,mul,mac,div,branch,call,misc"
   (const_string "unknown"))
 
+;; Insn sub-type
+(define_attr "subtype"
+  "simple,shift"
+  (const_string "simple"))
+
 ;; Length, in bytes, default is 4-bytes.
 (define_attr "length" "" (const_int 4))
 
   rotri\t%0, %1, %2
   rotr\t%0, %1, %2"
   [(set_attr "type"    "  alu,  alu")
+   (set_attr "subtype" "shift,shift")
    (set_attr "length"  "    4,    4")])
 
 
   slli333\t%0, %1, %2
   slli\t%0, %1, %2
   sll\t%0, %1, %2"
-  [(set_attr "type"   "alu,alu,alu")
-   (set_attr "length" "  2,  4,  4")])
-
+  [(set_attr "type"    "  alu,  alu,  alu")
+   (set_attr "subtype" "shift,shift,shift")
+   (set_attr "length"  "    2,    4,    4")])
 (define_insn "ashrsi3"
   [(set (match_operand:SI 0 "register_operand"               "=   d,    r, r")
        (ashiftrt:SI (match_operand:SI 1 "register_operand"  "    0,    r, r")
   srai45\t%0, %2
   srai\t%0, %1, %2
   sra\t%0, %1, %2"
-  [(set_attr "type"   "alu,alu,alu")
-   (set_attr "length" "  2,  4,  4")])
+  [(set_attr "type"    "  alu,  alu,  alu")
+   (set_attr "subtype" "shift,shift,shift")
+   (set_attr "length"  "    2,    4,    4")])
 
 (define_insn "lshrsi3"
   [(set (match_operand:SI 0 "register_operand"               "=   d,    r, r")
   srli45\t%0, %2
   srli\t%0, %1, %2
   srl\t%0, %1, %2"
-  [(set_attr "type"   "alu,alu,alu")
-   (set_attr "length" "  2,  4,  4")])
+  [(set_attr "type"    "  alu,  alu,  alu")
+   (set_attr "subtype" "shift,shift,shift")
+   (set_attr "length"  "    2,    4,    4")])
 
 
 ;; ----------------------------------------------------------------------------