(and (match_code "const_int")
(match_test "op == constm1_rtx")))
+;; Match 0 or -1.
+(define_predicate "const0_or_m1_operand"
+ (ior (match_operand 0 "const0_operand")
+ (match_operand 0 "constm1_operand")))
+
;; Match exactly eight.
(define_predicate "const8_operand"
(and (match_code "const_int")
(V16SI "TARGET_AVX512F && TARGET_EVEX512") (V8SI "TARGET_AVX") V4SI
(V8DI "TARGET_AVX512F && TARGET_EVEX512") (V4DI "TARGET_AVX") V2DI
(V32HF "TARGET_AVX512F && TARGET_EVEX512") (V16HF "TARGET_AVX") V8HF
+ (V32BF "TARGET_AVX512F && TARGET_EVEX512") (V16BF "TARGET_AVX") V8BF
(V16SF "TARGET_AVX512F && TARGET_EVEX512") (V8SF "TARGET_AVX") V4SF
(V8DF "TARGET_AVX512F && TARGET_EVEX512") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")])
(V16SF "TARGET_EVEX512")
(V8DF "TARGET_EVEX512")])
-(define_mode_iterator V4SF_V8HF
- [V4SF V8HF])
+(define_mode_iterator V24F_128
+ [V4SF V8HF V8BF])
(define_mode_iterator VI48_AVX512VL
[(V16SI "TARGET_EVEX512") (V8SI "TARGET_AVX512VL") (V4SI "TARGET_AVX512VL")
(set_attr "mode" "V4SF,SF,DI,DI")])
(define_insn "*vec_concat<mode>"
- [(set (match_operand:V4SF_V8HF 0 "register_operand" "=x,v,x,v")
- (vec_concat:V4SF_V8HF
+ [(set (match_operand:V24F_128 0 "register_operand" "=x,v,x,v")
+ (vec_concat:V24F_128
(match_operand:<ssehalfvecmode> 1 "register_operand" " 0,v,0,v")
(match_operand:<ssehalfvecmode> 2 "nonimmediate_operand" " x,v,m,m")))]
"TARGET_SSE"
(set_attr "mode" "V4SF,V4SF,V2SF,V2SF")])
(define_insn "*vec_concat<mode>_0"
- [(set (match_operand:V4SF_V8HF 0 "register_operand" "=v")
- (vec_concat:V4SF_V8HF
+ [(set (match_operand:V24F_128 0 "register_operand" "=v")
+ (vec_concat:V24F_128
(match_operand:<ssehalfvecmode> 1 "nonimmediate_operand" "vm")
(match_operand:<ssehalfvecmode> 2 "const0_operand")))]
"TARGET_SSE2"
(set_attr "memory" "store")
(set_attr "mode" "<sseinsnmode>")])
+(define_insn_and_split "*<avx512>_store<mode>_mask_1"
+ [(set (match_operand:V 0 "memory_operand")
+ (unspec:V
+ [(match_operand:V 1 "register_operand")
+ (match_dup 0)
+ (match_operand:<avx512fmaskmode> 2 "const0_or_m1_operand")]
+ UNSPEC_MASKMOV))]
+ "TARGET_AVX512F && ix86_pre_reload_split ()"
+ "#"
+ "&& 1"
+ [(const_int 0)]
+{
+ if (constm1_operand (operands[2], <MODE>mode))
+ emit_move_insn (operands[0], operands[1]);
+ else
+ emit_note (NOTE_INSN_DELETED);
+
+ DONE;
+})
+
(define_expand "cbranch<mode>4"
[(set (reg:CC FLAGS_REG)
(compare:CC (match_operand:VI_AVX_AVX512F 1 "register_operand")
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx512vl --param vect-partial-vector-usage=2 -mtune=znver5 -mprefer-vector-width=512" } */
+/* { dg-final { scan-assembler-not "kxor\[bw]" } } */
+
+typedef unsigned long long BITBOARD;
+BITBOARD KingPressureMask1[64], KingSafetyMask1[64];
+
+void __attribute__((noinline))
+foo()
+{
+ int i;
+
+ for (i = 0; i < 64; i++) {
+ if ((i & 7) == 0) {
+ KingPressureMask1[i] = KingSafetyMask1[i + 1];
+ } else if ((i & 7) == 7) {
+ KingPressureMask1[i] = KingSafetyMask1[i - 1];
+ } else {
+ KingPressureMask1[i] = KingSafetyMask1[i];
+ }
+ }
+}
+
+BITBOARD verify[64] = {1, 1, 2, 3, 4, 5, 6, 6, 9, 9, 10, 11, 12, 13, 14, 14, 17, 17, 18, 19,
+ 20, 21, 22, 22, 25, 25, 26, 27, 28, 29, 30, 30, 33, 33, 34, 35, 36, 37, 38,
+ 38, 41, 41, 42, 43, 44, 45, 46, 46, 49, 49, 50, 51, 52, 53, 54, 54, 57, 57,
+ 58, 59, 60, 61, 62, 62};
+
+int main()
+{
+ for (int i = 0; i < 64; ++i)
+ KingSafetyMask1[i] = i;
+ foo ();
+ for (int i = 0; i < 64; ++i)
+ if (KingPressureMask1[i] != verify[i])
+ __builtin_abort ();
+ return 0;
+}