From: Kirill Yukhin <kirill.yukhin@gmail.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
Richard Henderson <rth@redhat.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH i386 AVX512] [8/n] Extend substs for new patterns.
Date: Wed, 13 Aug 2014 14:23:00 -0000 [thread overview]
Message-ID: <20140813142335.GC57184@msticlxl57.ims.intel.com> (raw)
In-Reply-To: <CAFULd4ZfRdCb2w7x=VkMrf7BLC+OZFBX-RBpaLJpFMGDD8ZBUA@mail.gmail.com>
On 13 Aug 15:21, Uros Bizjak wrote:
> On Wed, Aug 13, 2014 at 2:14 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
>
> >> In a couple of places, <MODE_SIZE> checks are changed to GET_MODE_SIZE
> >> (GET_MODE (operands[0])) and in a similar way, <MODE>mode checks were
> >> changed to GET_MODE (operands[0]). The previous checks are more
> >> efficient and are preferred. Is there a reason you need to check
> >> operands[0] dynamically?
> >
> > I agree, runtime tests are worse. But this subst attributes are used
> > in patterns which actually do not contain mode iterators at all.
>
> IMO, two different subst patterns should be used in this case, one for
> patterns with and one for patterns w/o mode iterators.
That was my second thought after I hit `send'.
Updated patch in the bottom
Bootstrapped.
(Regtest w/ new tests is in progress).
Is it ok if pass?
gcc/
* config/i386/sse.md: Allow V64QI, V32QI, V32HI, V4HI modes.
* config/i386/subst.md
(define_mode_iterator SUBST_V): Update.
(define_mode_iterator SUBST_A): Ditto.
(define_subst_attr "mask_operand7"): New.
(define_subst_attr "mask_operand10"): New.
(define_subst_attr "mask_operand_arg34") : New.
(define_subst_attr "mask_expand_op3"): New.
(define_subst_attr "mask_mode512bit_condition"): Handle TARGET_AVX512VL.
(define_subst_attr "sd_mask_mode512bit_condition"): Ditto.
(define_subst_attr "mask_avx512vl_condition"): New.
(define_subst_attr "round_mask_operand4"): Ditto.
(define_subst_attr "round_mask_scalar_op3"): Delete.
(define_subst_attr "round_mask_op4"): New.
(define_subst_attr "round_mode512bit_condition"): Allow V8DImode,
V16SImode.
(define_subst_attr "round_modev8sf_condition"): New.
(define_subst_attr "round_modev4sf_condition"): GET_MODE instead of
<MODE>mode.
(define_subst_attr "round_saeonly_mask_operand4"): New.
(define_subst_attr "round_saeonly_mask_op4"): New.
(define_subst_attr "round_saeonly_mode512bit_condition"): Allow
V8DImode, V16SImode.
(define_subst_attr "round_saeonly_modev8sf_condition"): New.
(define_subst_attr "mask_expand4_name" "mask_expand4"): New.
(define_subst_attr "mask_expand4_args"): New.
(define_subst "mask_expand4"): New.
--
Thanks, K
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 3337104..ebe38f3 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -471,8 +471,8 @@
;; Mapping of vector modes to corresponding mask size
(define_mode_attr avx512fmaskmode
- [(V16QI "HI")
- (V16HI "HI") (V8HI "QI")
+ [(V64QI "DI") (V32QI "SI") (V16QI "HI")
+ (V32HI "SI") (V16HI "HI") (V8HI "QI") (V4HI "QI")
(V16SI "HI") (V8SI "QI") (V4SI "QI")
(V8DI "QI") (V4DI "QI") (V2DI "QI")
(V16SF "HI") (V8SF "QI") (V4SF "QI")
diff --git a/gcc/config/i386/subst.md b/gcc/config/i386/subst.md
index 1654cba..edb0965 100644
--- a/gcc/config/i386/subst.md
+++ b/gcc/config/i386/subst.md
@@ -20,8 +20,8 @@
;; Some iterators for extending subst as much as possible
;; All vectors (Use it for destination)
(define_mode_iterator SUBST_V
- [V16QI
- V16HI V8HI
+ [V64QI V32QI V16QI
+ V32HI V16HI V8HI
V16SI V8SI V4SI
V8DI V4DI V2DI
V16SF V8SF V4SF
@@ -31,8 +31,8 @@
[QI HI SI DI])
(define_mode_iterator SUBST_A
- [V16QI
- V16HI V8HI
+ [V64QI V32QI V16QI
+ V32HI V16HI V8HI
V16SI V8SI V4SI
V8DI V4DI V2DI
V16SF V8SF V4SF
@@ -47,16 +47,21 @@
(define_subst_attr "mask_operand3_1" "mask" "" "%%{%%4%%}%%N3") ;; for sprintf
(define_subst_attr "mask_operand4" "mask" "" "%{%5%}%N4")
(define_subst_attr "mask_operand6" "mask" "" "%{%7%}%N6")
+(define_subst_attr "mask_operand7" "mask" "" "%{%8%}%N7")
+(define_subst_attr "mask_operand10" "mask" "" "%{%11%}%N10")
(define_subst_attr "mask_operand11" "mask" "" "%{%12%}%N11")
(define_subst_attr "mask_operand18" "mask" "" "%{%19%}%N18")
(define_subst_attr "mask_operand19" "mask" "" "%{%20%}%N19")
(define_subst_attr "mask_codefor" "mask" "*" "")
-(define_subst_attr "mask_mode512bit_condition" "mask" "1" "(<MODE_SIZE> == 64)")
+(define_subst_attr "mask_operand_arg34" "mask" "" ", operands[3], operands[4]")
+(define_subst_attr "mask_mode512bit_condition" "mask" "1" "(<MODE_SIZE> == 64 || TARGET_AVX512VL)")
+(define_subst_attr "mask_avx512vl_condition" "mask" "1" "TARGET_AVX512VL")
(define_subst_attr "store_mask_constraint" "mask" "vm" "v")
(define_subst_attr "store_mask_predicate" "mask" "nonimmediate_operand" "register_operand")
(define_subst_attr "mask_prefix" "mask" "vex" "evex")
(define_subst_attr "mask_prefix2" "mask" "maybe_vex" "evex")
(define_subst_attr "mask_prefix3" "mask" "orig,vex" "evex")
+(define_subst_attr "mask_expand_op3" "mask" "3" "5")
(define_subst "mask"
[(set (match_operand:SUBST_V 0)
@@ -85,7 +90,7 @@
(define_subst_attr "sd_mask_op4" "sd" "" "%{%5%}%N4")
(define_subst_attr "sd_mask_op5" "sd" "" "%{%6%}%N5")
(define_subst_attr "sd_mask_codefor" "sd" "*" "")
-(define_subst_attr "sd_mask_mode512bit_condition" "sd" "1" "(<MODE_SIZE> == 64)")
+(define_subst_attr "sd_mask_mode512bit_condition" "sd" "1" "(<MODE_SIZE> == 64 || TARGET_AVX512VL)")
(define_subst "sd"
[(set (match_operand:SUBST_V 0)
@@ -101,6 +106,7 @@
(define_subst_attr "round_name" "round" "" "_round")
(define_subst_attr "round_mask_operand2" "mask" "%R2" "%R4")
(define_subst_attr "round_mask_operand3" "mask" "%R3" "%R5")
+(define_subst_attr "round_mask_operand4" "mask" "%R4" "%R6")
(define_subst_attr "round_sd_mask_operand4" "sd" "%R4" "%R6")
(define_subst_attr "round_op2" "round" "" "%R2")
(define_subst_attr "round_op3" "round" "" "%R3")
@@ -109,14 +115,18 @@
(define_subst_attr "round_op6" "round" "" "%R6")
(define_subst_attr "round_mask_op2" "round" "" "<round_mask_operand2>")
(define_subst_attr "round_mask_op3" "round" "" "<round_mask_operand3>")
-(define_subst_attr "round_mask_scalar_op3" "round" "" "<round_mask_scalar_operand3>")
+(define_subst_attr "round_mask_op4" "round" "" "<round_mask_operand4>")
(define_subst_attr "round_sd_mask_op4" "round" "" "<round_sd_mask_operand4>")
(define_subst_attr "round_constraint" "round" "vm" "v")
(define_subst_attr "round_constraint2" "round" "m" "v")
(define_subst_attr "round_constraint3" "round" "rm" "r")
(define_subst_attr "round_nimm_predicate" "round" "nonimmediate_operand" "register_operand")
(define_subst_attr "round_prefix" "round" "vex" "evex")
-(define_subst_attr "round_mode512bit_condition" "round" "1" "(<MODE>mode == V16SFmode || <MODE>mode == V8DFmode)")
+(define_subst_attr "round_mode512bit_condition" "round" "1" "(<MODE>mode == V16SFmode
+ || <MODE>mode == V8DFmode
+ || <MODE>mode == V8DImode
+ || <MODE>mode == V16SImode)")
+(define_subst_attr "round_modev8sf_condition" "round" "1" "(<MODE>mode == V8SFmode)")
(define_subst_attr "round_modev4sf_condition" "round" "1" "(<MODE>mode == V4SFmode)")
(define_subst_attr "round_codefor" "round" "*" "")
(define_subst_attr "round_opnum" "round" "5" "6")
@@ -133,6 +143,7 @@
(define_subst_attr "round_saeonly_name" "round_saeonly" "" "_round")
(define_subst_attr "round_saeonly_mask_operand2" "mask" "%r2" "%r4")
(define_subst_attr "round_saeonly_mask_operand3" "mask" "%r3" "%r5")
+(define_subst_attr "round_saeonly_mask_operand4" "mask" "%r4" "%r6")
(define_subst_attr "round_saeonly_mask_scalar_merge_operand4" "mask_scalar_merge" "%r4" "%r5")
(define_subst_attr "round_saeonly_sd_mask_operand5" "sd" "%r5" "%r7")
(define_subst_attr "round_saeonly_op2" "round_saeonly" "" "%r2")
@@ -143,12 +154,17 @@
(define_subst_attr "round_saeonly_prefix" "round_saeonly" "vex" "evex")
(define_subst_attr "round_saeonly_mask_op2" "round_saeonly" "" "<round_saeonly_mask_operand2>")
(define_subst_attr "round_saeonly_mask_op3" "round_saeonly" "" "<round_saeonly_mask_operand3>")
+(define_subst_attr "round_saeonly_mask_op4" "round_saeonly" "" "<round_saeonly_mask_operand4>")
(define_subst_attr "round_saeonly_mask_scalar_merge_op4" "round_saeonly" "" "<round_saeonly_mask_scalar_merge_operand4>")
(define_subst_attr "round_saeonly_sd_mask_op5" "round_saeonly" "" "<round_saeonly_sd_mask_operand5>")
(define_subst_attr "round_saeonly_constraint" "round_saeonly" "vm" "v")
(define_subst_attr "round_saeonly_constraint2" "round_saeonly" "m" "v")
(define_subst_attr "round_saeonly_nimm_predicate" "round_saeonly" "nonimmediate_operand" "register_operand")
-(define_subst_attr "round_saeonly_mode512bit_condition" "round_saeonly" "1" "(<MODE>mode == V16SFmode || <MODE>mode == V8DFmode)")
+(define_subst_attr "round_saeonly_mode512bit_condition" "round_saeonly" "1" "(<MODE>mode == V16SFmode
+ || <MODE>mode == V8DFmode
+ || <MODE>mode == V8DImode
+ || <MODE>mode == V16SImode)")
+(define_subst_attr "round_saeonly_modev8sf_condition" "round_saeonly" "1" "(<MODE>mode == V8SFmode)")
(define_subst "round_saeonly"
[(set (match_operand:SUBST_A 0)
@@ -196,3 +212,19 @@
(match_dup 4)
(match_dup 5)
(unspec [(match_operand:SI 6 "const48_operand")] UNSPEC_EMBEDDED_ROUNDING)])
+
+(define_subst_attr "mask_expand4_name" "mask_expand4" "" "_mask")
+(define_subst_attr "mask_expand4_args" "mask_expand4" "" ", operands[4], operands[5]")
+
+(define_subst "mask_expand4"
+ [(match_operand:SUBST_V 0)
+ (match_operand:SUBST_V 1)
+ (match_operand:SUBST_V 2)
+ (match_operand:SI 3)]
+ "TARGET_AVX512VL"
+ [(match_dup 0)
+ (match_dup 1)
+ (match_dup 2)
+ (match_dup 3)
+ (match_operand:SUBST_V 4 "vector_move_operand")
+ (match_operand:<avx512fmaskmode> 5 "register_operand")])
next prev parent reply other threads:[~2014-08-13 14:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-12 12:58 Kirill Yukhin
2014-08-12 18:16 ` Uros Bizjak
2014-08-13 12:15 ` Kirill Yukhin
2014-08-13 13:21 ` Uros Bizjak
2014-08-13 14:23 ` Kirill Yukhin [this message]
2014-08-13 17:40 ` Uros Bizjak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140813142335.GC57184@msticlxl57.ims.intel.com \
--to=kirill.yukhin@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=rth@redhat.com \
--cc=ubizjak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).