sse2,sse2_noavx,sse3,sse4,sse4_noavx,avx,noavx,
avx2,noavx2,bmi,bmi2,fma4,fma,avx512f,noavx512f,
fma_avx512f,avx512bw,noavx512bw,avx512dq,noavx512dq,
- avx512vl,noavx512vl,x64_avx512dq"
+ avx512vl,noavx512vl,x64_avx512dq,x64_avx512bw"
(const_string "base"))
(define_attr "enabled" ""
(symbol_ref "TARGET_64BIT && TARGET_AVX")
(eq_attr "isa" "x64_avx512dq")
(symbol_ref "TARGET_64BIT && TARGET_AVX512DQ")
+ (eq_attr "isa" "x64_avx512bw")
+ (symbol_ref "TARGET_64BIT && TARGET_AVX512BW")
(eq_attr "isa" "nox64") (symbol_ref "!TARGET_64BIT")
(eq_attr "isa" "sse2") (symbol_ref "TARGET_SSE2")
(eq_attr "isa" "sse2_noavx")
[(set (attr "isa")
(cond [(eq_attr "alternative" "0,1,2")
(const_string "nox64")
- (eq_attr "alternative" "3,7,11")
+ (eq_attr "alternative" "3,7")
(const_string "x64")
(eq_attr "alternative" "8")
(const_string "x64_sse4")
(eq_attr "alternative" "10")
(const_string "sse2")
+ (eq_attr "alternative" "11")
+ (const_string "x64_avx512bw")
]
(const_string "*")))
(set (attr "type")
(set (match_dup 4) (const_int 0))]
"split_double_mode (DImode, &operands[0], 1, &operands[3], &operands[4]);")
+(define_mode_attr kmov_isa
+ [(QI "avx512dq") (HI "avx512f") (SI "avx512bw") (DI "avx512bw")])
+
(define_insn "zero_extend<mode>di2"
[(set (match_operand:DI 0 "register_operand" "=r,*r")
(zero_extend:DI
"@
movz{<imodesuffix>l|x}\t{%1, %k0|%k0, %1}
kmov<mskmodesuffix>\t{%1, %k0|%k0, %1}"
- [(set_attr "type" "imovx,mskmov")
+ [(set_attr "isa" "*,<kmov_isa>")
+ (set_attr "type" "imovx,mskmov")
(set_attr "mode" "SI")])
(define_expand "zero_extend<mode>si2"
"@
movz{<imodesuffix>l|x}\t{%1, %0|%0, %1}
kmov<mskmodesuffix>\t{%1, %0|%0, %1}"
- [(set_attr "type" "imovx,mskmov")
+ [(set_attr "isa" "*,<kmov_isa>")
+ (set_attr "type" "imovx,mskmov")
(set_attr "mode" "SI,<MODE>")])
(define_expand "zero_extendqihi2"
movz{bl|x}\t{%1, %k0|%k0, %1}
kmovb\t{%1, %k0|%k0, %1}"
[(set_attr "type" "imovx,mskmov")
+ (set_attr "isa" "*,avx512dq")
(set_attr "mode" "SI,QI")])
(define_insn_and_split "*zext<mode>_doubleword_and"
--- /dev/null
+/* PR target/77476 */
+/* { dg-do run } */
+/* { dg-options "-O2 -mavx512f" } */
+/* { dg-require-effective-target avx512f } */
+
+#ifndef PR77476_TEST
+#include "avx512f-check.h"
+#define PR77476_TEST avx512f_test
+#endif
+
+unsigned short s;
+unsigned int i;
+unsigned long long l;
+
+void
+f1 (void)
+{
+ unsigned char a = 0xff;
+ asm volatile ("" : "+Yk" (a));
+ s = a;
+}
+
+void
+f2 (void)
+{
+ unsigned char a = 0xff;
+ asm volatile ("" : "+Yk" (a));
+ i = a;
+}
+
+void
+f3 (void)
+{
+ unsigned char a = 0xff;
+ asm volatile ("" : "+Yk" (a));
+ l = a;
+}
+
+void
+f4 (void)
+{
+ unsigned short a = 0xffff;
+ asm volatile ("" : "+Yk" (a));
+ i = a;
+}
+
+void
+f5 (void)
+{
+ unsigned short a = 0xffff;
+ asm volatile ("" : "+Yk" (a));
+ l = a;
+}
+
+#ifdef __AVX512BW__
+void
+f6 (void)
+{
+ unsigned int a = 0xffffffff;
+ asm volatile ("" : "+Yk" (a));
+ l = a;
+}
+#endif
+
+static void
+PR77476_TEST ()
+{
+ f1 (); if (s != 0xff) __builtin_abort (); s = 0;
+ f2 (); if (i != 0xff) __builtin_abort (); i = 0;
+ f3 (); if (l != 0xff) __builtin_abort (); l = 0;
+ f4 (); if (i != 0xffff) __builtin_abort (); i = 0;
+ f5 (); if (l != 0xffff) __builtin_abort (); l = 0;
+#ifdef __AVX512BW__
+ f6 (); if (l != 0xffffffff) __builtin_abort (); l = 0;
+#endif
+}