"ix86_fixup_binary_operands_no_copy (EQ, <MODE>mode, operands);")
(define_insn "<avx512>_eq<mode>3<mask_scalar_merge_name>_1"
- [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk")
+ [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk,Yk")
(unspec:<avx512fmaskmode>
- [(match_operand:VI12_AVX512VL 1 "nonimmediate_operand" "%v")
- (match_operand:VI12_AVX512VL 2 "nonimmediate_operand" "vm")]
+ [(match_operand:VI12_AVX512VL 1 "vector_move_operand" "%v,v")
+ (match_operand:VI12_AVX512VL 2 "vector_move_operand" "vm,C")]
UNSPEC_MASKED_EQ))]
- "TARGET_AVX512F && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "vpcmpeq<ssemodesuffix>\t{%2, %1, %0<mask_scalar_merge_operand3>|%0<mask_scalar_merge_operand3>, %1, %2}"
+ "TARGET_AVX512BW && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "@
+ vpcmpeq<ssemodesuffix>\t{%2, %1, %0<mask_scalar_merge_operand3>|%0<mask_scalar_merge_operand3>, %1, %2}
+ vptestm<ssemodesuffix>\t{%1, %1, %0<mask_scalar_merge_operand3>|%0<mask_scalar_merge_operand3>, %1, %1}"
[(set_attr "type" "ssecmp")
(set_attr "prefix_extra" "1")
(set_attr "prefix" "evex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<avx512>_eq<mode>3<mask_scalar_merge_name>_1"
- [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk")
+ [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=Yk,Yk")
(unspec:<avx512fmaskmode>
- [(match_operand:VI48_AVX512VL 1 "nonimmediate_operand" "%v")
- (match_operand:VI48_AVX512VL 2 "nonimmediate_operand" "vm")]
+ [(match_operand:VI48_AVX512VL 1 "vector_move_operand" "%v,v")
+ (match_operand:VI48_AVX512VL 2 "vector_move_operand" "vm,C")]
UNSPEC_MASKED_EQ))]
"TARGET_AVX512F && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
- "vpcmpeq<ssemodesuffix>\t{%2, %1, %0<mask_scalar_merge_operand3>|%0<mask_scalar_merge_operand3>, %1, %2}"
+ "@
+ vpcmpeq<ssemodesuffix>\t{%2, %1, %0<mask_scalar_merge_operand3>|%0<mask_scalar_merge_operand3>, %1, %2}
+ vptestm<ssemodesuffix>\t{%1, %1, %0<mask_scalar_merge_operand3>|%0<mask_scalar_merge_operand3>, %1, %1}"
[(set_attr "type" "ssecmp")
(set_attr "prefix_extra" "1")
(set_attr "prefix" "evex")
--- /dev/null
+/* PR target/85832 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512vl -mno-avx512bw -masm=att" } */
+/* { dg-final { scan-assembler-times {\mvptestmd\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mvptestmq\M} 2 } } */
+
+#include <x86intrin.h>
+
+int
+f1 (__m256i x)
+{
+ return _mm256_cmpeq_epi32_mask (x, _mm256_setzero_si256 ());
+}
+
+int
+f2 (__m256i x)
+{
+ return _mm256_cmpeq_epi64_mask (x, _mm256_setzero_si256 ());
+}
+
+int
+f3 (__m128i x)
+{
+ return _mm_cmpeq_epi32_mask (x, _mm_setzero_si128 ());
+}
+
+int
+f4 (__m128i x)
+{
+ return _mm_cmpeq_epi64_mask (x, _mm_setzero_si128 ());
+}
--- /dev/null
+/* PR target/85832 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512vl -mavx512bw -masm=att" } */
+/* { dg-final { scan-assembler-times {\mvptestmb\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mvptestmw\M} 2 } } */
+
+#include <x86intrin.h>
+
+int
+f1 (__m256i x)
+{
+ return _mm256_cmpeq_epi8_mask (x, _mm256_setzero_si256 ());
+}
+
+int
+f2 (__m256i x)
+{
+ return _mm256_cmpeq_epi16_mask (x, _mm256_setzero_si256 ());
+}
+
+int
+f3 (__m128i x)
+{
+ return _mm_cmpeq_epi8_mask (x, _mm_setzero_si128 ());
+}
+
+int
+f4 (__m128i x)
+{
+ return _mm_cmpeq_epi16_mask (x, _mm_setzero_si128 ());
+}