Refactor implementation of *_bcst{_1,_2,_3} patterns.
authorliuhongt <hongtao.liu@intel.com>
Sat, 26 Sep 2020 07:34:23 +0000 (15:34 +0800)
committerliuhongt <hongtao.liu@intel.com>
Thu, 22 Oct 2020 02:29:04 +0000 (10:29 +0800)
commit7026bb9504eb0f95e114f832cd6dd14302376861
treebe8b1d951c195583ba47e565f99e0cbbf0a82125
parent4de7b010038933dd6ca96bf186ca49f243d0def6
Refactor implementation of *_bcst{_1,_2,_3} patterns.

Add new predicate bcst_mem_operand and corresponding constraint "Br"
to merge "$(pattern)_bcst{_1,_2,_3}" into "$(pattern)", also delete
those separate "*_bcst{_1,_2,_3}" patterns.

gcc/ChangeLog:

PR target/87767
* config/i386/constraints.md ("Br"): New special memory
constraint.
* config/i386/i386-expand.c (ix86_binary_operator_ok): Both
source operand cannot be in memory or bcst_memory_operand.
* config/i386/i386.c (ix86_print_operand): Print bcst_mem_operand.
* config/i386/i386.h (VALID_BCST_MODE_P): New.
* config/i386/predicates.md (bcst_mem_operand): New predicate
for AVX512 embedding broadcast memory operand.
(bcst_vector_operand): New predicate, vector_operand or
bcst_mem_operand.
* config/i386/sse.md
(*<plusminus_insn><mode>3<mask_name><round_name>): Extend
predicate and constraints to handle bcst_mem_operand.
(*mul<mode>3<mask_name><round_name>): Ditto.
(<sse>_div<mode>3<mask_name><round_name>): Ditto.
(<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name><round_name>):
Ditto.
(<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name><round_name>):
Ditto.
(<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name><round_name>):
Ditto.
(<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name><round_name>):
Ditto.
(*<plusminus_insn><mode>3): Ditto.
(avx512dq_mul<mode>3<mask_name>): Ditto.
(*<sse4_1_avx2>_mul<mode>3<mask_name>): Ditto.
(*andnot<mode>3): Ditto.
(<mask_codefor><code><mode>3<mask_name>): Ditto.
(*sub<mode>3<mask_name>_bcst): Removed.
(*add<mode>3<mask_name>_bcst): Ditto.
(*mul<mode>3<mask_name>_bcst): Ditto.
(*<avx512>_div<mode>3<mask_name>_bcst): Ditto.
(*<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name>_bcst_1):
Ditto.
(*<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name>_bcst_2):
Ditto.
(*<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name>_bcst_3):
Ditto.
(*<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name>_bcst_1):
Ditto.
(*<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name>_bcst_2):
Ditto.
(*<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name>_bcst_3):
Ditto.
(*<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name>_bcst_1):
Ditto.
(*<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name>_bcst_2):
Ditto.
(*<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name>_bcst_3):
Ditto.
(*<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name>_bcst_1):
Ditto.
(*<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name>_bcst_2):
Ditto.
(*<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name>_bcst_3):
Ditto.
(*sub<mode>3_bcst): Ditto.
(*add<mode>3_bcst): Ditto.
(*avx512dq_mul<mode>3<mask_name>_bcst): Ditto.
(*avx512f_mul<mode>3<mask_name>_bcst): Ditto.
(*andnot<mode>3_bcst): Ditto.
(*<code><mode>3_bcst): Ditto.
* config/i386/subst.md (bcst_round_constraint): New subst
attribute.
(bcst_round_nimm_predicate): Ditto.
(bcst_mask_prefix3): Ditto.
(bcst_mask_prefix4): Ditto.
gcc/config/i386/constraints.md
gcc/config/i386/i386-expand.c
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/predicates.md
gcc/config/i386/sse.md
gcc/config/i386/subst.md