From patchwork Thu Nov 5 12:21:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 540402 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D096C14030D for ; Thu, 5 Nov 2015 23:22:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=er/WX28l; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=ZUahMpmdgn44j86bA E4ajygc2SX624BtFFF1bOXNScBlcC6kTJthKWagIh/HIpuNLSbD6ucyKetVe7ALY pIUcjT7vVeu20angWccJqI9rmiHHfeuM2oIV93MWvPact59NX6nqaGUXWQQjFRXz fI44/OsQ2hekRvCuLmqszmoyPg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=nGZ7UCtymKQ+mFoLI6upNgb BuFU=; b=er/WX28lcf/JgKKoufyZlI/tniOTP2Zh/Be/g9FT8ViL99xNnUvzKKS Mi4uT5IGJrYc3wUF5OacqdhMgppS4Zl5t3yqEsb3QuKCXtWJGLalgOi61tvGwYZi KncFXXz+e9ThF8KPZvL8fRnrhHC7SIF/N8gHUUw+0NfSMGluYTgE= Received: (qmail 29749 invoked by alias); 5 Nov 2015 12:22:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29723 invoked by uid 89); 5 Nov 2015 12:22:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wm0-f45.google.com Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com) (74.125.82.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 05 Nov 2015 12:22:06 +0000 Received: by wmll128 with SMTP id l128so10574143wml.0 for ; Thu, 05 Nov 2015 04:22:03 -0800 (PST) X-Received: by 10.28.18.11 with SMTP id 11mr3200599wms.68.1446726123024; Thu, 05 Nov 2015 04:22:03 -0800 (PST) Received: from msticlxl57.ims.intel.com (jfdmzpr06-ext.jf.intel.com. [134.134.137.75]) by smtp.gmail.com with ESMTPSA id m137sm33869942wmb.2.2015.11.05.04.22.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Nov 2015 04:22:02 -0800 (PST) Date: Thu, 5 Nov 2015 15:21:29 +0300 From: Ilya Enkovich To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH] Fix c-c++-common/torture/vector-compare-1.c on powerpc Message-ID: <20151105122129.GA25378@msticlxl57.ims.intel.com> References: <20151029134205.GA18424@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On 29 Oct 15:29, Richard Biener wrote: > > I think this should unconditionally produce the COND_EXPR and > build cst_true using build_all_ones_cst (stype). > > Ok with that change. > > Thanks, > Richard. > Here is an updated patch version. Bootstrapped and regtested on powerpc64le-unknown-linux-gnu and x86_64-unknown-linux-gnu. Applied to trunk. Thanks, Ilya --- gcc/ 2015-11-05 Ilya Enkovich * tree-vect-generic.c (do_compare): Use -1 for true result instead of 1. diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index d0a4e0f..b59f699 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -161,10 +161,16 @@ static tree do_compare (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b, tree bitpos, tree bitsize, enum tree_code code, tree type) { + tree stype = TREE_TYPE (type); + tree cst_false = build_zero_cst (stype); + tree cst_true = build_all_ones_cst (stype); + tree cmp; + a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos); b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos); - return gimplify_build2 (gsi, code, TREE_TYPE (type), a, b); + cmp = build2 (code, boolean_type_node, a, b); + return gimplify_build3 (gsi, COND_EXPR, stype, cmp, cst_true, cst_false); } /* Expand vector addition to scalars. This does bit twiddling