From nobody Sat May 18 23:44:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1571229436; cv=none; d=zoho.com; s=zohoarc; b=fb4Yq63FI0jygwcqlnO6xA+VMZElkSspwwS1CsQWMzfmlA7OETrIl1JtnV4LHAcefdi63HwEIPcjT6gNMq7dnrtw2lEu/Ydy/Dv2hrKRABZwNmj3SXxpnC3VEkCBgf0Sl9HhHmCjpLOv6Cc1swvYc4TZwazkS3/VCfM6rvi/N3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571229436; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=njoNNWBYWnP65MXy9y8gi6F0AG8Gr7AQpyOUDt/4p3g=; b=UNkRNTnWhqhSzOt7FAYe/nNZH54kD0+DDfHgcVrRRSv1BG2aXm/ITj709rT38dO9BCc0WvOf7U+D8EQnOZcr5Hn+ePnKxwEsNfNDNXcpuKFyz7hzqpje3/55nG38hxYCi0IVg/eiWTwrzj8rpatNHk6D1eOSb2dwaExwifxph1w= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571229436148396.23294486395446; Wed, 16 Oct 2019 05:37:16 -0700 (PDT) Received: from localhost ([::1]:42264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKiYE-0002Kq-QW for importer@patchew.org; Wed, 16 Oct 2019 08:37:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38337) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKdoH-0001Lu-9h for qemu-devel@nongnu.org; Wed, 16 Oct 2019 03:33:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKdoG-0007d6-3H for qemu-devel@nongnu.org; Wed, 16 Oct 2019 03:33:29 -0400 Received: from mail.tachyum.com ([66.160.133.170]:48174) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iKdoF-0007cl-UD for qemu-devel@nongnu.org; Wed, 16 Oct 2019 03:33:28 -0400 Received: from THQ-IP-EX1.tachyum.com (relayhost.tachyum.com [10.7.1.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.tachyum.com (Postfix) with ESMTPS id BEEA919F; Wed, 16 Oct 2019 00:36:30 -0700 (PDT) Received: from tachyum-sk-server.tachyum.com (10.7.241.13) by THQ-IP-EX1.tachyum.com (10.7.1.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1779.2; Wed, 16 Oct 2019 00:33:24 -0700 From: Matus Kysel To: Subject: [PATCH] Added hardfloat conversion from float32 to float64 Date: Wed, 16 Oct 2019 09:32:40 +0200 Message-ID: <20191016073240.12473-1-mkysel@tachyum.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.7.241.13] X-ClientProxiedBy: THQ-IP-EX1.tachyum.com (10.7.1.6) To THQ-IP-EX1.tachyum.com (10.7.1.6) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.160.133.170 X-Mailman-Approved-At: Wed, 16 Oct 2019 08:35:10 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno , Matus Kysel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Reintroduce float32_to_float64 that was removed here: https://lists.gnu.org/archive/html/qemu-devel/2018-04/msg00455.html - nbench test it not actually calling this function at all - SPECS 2006 significat number of tests impoved their runtime, just few of them showed small slowdown Signed-off-by: Matus Kysel --- fpu/softfloat.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 0638c9f4e0..e28ea3f933 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1920,13 +1920,26 @@ float16 float32_to_float16(float32 a, bool ieee, fl= oat_status *s) return float16a_round_pack_canonical(pr, s, fmt16); } =20 -float64 float32_to_float64(float32 a, float_status *s) +static float64 QEMU_SOFTFLOAT_ATTR +soft_float32_to_float64(float32 a, float_status *s) { FloatParts p =3D float32_unpack_canonical(a, s); FloatParts pr =3D float_to_float(p, &float64_params, s); return float64_round_pack_canonical(pr, s); } =20 +float64 float32_to_float64(float32 a, float_status *status) +{ + if (unlikely(!float32_is_normal(a))) { + return soft_float32_to_float64(a, status); + } else if (float32_is_zero(a)) { + return float64_set_sign(float64_zero, float32_is_neg(a)); + } else { + double r =3D *(float *)&a; + return *(float64 *)&r; + } +} + float16 float64_to_float16(float64 a, bool ieee, float_status *s) { const FloatFmt *fmt16 =3D ieee ? &float16_params : &float16_params_ahp; --=20 2.17.1