From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104214 invoked by alias); 7 Oct 2017 16:01:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 103974 invoked by uid 89); 7 Oct 2017 16:01:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Arent, Aren't X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 07 Oct 2017 16:01:06 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v97G0uxu029252 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 7 Oct 2017 12:01:00 -0400 Received: from [10.0.0.11] (cable-192.222.251.162.electronicbox.net [192.222.251.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A05681E515; Sat, 7 Oct 2017 12:00:55 -0400 (EDT) Subject: Re: [PATCH v5 2/6] sim: cgen: add MUL2OFSI and MUL1OFSI macros (needed for OR1K l.mul[u]) To: Stafford Horne , GDB patches Cc: Openrisc , Mike Frysinger , Peter Gavin References: <20171005134912.26799-1-shorne@gmail.com> <20171005134912.26799-3-shorne@gmail.com> From: Simon Marchi Message-ID: Date: Sat, 07 Oct 2017 16:01:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171005134912.26799-3-shorne@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 7 Oct 2017 16:00:56 +0000 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00151.txt.bz2 On 2017-10-05 09:49 AM, Stafford Horne wrote: > From: Peter Gavin > > sim/common/ChangeLog: > > 2012-03-14 Peter Gavin > > * cgen-ops.h (MUL2OFSI): New macro, 1's complement overflow. > (MUL1OFSI): New macro, 2's complement overflow. Macro? Aren't they functions? > --- > sim/common/cgen-ops.h | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h > index 97585d7943..ffbdf3fd6e 100644 > --- a/sim/common/cgen-ops.h > +++ b/sim/common/cgen-ops.h > @@ -631,6 +631,22 @@ SUBOFQI (QI a, QI b, BI c) > return res; > } > > +SEMOPS_INLINE BI > +MUL2OFSI (SI a, SI b) > +{ > + DI tmp = MULDI (EXTSIDI(a), EXTSIDI(b)); Add spaces before the parentheses. > + BI res = tmp < -0x80000000LL || tmp > 0x7fffffffLL; > + return res; > +} > + > +SEMOPS_INLINE BI > +MUL1OFSI (USI a, USI b) > +{ > + UDI tmp = MULDI (ZEXTSIDI(a), ZEXTSIDI(b)); Here too. Otherwise, this patch makes sense to me. Simon