From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118416 invoked by alias); 13 Oct 2015 15:59:50 -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 118387 invoked by uid 89); 13 Oct 2015 15:59:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f174.google.com Received: from mail-ig0-f174.google.com (HELO mail-ig0-f174.google.com) (209.85.213.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 13 Oct 2015 15:59:48 +0000 Received: by igkz10 with SMTP id z10so19784919igk.1 for ; Tue, 13 Oct 2015 08:59:46 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.66.197 with SMTP id h5mr20701405igt.21.1444751986052; Tue, 13 Oct 2015 08:59:46 -0700 (PDT) Received: by 10.36.122.14 with HTTP; Tue, 13 Oct 2015 08:59:45 -0700 (PDT) In-Reply-To: <561D2659.7050600@redhat.com> References: <20151002140449.GG26618@msticlxl57.ims.intel.com> <561828E4.6070905@redhat.com> <20151013141433.GM63757@msticlxl57.ims.intel.com> <561D2659.7050600@redhat.com> Date: Tue, 13 Oct 2015 15:59:00 -0000 Message-ID: Subject: Re: [Boolean Vector, patch 3/5] Use boolean vector in C/C++ FE From: Ilya Enkovich To: Jeff Law Cc: gcc-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg01274.txt.bz2 2015-10-13 18:42 GMT+03:00 Jeff Law : > On 10/13/2015 08:14 AM, Ilya Enkovich wrote: >>>> >>>> + >>>> +static tree >>>> +build_vec_cmp (tree_code code, tree type, >>>> + tree arg0, tree arg1) >>>> +{ >>>> + tree zero_vec = build_zero_cst (type); >>>> + tree minus_one_vec = build_minus_one_cst (type); >>>> + tree cmp_type = build_same_sized_truth_vector_type (type); >>>> + tree cmp = build2 (code, cmp_type, arg0, arg1); >>>> + return build3 (VEC_COND_EXPR, type, cmp, minus_one_vec, zero_vec); >>>> +} >>> >>> Isn't this implementation the same for C & C++? Does it make sense to >>> put >>> it in c-family/c-common.c? >> >> >> C++ version calls fold_if_not_in_template for generated comparison. It is >> required there to successfully recognize vector MIN, MAX and ABS templates >> for vector ?: conditional operator. Vector form of ?: conditional operator >> is supported for C++ only. > > Ah, nevermind then. > > >>> >>> However, more generally, do we need to do anything for the other >>> languages? >> >> >> Looking into that I got an impression vector modes are used by C/C++ >> vector extensions only. And I think regression testing would reveal some >> failures otherwise. > > Maybe this stuff hasn't bled into the Fortran front-end, but the gfortran > front-end certainly has OpenMP support which presumably has vector > extensions. OpenMP extension doesn't produce any vector code in front-end. Code will be produced by vectorizer anyway. > > The fact that nothing's failing in the testsuite is encouraging, but it'd be > worth spending a few minutes taking a look to see if there's something that > might need updating. I also grepped for VEC_COND_EXPR and it never occurs in front-ends other than C/C++. Thanks, Ilya > > Jeff >