i386.md (SWI1248_AVX512BW): New mode iterator.
authorPetr Murzin <petr.murzin@intel.com>
Mon, 25 Aug 2014 11:39:18 +0000 (11:39 +0000)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Mon, 25 Aug 2014 11:39:18 +0000 (11:39 +0000)
gcc/
        * config/i386/i386.md (SWI1248_AVX512BW): New mode iterator.
        (*k<logic><mode>): Add *k<logic>qi and *k<logic>hi and use
        SWI1248_AVX512BW mode iterator.

From-SVN: r214417

gcc/ChangeLog
gcc/config/i386/i386.md

index a3c18972fe22e6457dd1ccf7155fb529945ac75e..86617e09934a4695d434ed2857cf18dad0ad3bea 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-25  Petr Murzin  <petr.murzin@intel.com>
+
+       * config/i386/i386.md (SWI1248_AVX512BW): New mode iterator.
+       (*k<logic><mode>): Add *k<logic>qi and *k<logic>hi and use
+       SWI1248_AVX512BW mode iterator.
+
 2014-08-25  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        PR target/62111
index 8e74eabb5ab53d764b56e69f0719d96ad2f36246..f56ad078c2aad6d3ff60cf950bdfee124c3851bb 100644 (file)
 ;; All integer modes.
 (define_mode_iterator SWI1248x [QI HI SI DI])
 
+;; All integer modes with AVX512BW.
+(define_mode_iterator SWI1248_AVX512BW
+  [QI HI (SI "TARGET_AVX512BW") (DI "TARGET_AVX512BW")]
+
 ;; All integer modes without QImode.
 (define_mode_iterator SWI248x [HI SI DI])
 
        (any_logic:SWI1248x (match_dup 1)
                            (match_dup 2)))])
 
-;; TODO: It seems to be possible to macroize following
-;; 3 patterns.
-(define_insn "*k<logic>qi"
-  [(set (match_operand:QI 0 "mask_reg_operand" "=k")
-       (any_logic:QI (match_operand:QI 1 "mask_reg_operand" "k")
-                     (match_operand:QI 2 "mask_reg_operand" "k")))]
-  "TARGET_AVX512F"
-{
-  return TARGET_AVX512DQ ? "k<logic>b\t{%2, %1, %0|%0, %1, %2}"
-                        : "k<logic>w\t{%2, %1, %0|%0, %1, %2}";
-}
-  [(set_attr "mode" "QI")
-   (set_attr "type" "msklog")
-   (set_attr "prefix" "vex")])
-
-(define_insn "*k<logic>hi"
-  [(set (match_operand:HI 0 "mask_reg_operand" "=k")
-       (any_logic:HI (match_operand:HI 1 "mask_reg_operand" "k")
-                     (match_operand:HI 2 "mask_reg_operand" "k")))]
-  "TARGET_AVX512F"
-  "k<logic>w\t{%2, %1, %0|%0, %1, %2}";
-  [(set_attr "mode" "HI")
-   (set_attr "type" "msklog")
-   (set_attr "prefix" "vex")])
-
 (define_insn "*k<logic><mode>"
-  [(set (match_operand:SWI48x 0 "mask_reg_operand" "=k")
-       (any_logic:SWI48x (match_operand:SWI48x 1 "mask_reg_operand" "k")
-                         (match_operand:SWI48x 2 "mask_reg_operand" "k")))]
-  "TARGET_AVX512BW"
-  "k<logic><mskmodesuffix>\t{%2, %1, %0|%0, %1, %2}";
+  [(set (match_operand:SWI1248_AVX512BW 0 "mask_reg_operand" "=k")
+       (any_logic:SWI1248_AVX512BW (match_operand:SWI1248_AVX512BW 1 "mask_reg_operand" "k")
+                         (match_operand:SWI1248_AVX512BW 2 "mask_reg_operand" "k")))]
+  "TARGET_AVX512F"
+  {
+    if (!TARGET_AVX512DQ && <MODE>mode == QImode)
+      return "k<logic>w\t{%2, %1, %0|%0, %1, %2}";
+    else
+      return "k<logic><mskmodesuffix>\t{%2, %1, %0|%0, %1, %2}";
+  }
   [(set_attr "mode" "<MODE>")
    (set_attr "type" "msklog")
    (set_attr "prefix" "vex")])