From: Uros Bizjak <ubizjak@gmail.com>
To: Richard Guenther <rguenther@suse.de>
Cc: Jakub Jelinek <jakub@redhat.com>,
gcc-patches@gcc.gnu.org, uros@gcc.gnu.org, rth@redhat.com,
artyom.shinkaroff@gmail.com
Subject: Re: [PATCH] Change vcond<mode> to vcond<mode1><mode2>
Date: Fri, 02 Sep 2011 12:19:00 -0000 [thread overview]
Message-ID: <CAFULd4byQKFTnoRd+jaV9+R=8fUdjfshcdsBJnjoHRyUGxgr2Q@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1109021143340.2130@zhemvz.fhfr.qr>
On Fri, Sep 2, 2011 at 11:43 AM, Richard Guenther <rguenther@suse.de> wrote:
>> > > >> >> > Hmm. But then I'd have to try emit an insn, right? Currently
>> > > >> >> > the vectorizer simply looks for an optab handler ... the
>> > > >> >> > operands are not readily available (but their mode is known).
>> > > >> >> > So I'd create some fake regs, setup operands and call GEN_FCN
>> > > >> >> > on it? If it succeds I'd have to delete emitted insns, etc.
>> > > >> >> > Or I could add a target hook ...
>> > > >> >>
>> > > >> >> Hm... indeed, too much complication...
>> > > >> >>
>> > > >> >> I'd say, let's go with modeless operands and a target hook. IMO, this
>> > > >> >> is much more flexible than checking optab for supported modes.
>> > > >> >> Existing way is appropriate for single mode patterns, but we have
>> > > >> >> interdependent modes here, at least on x86.
>> > > >> >>
>> > > >> >> The hook would have two input arguments, insn mode and compare mode,
>> > > >> >> where the hook returns suggested supported compare mode, or no mode,
>> > > >> >> if it really can't handle requested modes.
>> > > >> >
>> > > >> > I think a two mode vcond pattern is in fact much cleaner than
>> > > >> > a one mode + modeless pattern which gen* will complain about and
>> > > >> > a target hook.
>> > > >>
>> > > >> OK, but in this case, do not use mode iterators too much in order to
>> > > >> avoid invalid patterns.
>> > > >
>> > > > I don't see them as "invalid". They will be unused (maybe combine
>> > > > would create them though?), but they have well-defined semantics
>> > > > with my proposed documentation. And x86 can handle them just fine.
>> > >
>> > > OK, let's go this way then... We can clean up this later if at all.
>> >
>> > Certainly what I prefer (less work for me now) ;) The smallest
>> > number of patterns would probably result from using vcond<mode><mode>
>> > to cover the same-mode cases and then add the 12 other patterns
>> > with the respective integer / float mode variant. Thus we'd have
>> > 15 patterns in total (still much for my taste).
>> >
>> > Ideally we could have a mode attribute that would map possibly
>> > to an iterator, thus
>> >
>> > (define_mode_attr matching [(V4SF ["V4SF" "V4SI"]) (V8HI "V8HI") ...])
>> >
>> > or similar. But I don't feel like adding this sort of mode
>> > attr that really is a hidden iterator ... ;)
>> >
>> > Thus, the following is the combined patch which bootstrapped and
>> > tested ok on x86_64-unknown-linux-gnu with {,-m32} over night,
>> > with the documentation for vcond added.
>> >
>> > Ok for trunk?
>>
>> I'm re-testing with the patterns having an extra condition like
>> && (GET_MODE_NUNITS (<V_256:MODE>mode)
>> == GET_MODE_NUNITS (<VF_256:MODE>mode))"
>> to have the HAVE_vcond* defines easily optimized.
>>
>> Ok?
>
> Ping. I'd like to have approval for the x86 changes.
OK.
Thanks,
Uros.
prev parent reply other threads:[~2011-09-02 12:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 15:08 Richard Guenther
2011-08-29 16:36 ` Richard Guenther
2011-08-29 20:47 ` Uros Bizjak
2011-08-29 21:05 ` Richard Guenther
2011-08-30 9:00 ` Uros Bizjak
2011-08-30 9:19 ` Richard Guenther
2011-08-30 9:24 ` Uros Bizjak
2011-08-30 9:29 ` Jakub Jelinek
2011-08-30 9:39 ` Richard Guenther
2011-08-30 9:42 ` Uros Bizjak
2011-08-30 10:17 ` Richard Guenther
2011-08-30 10:48 ` Uros Bizjak
2011-08-30 11:59 ` Richard Guenther
2011-08-30 12:11 ` Richard Guenther
2011-09-02 9:44 ` Richard Guenther
2011-09-02 12:19 ` Uros Bizjak [this message]
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='CAFULd4byQKFTnoRd+jaV9+R=8fUdjfshcdsBJnjoHRyUGxgr2Q@mail.gmail.com' \
--to=ubizjak@gmail.com \
--cc=artyom.shinkaroff@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=rguenther@suse.de \
--cc=rth@redhat.com \
--cc=uros@gcc.gnu.org \
/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).