From 83e4f0a77691a29aef6711e5ae008a7bce0a1d49 Mon Sep 17 00:00:00 2001 From: liuhongt Date: Wed, 6 Apr 2022 14:07:50 +0800 Subject: [PATCH] Refine and/ior/xor/andn masked patterns for V*HFmode. There's no masked vpandw or vpandb, similar for vpxor/vpor/vpandn. gcc/ChangeLog: * config/i386/sse.md (_andnot3_mask): Removed. (_andnot3): Disable V*HFmode patterns for mask_applied. (3): Ditto. (*3): Ditto. (VFB_128_256): Adjust condition of V8HF/V16HFmode according to real instruction. (VFB_512): Ditto. (VFB): Ditto. --- gcc/config/i386/sse.md | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index a852c16..5e93aa2 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -327,9 +327,7 @@ ;; 128-, 256- and 512-bit float vector modes for bitwise operations (define_mode_iterator VFB - [(V32HF "TARGET_AVX512FP16") - (V16HF "TARGET_AVX512FP16") - (V8HF "TARGET_AVX512FP16") + [(V32HF "TARGET_AVX512F") (V16HF "TARGET_AVX") (V8HF "TARGET_SSE2") (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")]) @@ -340,8 +338,7 @@ ;; 128- and 256-bit float vector modes for bitwise operations (define_mode_iterator VFB_128_256 - [(V16HF "TARGET_AVX512FP16") - (V8HF "TARGET_AVX512FP16") + [(V16HF "TARGET_AVX") (V8HF "TARGET_SSE2") (V8SF "TARGET_AVX") V4SF (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")]) @@ -399,7 +396,7 @@ ;; All 512bit vector float modes for bitwise operations (define_mode_iterator VFB_512 - [(V32HF "TARGET_AVX512FP16") V16SF V8DF]) + [V32HF V16SF V8DF]) (define_mode_iterator VI48_AVX512VL [V16SI (V8SI "TARGET_AVX512VL") (V4SI "TARGET_AVX512VL") @@ -4581,7 +4578,8 @@ (not:VFB_128_256 (match_operand:VFB_128_256 1 "register_operand" "0,x,v,v")) (match_operand:VFB_128_256 2 "vector_operand" "xBm,xm,vm,vm")))] - "TARGET_SSE && " + "TARGET_SSE && + && (! || mode != HFmode)" { char buf[128]; const char *ops; @@ -4648,7 +4646,7 @@ (not:VFB_512 (match_operand:VFB_512 1 "register_operand" "v")) (match_operand:VFB_512 2 "nonimmediate_operand" "vm")))] - "TARGET_AVX512F" + "TARGET_AVX512F && (! || mode != HFmode)" { char buf[128]; const char *ops; @@ -4683,7 +4681,8 @@ (any_logic:VFB_128_256 (match_operand:VFB_128_256 1 "vector_operand") (match_operand:VFB_128_256 2 "vector_operand")))] - "TARGET_SSE && " + "TARGET_SSE && + && (! || mode != HFmode)" "ix86_fixup_binary_operands_no_copy (, mode, operands);") (define_expand "3" @@ -4691,7 +4690,7 @@ (any_logic:VFB_512 (match_operand:VFB_512 1 "nonimmediate_operand") (match_operand:VFB_512 2 "nonimmediate_operand")))] - "TARGET_AVX512F" + "TARGET_AVX512F && (! || mode != HFmode)" "ix86_fixup_binary_operands_no_copy (, mode, operands);") (define_insn "*3" @@ -4700,6 +4699,7 @@ (match_operand:VFB_128_256 1 "vector_operand" "%0,x,v,v") (match_operand:VFB_128_256 2 "vector_operand" "xBm,xm,vm,vm")))] "TARGET_SSE && + && (! || mode != HFmode) && !(MEM_P (operands[1]) && MEM_P (operands[2]))" { char buf[128]; @@ -4766,7 +4766,8 @@ (any_logic:VFB_512 (match_operand:VFB_512 1 "nonimmediate_operand" "%v") (match_operand:VFB_512 2 "nonimmediate_operand" "vm")))] - "TARGET_AVX512F && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + "TARGET_AVX512F && !(MEM_P (operands[1]) && MEM_P (operands[2])) + && (! || mode != HFmode)" { char buf[128]; const char *ops; @@ -16741,17 +16742,6 @@ (match_operand: 4 "register_operand")))] "TARGET_AVX512F") -(define_expand "_andnot3_mask" - [(set (match_operand:VI12_AVX512VL 0 "register_operand") - (vec_merge:VI12_AVX512VL - (and:VI12_AVX512VL - (not:VI12_AVX512VL - (match_operand:VI12_AVX512VL 1 "register_operand")) - (match_operand:VI12_AVX512VL 2 "nonimmediate_operand")) - (match_operand:VI12_AVX512VL 3 "nonimm_or_0_operand") - (match_operand: 4 "register_operand")))] - "TARGET_AVX512BW") - (define_insn "*andnot3" [(set (match_operand:VI 0 "register_operand" "=x,x,v") (and:VI -- 2.7.4