aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386-expand.c
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2020-09-26 15:34:23 +0800
committerliuhongt <hongtao.liu@intel.com>2020-10-22 10:29:04 +0800
commit7026bb9504eb0f95e114f832cd6dd14302376861 (patch)
treebe8b1d951c195583ba47e565f99e0cbbf0a82125 /gcc/config/i386/i386-expand.c
parent4de7b010038933dd6ca96bf186ca49f243d0def6 (diff)
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.
Diffstat (limited to 'gcc/config/i386/i386-expand.c')
-rw-r--r--gcc/config/i386/i386-expand.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index d0d7a969637..3e8afe683dc 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -1045,7 +1045,8 @@ ix86_binary_operator_ok (enum rtx_code code, machine_mode mode,
rtx src2 = operands[2];
/* Both source operands cannot be in memory. */
- if (MEM_P (src1) && MEM_P (src2))
+ if ((MEM_P (src1) || bcst_mem_operand (src1, mode))
+ && (MEM_P (src2) || bcst_mem_operand (src2, mode)))
return false;
/* Canonicalize operand order for commutative operators. */