From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64255 invoked by alias); 4 Sep 2017 20:32:47 -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 64238 invoked by uid 89); 4 Sep 2017 20:32:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=usi, udi, H*Ad:U*vapier 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; Mon, 04 Sep 2017 20:32:41 +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 v84KWYSs007901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 4 Sep 2017 16:32:39 -0400 Received: by simark.ca (Postfix, from userid 112) id 463091E974; Mon, 4 Sep 2017 16:32:34 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id B78101E974; Mon, 4 Sep 2017 16:32:29 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 04 Sep 2017 20:32:00 -0000 From: Simon Marchi To: Stafford Horne Cc: GDB patches , Openrisc , Mike Frysinger , Peter Gavin Subject: Re: [PATCH v4 2/5] sim: cgen: add MUL2OFSI and MUL1OFSI macros (needed for OR1K l.mul[u]) In-Reply-To: <700407e5797b8b9b9f76b2dba026d1b06978987b.1496066478.git.shorne@gmail.com> References: <700407e5797b8b9b9f76b2dba026d1b06978987b.1496066478.git.shorne@gmail.com> Message-ID: <928e7c188eeeff635bc129ba7042d21b@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 4 Sep 2017 20:32:34 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00068.txt.bz2 > --- 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)); > + BI res = tmp < -0x80000000LL || tmp > 0x7fffffffLL; > + return res; > +} > + > +SEMOPS_INLINE BI > +MUL1OFSI (USI a, USI b) > +{ > + UDI tmp = MULDI (ZEXTSIDI(a), ZEXTSIDI(b)); > + BI res = (tmp > 0xFFFFFFFFULL); > + return res; > +} What are these functions expected to return? They seem to return 1 when the result would overflow 32-bits, but just to be sure. Simon