From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129428 invoked by alias); 1 Sep 2017 07:57:29 -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 114573 invoked by uid 89); 1 Sep 2017 07:57:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=conclusion 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; Fri, 01 Sep 2017 07:57:22 +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 v817vF9d017508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 1 Sep 2017 03:57:20 -0400 Received: by simark.ca (Postfix, from userid 112) id DC3571EA26; Fri, 1 Sep 2017 03:57:15 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id ED8CE1E5DA; Fri, 1 Sep 2017 03:56:54 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 01 Sep 2017 07:57:00 -0000 From: Simon Marchi To: Stafford Horne Cc: GDB patches , Openrisc , Mike Frysinger , Peter Gavin Subject: Re: [PATCH v4 1/5] sim: cgen: add remainder functions (needed for OR1K lf.rem.[sd]) In-Reply-To: <20170831223321.GE2609@lianli.shorne-pla.net> References: <643da7dcb7d9913a1b239f3aae0ebaebb85a00d7.1496066478.git.shorne@gmail.com> <20170831223321.GE2609@lianli.shorne-pla.net> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 1 Sep 2017 07:57:16 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00003.txt.bz2 On 2017-09-01 00:33, Stafford Horne wrote: >> I can't tell for sure because I'm not maintainer of sim/, but I >> suppose that >> we would need a proper implementation that doesn't use the host fpu >> here. > > Right, as mentioned in the summary, this is the one place that is a bit > controversial. > > I was thinking its kind of strange to not allow using libmath, since > integer math runs on the host system, why not FPU as well? > (probably to implement this I would just copy from libmath in the end:) That was just my conclusion after reading the comment in sim-fpu.h: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=sim/common/sim-fpu.h;h=d27d80a513aa8d996a7b4c6af53fde31dcb8dad7;hb=HEAD#l54 It is easy for floating point unit implementations to return wrong or slightly different results. Integer math is more consistent. > https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/ieee754/dbl-64/e_remainder.c;hb=HEAD > > There are actually no OpenRISC cores that implement the remainder > instruction (as its a bit complicated to do in hardware and not really > used > much). I could remove it if the implementation is beyond the scope of > this > series. Indeed, it can always be contributed later. Simon