From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6120 invoked by alias); 26 Nov 2002 20:42:55 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6113 invoked from network); 26 Nov 2002 20:42:54 -0000 Received: from unknown (HELO mms2.broadcom.com) (63.70.210.59) by sources.redhat.com with SMTP; 26 Nov 2002 20:42:54 -0000 Received: from 63.70.210.1mms2.broadcom.com with ESMTP (Broadcom MMS2 SMTP Relay (MMS v5.0)); Tue, 26 Nov 2002 12:40:15 -0800 X-Server-Uuid: 59F48136-7074-4F4B-B709-D7F3B6466DB0 Received: from mail-sj1-5.sj.broadcom.com (mail-sj1-5.sj.broadcom.com [10.16.128.236]) by mon-irva-11.broadcom.com (8.9.1/8.9.1) with ESMTP id MAA21885; Tue, 26 Nov 2002 12:42:44 -0800 (PST) Received: from dt-sj3-118.sj.broadcom.com (dt-sj3-118 [10.21.64.118]) by mail-sj1-5.sj.broadcom.com (8.12.4/8.12.4/SSF) with ESMTP id gAQKghER019353; Tue, 26 Nov 2002 12:42:43 -0800 (PST) Received: (from cgd@localhost) by dt-sj3-118.sj.broadcom.com ( 8.9.1/SJ8.9.1) id MAA03371; Tue, 26 Nov 2002 12:42:39 -0800 (PST) To: rsandifo@redhat.com cc: gdb-patches@sources.redhat.com Subject: Re: Simulation of MIPS recip and rsqrt instructions References: From: cgd@broadcom.com Date: Tue, 26 Nov 2002 12:42:00 -0000 In-Reply-To: rsandifo@redhat.com's message of "Tue, 26 Nov 2002 19:42:02 +0000 (UTC)" Message-ID: MIME-Version: 1.0 X-WSS-ID: 11FD03A51829-01-01 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00662.txt.bz2 At Tue, 26 Nov 2002 19:42:02 +0000 (UTC), "Richard Sandiford" wrote: > The mips simulator uses sim_fpu_inv() as a reciprocal function > but all it really does is negate the exponent. So we end up > calculating 1 / (x*2^y) as x*2^-y. This would appear to be my bad: In adding those calls to sim_fpu_inv() I did not notice the changes to sim_fpu_inv() in our source which replace its entire body with: #if 0 ... old body ... #else const sim_fpu sim_fpu_one = { sim_fpu_class_number, 0, IMPLICIT_1, 0 }; return sim_fpu_div (f, &sim_fpu_one, r, sim_fpu_round_default); #endif 8-) > Unfortunately, sim_fpu_inv isn't commented and cp1.c seems to be > its only active user. Which should change? For small values of only. 8-) common/cgen-accfp.c seems to use it as well for "invsf" and "invdf". I don't know whether the code in cgen-accfp.c is correct given the current definition of sim_fpu_inv(). I'd guess not. (The 'cgen/doc' information about "inv" that i could find ... makes me think the documentation there isn't complete. Certainly, it doesn't seem to match the sim-fpu.h code either...) My personal preference would be to fix sim_fpu_inv(). it seems more sensible to me. Anybody got a clue as to what the cgen-accfp.c 'invsf' and 'invdf' fns are supposed to do? chris