@@ -8907,7 +8907,7 @@
(const_int 8))
(zero_extend:HI (match_operand:QI 2 "register_operand" "k"))))]
"TARGET_AVX512F"
- "kunpckbw\t{%1, %2, %0|%0, %2, %1}"
+ "kunpckbw\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "mode" "HI")
(set_attr "type" "msklog")
(set_attr "prefix" "vex")])
@@ -8920,7 +8920,7 @@
(const_int 16))
(zero_extend:SI (match_operand:HI 2 "register_operand" "k"))))]
"TARGET_AVX512BW"
- "kunpckwd\t{%1, %2, %0|%0, %2, %1}"
+ "kunpckwd\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "mode" "SI")])
(define_insn "kunpckdi"
@@ -8931,7 +8931,7 @@
(const_int 32))
(zero_extend:DI (match_operand:SI 2 "register_operand" "k"))))]
"TARGET_AVX512BW"
- "kunpckdq\t{%1, %2, %0|%0, %2, %1}"
+ "kunpckdq\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "mode" "DI")])
;; See comment for addsi_1_zext why we do use nonimmediate_operand
@@ -11747,16 +11747,16 @@
(define_expand "vec_pack_trunc_qi"
[(set (match_operand:HI 0 ("register_operand"))
- (ior:HI (ashift:HI (zero_extend:HI (match_operand:QI 1 ("register_operand")))
+ (ior:HI (ashift:HI (zero_extend:HI (match_operand:QI 2 ("register_operand")))
(const_int 8))
- (zero_extend:HI (match_operand:QI 2 ("register_operand")))))]
+ (zero_extend:HI (match_operand:QI 1 ("register_operand")))))]
"TARGET_AVX512F")
(define_expand "vec_pack_trunc_<mode>"
[(set (match_operand:<DOUBLEMASKMODE> 0 ("register_operand"))
- (ior:<DOUBLEMASKMODE> (ashift:<DOUBLEMASKMODE> (zero_extend:<DOUBLEMASKMODE> (match_operand:SWI24 1 ("register_operand")))
+ (ior:<DOUBLEMASKMODE> (ashift:<DOUBLEMASKMODE> (zero_extend:<DOUBLEMASKMODE> (match_operand:SWI24 2 ("register_operand")))
(match_dup 3))
- (zero_extend:<DOUBLEMASKMODE> (match_operand:SWI24 2 ("register_operand")))))]
+ (zero_extend:<DOUBLEMASKMODE> (match_operand:SWI24 1 ("register_operand")))))]
"TARGET_AVX512BW"
{
operands[3] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode));
new file mode 100644
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512bw" } */
+/* { dg-require-effective-target avx512bw } */
+
+#define AVX512BW
+
+#include "avx512f-helper.h"
+
+static __mmask64 __attribute__((noinline,noclone))
+unpack (__mmask64 arg1, __mmask64 arg2)
+{
+ __mmask64 res;
+
+ res = _mm512_kunpackd (arg1, arg2);
+
+ return res;
+}
+
+void
+TEST (void)
+{
+ if (unpack (0x07UL, 0x70UL) != 0x0700000070UL)
+ __builtin_abort ();
+}
new file mode 100644
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512bw" } */
+/* { dg-require-effective-target avx512bw } */
+
+#define AVX512BW
+
+#include "avx512f-helper.h"
+
+static __mmask32 __attribute__((noinline,noclone))
+unpack (__mmask32 arg1, __mmask32 arg2)
+{
+ __mmask32 res;
+
+ res = _mm512_kunpackw (arg1, arg2);
+
+ return res;
+}
+
+void
+TEST (void)
+{
+ if (unpack (0x07, 0x70) != 0x070070)
+ __builtin_abort ();
+}
new file mode 100644
@@ -0,0 +1,24 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#define AVX512F
+
+#include "avx512f-helper.h"
+
+static __mmask16 __attribute__((noinline,noclone))
+unpack (__mmask16 arg1, __mmask16 arg2)
+{
+ __mmask16 res;
+
+ res = _mm512_kunpackb (arg1, arg2);
+
+ return res;
+}
+
+void
+TEST (void)
+{
+ if (unpack (0x07, 0x70) != 0x0770)
+ __builtin_abort ();
+}