From patchwork Sun Mar 31 00:40:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 32097 Received: (qmail 91938 invoked by alias); 31 Mar 2019 00:41:10 -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 91868 invoked by uid 89); 31 Mar 2019 00:41:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 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=cgen, HX-Spam-Relays-External:sk:mail-pf, H*r:sk:mail-pf, HX-HELO:sk:mail-pf X-HELO: mail-pf1-f169.google.com Received: from mail-pf1-f169.google.com (HELO mail-pf1-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 31 Mar 2019 00:41:07 +0000 Received: by mail-pf1-f169.google.com with SMTP id c207so2778227pfc.7 for ; Sat, 30 Mar 2019 17:41:07 -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=TqOZyC9bZzLHD9/ovRoPTYZuok6OlqIJL/t79UkgEuQ=; b=WPqDDhevYylL4SkDXIM6W6lirlRt/4GQtkIRXLWxiUf6KInD2KK+e75Be+TYzz5Cm5 2xieacXvnaEX0bDRgCRiAHLeoFW9LzrJkLUHm9xrOHZayX+Em1XhMyNl9be1dwiGT46d F3Q0BlpImmjQ67aShHgbSGxLi5wD/5FFIsaUmBiaYvRGMpc+ytBJcjCG5ABCrZIwmx2v 48VzMM/8AuXmznq2xdCuNesIl2Da8f1vFGlw0gI3gtdPW2Jdo7NySB1suI8mC+YgV1DJ 1bsG6kTIVtnP6k4FnDEnnexlHXomwCdD1RmHelnO9f/r7QA/P+xg7aB9wjVAXc/2nvOg AHuw== Return-Path: Received: from localhost (g191.61-115-60.ppp.wakwak.ne.jp. [61.115.60.191]) by smtp.gmail.com with ESMTPSA id t190sm10817721pfb.33.2019.03.30.17.41.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Mar 2019 17:41:05 -0700 (PDT) From: Stafford Horne To: GDB patches Cc: Andrey Bacherov , Openrisc , Stafford Horne Subject: [PATCH 4/6] sim/common: Wire in df/di conversion Date: Sun, 31 Mar 2019 09:40:40 +0900 Message-Id: <20190331004042.12172-5-shorne@gmail.com> In-Reply-To: <20190331004042.12172-1-shorne@gmail.com> References: <20190331004042.12172-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. --- 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; }