From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86102 invoked by alias); 29 Jun 2015 09:14:19 -0000 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 Received: (qmail 86091 invoked by uid 89); 29 Jun 2015 09:14:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f46.google.com Received: from mail-oi0-f46.google.com (HELO mail-oi0-f46.google.com) (209.85.218.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 29 Jun 2015 09:14:17 +0000 Received: by oigx81 with SMTP id x81so113539915oig.1 for ; Mon, 29 Jun 2015 02:14:15 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.135.202 with SMTP id pu10mr10968611obb.52.1435569254880; Mon, 29 Jun 2015 02:14:14 -0700 (PDT) Received: by 10.76.115.167 with HTTP; Mon, 29 Jun 2015 02:14:14 -0700 (PDT) In-Reply-To: References: <87pp4m8mkp.fsf@e105548-lin.cambridge.arm.com> <87egl1sa2p.fsf@e105548-lin.cambridge.arm.com> Date: Mon, 29 Jun 2015 09:16:00 -0000 Message-ID: Subject: Re: Remove redundant AND from count reduction loop From: Richard Biener To: Marc Glisse Cc: GCC Patches , richard.sandiford@arm.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg02053.txt.bz2 On Sun, Jun 28, 2015 at 1:45 PM, Marc Glisse wrote: > On Fri, 26 Jun 2015, Richard Biener wrote: > >>>>> OK. The reason I was being paranoid was that I couldn't see anywhere >>>>> where we enforced that the vector condition in a VEC_COND had to have >>>>> the same element width as the values being selected. >>>> >>>> >>>> >>>> We don't require that indeed. >>>> >>>>> tree-cfg.c >>>>> only checks that rhs2 and rhs3 are compatible with the result. >>>>> There doesn't seem to be any checking of rhs1 vs. the other types. >>>>> So I wasn't sure whether anything stopped us from, e.g., comparing two >>>>> V4HIs and using the result to select between two V4SIs. >>>> >>>> >>>> >>>> Nothing does (or should). >>> >>> >>> >>> The documentation patch you approved in >>> https://gcc.gnu.org/ml/gcc-patches/2012-10/msg01109.html says something >>> different. If it is really wrong, could you fix it? >> >> >> Hmm, that simplifies things. > > > On the other hand, vectors of bools could be (I haven't thought about it > much) nice to have, especially for avx512 (and at least one other arch, > maybe sparc). > >> It would be nice if these constraints would also be checked in the gimple >> verifier... > > > This passed bootstrap+testsuite on powerpc64le-unknown-linux-gnu. Ok. Thanks, Richard. > 2015-06-29 Marc Glisse > > * tree-cfg.c (verify_gimple_assign_ternary) : Check > the first argument. > > -- > Marc Glisse > Index: gcc/tree-cfg.c > =================================================================== > --- gcc/tree-cfg.c (revision 225104) > +++ gcc/tree-cfg.c (working copy) > @@ -4001,8 +4001,22 @@ > } > break; > > + case VEC_COND_EXPR: > + if (!VECTOR_INTEGER_TYPE_P (rhs1_type) > + || TYPE_SIGN (rhs1_type) != SIGNED > + || TYPE_SIZE (rhs1_type) != TYPE_SIZE (lhs_type) > + || TYPE_VECTOR_SUBPARTS (rhs1_type) > + != TYPE_VECTOR_SUBPARTS (lhs_type)) > + { > + error ("the first argument of a VEC_COND_EXPR must be of a signed > " > + "integral vector type of the same size and number of " > + "elements as the result"); > + debug_generic_expr (lhs_type); > + debug_generic_expr (rhs1_type); > + return true; > + } > + /* Fallthrough. */ > case COND_EXPR: > - case VEC_COND_EXPR: > if (!useless_type_conversion_p (lhs_type, rhs2_type) > || !useless_type_conversion_p (lhs_type, rhs3_type)) > { >