From patchwork Tue Apr 9 21:39: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: 32234 Received: (qmail 41162 invoked by alias); 9 Apr 2019 21:39:58 -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 41097 invoked by uid 89); 9 Apr 2019 21:39:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.2 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:sk:mail-pf, H*r:sk:mail-pf, HX-HELO:sk:mail-pf, H*RU:sk:mail-pf X-HELO: mail-pf1-f174.google.com Received: from mail-pf1-f174.google.com (HELO mail-pf1-f174.google.com) (209.85.210.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Apr 2019 21:39:56 +0000 Received: by mail-pf1-f174.google.com with SMTP id 8so54149pfr.4; Tue, 09 Apr 2019 14:39:56 -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=Y3xIpob8MvPPwYKlhST+cm2ahXoO9KgiEFX/EnfDvjsiKO4bxdnjCQTGDeQfbJaCkP /KbAFqXLPtTTpNIRjzQmCX2UxlAtW+RDqooCb0u1H+cRyeGkxC28prC4Qo7w2QfjEvv+ yYoeW5odMHBTWOjanKfrr2RjH9Ib1Rbct2K0jTs7DN1Nxay9oLxQ3V7mGroVNsTvM5A4 +QcZS3JrmgaEME2Eh8b2GAeNpRbG1KJ+hyoleCVje8fHdJ8d7RYS8q3KvNbKoimLnnW6 QojJbqCX2fQHtNMAKH2CdO8CUVngf0BCXGPUbGFMHutLpK3VUB0O9OyG2L0jJQ2cvpe6 qfBg== Return-Path: Received: from localhost (g191.61-115-60.ppp.wakwak.ne.jp. [61.115.60.191]) by smtp.gmail.com with ESMTPSA id s21sm11700535pfm.3.2019.04.09.14.39.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 14:39:54 -0700 (PDT) From: Stafford Horne To: GDB patches , GNU Binutils Cc: Andrey Bacherov , Openrisc , Stafford Horne Subject: [PATCH v2 4/6] sim/common: Wire in df/di conversion Date: Wed, 10 Apr 2019 06:39:23 +0900 Message-Id: <20190409213925.32699-5-shorne@gmail.com> In-Reply-To: <20190409213925.32699-1-shorne@gmail.com> References: <20190409213925.32699-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; }