From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6405 invoked by alias); 2 Sep 2011 12:19:36 -0000 Received: (qmail 6388 invoked by uid 22791); 2 Sep 2011 12:19:34 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Sep 2011 12:19:11 +0000 Received: by ywa12 with SMTP id 12so2178348ywa.20 for ; Fri, 02 Sep 2011 05:19:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.199.100 with SMTP id jj4mr2005349pbc.270.1314965950178; Fri, 02 Sep 2011 05:19:10 -0700 (PDT) Received: by 10.143.13.8 with HTTP; Fri, 2 Sep 2011 05:19:09 -0700 (PDT) In-Reply-To: References: <20110830090713.GG2687@tyan-ft48-01.lab.bos.redhat.com> Date: Fri, 02 Sep 2011 12:19:00 -0000 Message-ID: Subject: Re: [PATCH] Change vcond to vcond From: Uros Bizjak To: Richard Guenther Cc: Jakub Jelinek , gcc-patches@gcc.gnu.org, uros@gcc.gnu.org, rth@redhat.com, artyom.shinkaroff@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00138.txt.bz2 On Fri, Sep 2, 2011 at 11:43 AM, Richard Guenther wrote: >> > > >> >> > Hmm. =A0But then I'd have to try emit an insn, right? =A0Cur= rently >> > > >> >> > 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? =A0If it succeds I'd have to delete emitted insns, et= c. >> > > >> >> > 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. IM= O, this >> > > >> >> is much more flexible than checking optab for supported modes. >> > > >> >> Existing way is appropriate for single mode patterns, but we h= ave >> > > >> >> 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". =A0They will be unused (maybe combi= ne >> > > > would create them though?), but they have well-defined semantics >> > > > with my proposed documentation. =A0And x86 can handle them just fi= ne. >> > > >> > > 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) ;) =A0The smallest >> > number of patterns would probably result from using vcond >> > to cover the same-mode cases and then add the 12 other patterns >> > with the respective integer / float mode variant. =A0Thus 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. =A0But 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 >> =A0 =A0&& (GET_MODE_NUNITS (mode) >> =A0 =A0 =A0 =A0=3D=3D GET_MODE_NUNITS (mode))" >> to have the HAVE_vcond* defines easily optimized. >> >> Ok? > > Ping. =A0I'd like to have approval for the x86 changes. OK. Thanks, Uros.