From patchwork Sat Jun 8 21:32:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 33059 Received: (qmail 115684 invoked by alias); 8 Jun 2019 21:33:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 115600 invoked by uid 89); 8 Jun 2019 21:33:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Spam-Relays-External:209.85.215.194, H*RU:209.85.215.194, H*r:sk:mail-pg, HX-Spam-Relays-External:sk:mail-pg X-HELO: mail-pg1-f194.google.com Received: from mail-pg1-f194.google.com (HELO mail-pg1-f194.google.com) (209.85.215.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Jun 2019 21:32:58 +0000 Received: by mail-pg1-f194.google.com with SMTP id 196so2971965pgc.6; Sat, 08 Jun 2019 14:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ujuyNlKSIOI3L3wLfD607tFhlYjymUiHSB66SYaaLqQ=; b=n/86z+qaJk8aMPvUiZu8w/XB4+1eWn1Eg27yiMBxe9d8ZBbck2ieBGga6sWgvN8bVv rFoNoO3kgLCKSb4Ec+VBcw2oS48YNKtERcdcA6jlzdXp0XIk8Mo8hv/OjLDkvA9yR0Ts WcfMFtt4mQ9gHQDWd5lb73gOq6bvq6f1gfiYDf1sSRVzW25adcmBwy82QYjgUW3zwCdj i8Xp1K8gNVrqn3odl+0mE/p8toG7dRd8d1kPBZxg43JQB/90B1dvv1QchqzLOO/doelN Dp1aJAQjQeu2+YoTyUOR8nQojoZhOpdEl0iulZVw1ipsB2mSRTZvV7ksN272jNRZUw23 z2Og== Return-Path: Received: from localhost (g30.211-19-85.ppp.wakwak.ne.jp. [211.19.85.30]) by smtp.gmail.com with ESMTPSA id l1sm6115870pgj.67.2019.06.08.14.32.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 08 Jun 2019 14:32:56 -0700 (PDT) From: Stafford Horne To: GDB patches , GNU Binutils Cc: Andrey Bacherov , Nick Clifton , Andrew Burgess , Richard Henderson , Openrisc , Stafford Horne Subject: [PATCH v3 07/11] sim/common: Wire in df/di conversion Date: Sun, 9 Jun 2019 06:32:23 +0900 Message-Id: <20190608213225.3230-8-shorne@gmail.com> In-Reply-To: <20190608213225.3230-1-shorne@gmail.com> References: <20190608213225.3230-1-shorne@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes Up until now these have not been used in any CGEN targets, add them as they are now used by OpenRISC. sim/common/ChangeLog: * cgen-accfp.c (floatdidf, fixdfdi): New functions. (cgen_init_accurate_fpu): Add floatdidf and fixdfdi. --- Changes since v2: - none sim/common/cgen-accfp.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sim/common/cgen-accfp.c b/sim/common/cgen-accfp.c index 5d600c6e41..51f5a29fe2 100644 --- a/sim/common/cgen-accfp.c +++ b/sim/common/cgen-accfp.c @@ -349,6 +349,17 @@ floatsidf (CGEN_FPU* fpu, int how UNUSED, SI x) return res; } +static DF +floatdidf (CGEN_FPU* fpu, int how UNUSED, DI x) +{ + sim_fpu ans; + unsigned64 res; + + sim_fpu_i64to (&ans, x, sim_fpu_round_near); + sim_fpu_to64 (&res, &ans); + return res; +} + static SF ufloatsisf (CGEN_FPU* fpu, int how UNUSED, USI x) { @@ -382,6 +393,17 @@ fixdfsi (CGEN_FPU* fpu, int how UNUSED, DF x) return res; } +static DI +fixdfdi (CGEN_FPU* fpu, int how UNUSED, DF x) +{ + sim_fpu op1; + unsigned64 res; + + sim_fpu_64to (&op1, x); + sim_fpu_to64i (&res, &op1, sim_fpu_round_near); + return res; +} + static USI ufixsfsi (CGEN_FPU* fpu, int how UNUSED, SF x) { @@ -739,8 +761,10 @@ cgen_init_accurate_fpu (SIM_CPU* cpu, CGEN_FPU* fpu, CGEN_FPU_ERROR_FN* error) o->ftruncdfsf = ftruncdfsf; o->floatsisf = floatsisf; o->floatsidf = floatsidf; + o->floatdidf = floatdidf; o->ufloatsisf = ufloatsisf; o->fixsfsi = fixsfsi; o->fixdfsi = fixdfsi; + o->fixdfdi = fixdfdi; o->ufixsfsi = ufixsfsi; }