From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60430 invoked by alias); 8 Feb 2016 21:07: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 60419 invoked by uid 89); 8 Feb 2016 21:07:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=carry X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 08 Feb 2016 21:07:49 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id E9F7E7AE80; Mon, 8 Feb 2016 21:07:47 +0000 (UTC) Received: from bigtime.twiddle.net (ovpn-113-48.phx2.redhat.com [10.3.113.48]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u18L7kUV025542; Mon, 8 Feb 2016 16:07:46 -0500 Subject: Re: [PATCH, gcc7, aarch64] Add arithmetic overflow patterns To: Michael Collison , "gcc-patches@gcc.gnu.org" References: <56A9E47D.4030808@linaro.org> <56AA5597.2090600@redhat.com> <56B688A6.1020302@linaro.org> From: Richard Henderson Message-ID: <56B903A0.5000701@redhat.com> Date: Mon, 08 Feb 2016 21:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B688A6.1020302@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00597.txt.bz2 On 02/07/2016 10:58 AM, Michael Collison wrote: > Richard, > > One other question on the patch. I note that when you expand the addv and uaddv > patterns you emit rtl using gen_add3_compareV and en_add3_compareC > respectively. These patterns use sign_extend and zero_extend respectively. Why > do you not do the same thing for the subv and usubv patterns? The subv patterns > expand into calls to gen_sub3_compare1 which does not emit sign or zero > extends. Why the difference? The canonical "compare" is a subtraction. Thus if we want the flag bits off of a subtraction, we only need issue a compare. We only have to do something special if the flag bits aren't the same as a subtract. E.g. for addition, where the carry and overflow flags are (logically) reversed from that of subtraction. r~