]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/config/i386/i386.md
i386: Optimize QImode insn with high input registers
[gcc.git] / gcc / config / i386 / i386.md
index f5407ab305491f1eba355f06f6898e2af05902e6..1b5a794b9e54e311c3ae2279773488b21ed58eaf 100644 (file)
    (set_attr "type" "alu")
    (set_attr "mode" "QI")])
 
+(define_insn_and_split "*addqi_ext2<mode>_0"
+  [(set (match_operand:QI 0 "register_operand" "=&Q")
+       (plus:QI
+         (subreg:QI
+           (match_operator:SWI248 3 "extract_operator"
+             [(match_operand 1 "int248_register_operand" "Q")
+              (const_int 8)
+              (const_int 8)]) 0)
+         (subreg:QI
+           (match_operator:SWI248 4 "extract_operator"
+             [(match_operand 2 "int248_register_operand" "Q")
+              (const_int 8)
+              (const_int 8)]) 0)))
+   (clobber (reg:CC FLAGS_REG))]
+  ""
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 0)
+       (subreg:QI
+         (match_op_dup 4
+           [(match_dup 2) (const_int 8) (const_int 8)]) 0))
+   (parallel
+     [(set (match_dup 0)
+          (plus:QI
+            (subreg:QI
+              (match_op_dup 3
+                [(match_dup 1) (const_int 8) (const_int 8)]) 0)
+          (match_dup 0)))
+      (clobber (reg:CC FLAGS_REG))])]
+  ""
+  [(set_attr "type" "alu")
+   (set_attr "mode" "QI")])
+
 (define_expand "addqi_ext_1"
   [(parallel
      [(set (zero_extract:HI (match_operand:HI 0 "register_operand")
    (set_attr "type" "alu")
    (set_attr "mode" "QI")])
 
+(define_insn_and_split "*subqi_ext2<mode>_0"
+  [(set (match_operand:QI 0 "register_operand" "=&Q")
+       (minus:QI
+         (subreg:QI
+           (match_operator:SWI248 3 "extract_operator"
+             [(match_operand 1 "int248_register_operand" "Q")
+              (const_int 8)
+              (const_int 8)]) 0)
+         (subreg:QI
+           (match_operator:SWI248 4 "extract_operator"
+             [(match_operand 2 "int248_register_operand" "Q")
+              (const_int 8)
+              (const_int 8)]) 0)))
+   (clobber (reg:CC FLAGS_REG))]
+  ""
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 0)
+       (subreg:QI
+         (match_op_dup 3
+           [(match_dup 1) (const_int 8) (const_int 8)]) 0))
+   (parallel
+     [(set (match_dup 0)
+          (minus:QI
+            (match_dup 0)
+            (subreg:QI
+              (match_op_dup 4
+                [(match_dup 2) (const_int 8) (const_int 8)]) 0)))
+      (clobber (reg:CC FLAGS_REG))])]
+  ""
+  [(set_attr "type" "alu")
+   (set_attr "mode" "QI")])
+
 ;; Alternative 1 is needed to work around LRA limitation, see PR82524.
 (define_insn_and_split "*subqi_ext<mode>_1"
   [(set (zero_extract:SWI248
    (set_attr "type" "alu")
    (set_attr "mode" "QI")])
 
+(define_insn_and_split "*<code>qi_ext2<mode>_0"
+  [(set (match_operand:QI 0 "register_operand" "=&Q")
+       (any_logic:QI
+         (subreg:QI
+           (match_operator:SWI248 3 "extract_operator"
+             [(match_operand 1 "int248_register_operand" "Q")
+              (const_int 8)
+              (const_int 8)]) 0)
+         (subreg:QI
+           (match_operator:SWI248 4 "extract_operator"
+             [(match_operand 2 "int248_register_operand" "Q")
+              (const_int 8)
+              (const_int 8)]) 0)))
+   (clobber (reg:CC FLAGS_REG))]
+  ""
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 0)
+       (subreg:QI
+         (match_op_dup 4
+           [(match_dup 2) (const_int 8) (const_int 8)]) 0))
+   (parallel
+     [(set (match_dup 0)
+          (any_logic:QI
+            (subreg:QI
+              (match_op_dup 3
+                [(match_dup 1) (const_int 8) (const_int 8)]) 0)
+          (match_dup 0)))
+      (clobber (reg:CC FLAGS_REG))])]
+  ""
+  [(set_attr "type" "alu")
+   (set_attr "mode" "QI")])
+
 (define_expand "andqi_ext_1"
   [(parallel
      [(set (zero_extract:HI (match_operand:HI 0 "register_operand")
This page took 0.048197 seconds and 5 git commands to generate.