From nobody Mon Feb 9 08:42:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151680014261250.714908992098685; Wed, 24 Jan 2018 05:22:22 -0800 (PST) Received: from localhost ([::1]:48446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeL0M-0001iV-P5 for importer@patchew.org; Wed, 24 Jan 2018 08:22:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeKrq-0003LT-Ao for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:13:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeKro-0003rH-BP for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:13:30 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:42555) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeKro-0003q5-2F for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:13:28 -0500 Received: by mail-wm0-x243.google.com with SMTP id r71so8474318wmd.1 for ; Wed, 24 Jan 2018 05:13:28 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x18sm2363933wrg.82.2018.01.24.05.13.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 05:13:21 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 688773E09C2; Wed, 24 Jan 2018 13:13:16 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mxxgOfnozx7cvpkKXjRfz6cqqxRGu0Az+qLPzYygsUA=; b=Nb3YXWYOknt2iNzqr8cU0ZJaxQj08oMox52AC+6tbq1ZeKa8ggpXjxo/VM4BMSSjNG v7vyq142tk1Rb39m7k28BlRh5rBhgF1c4HhEt9rsGqSSD1yAbmz2rlCn0H2FaZDkyX8q 5M26vZ0KqP9WuiSV7lX+GeCHvd4GVLYh129i0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mxxgOfnozx7cvpkKXjRfz6cqqxRGu0Az+qLPzYygsUA=; b=AX6ME/HNIeZMi83n6vQ90wwB8q7McggOeSCbrbVFcsnHZcAE6OiJIQQpWQ0yEujOgi 48/u1PfJbt+eiEXFXsqWu/XXYqKvWZs2OPTvZr0oLVnhYjONXJ1EAYif9BA4E3Gy+/Bb 38nLPkGj14c8qPBAEq/sgIM8dIWMKvxOME/fxV7qTgXgjMZrN3iX5Oza4VR0jlR2G9LX bfD9XoQo7mrv0YAq4OnMIX9Jee/jp4iyLF3Oa7kbV0s5TemSiGZlb6EO2FI/4BCMwEV3 hC/NZKipufXu3F8+SbChLEz04A/trUYlMj1TIF+MT08ZOjcXUbDEHc+UJ/F6JJSW/H9H Ytfw== X-Gm-Message-State: AKwxyte5l4Vh2xhfZ4RAzoj4PVI5DU5mIgX6BiYweyvU2oIkvWNy9yJG LYHXsBTA0r6DQQyEjfxIh8DNIw== X-Google-Smtp-Source: AH8x227l1dSCtFzZmd+tRpsiEy/W3UWT0SEjfpC5+1tBDHnTCwxVtkj9l3e5szO/2wdAowD9fy/jfw== X-Received: by 10.28.167.215 with SMTP id q206mr4715069wme.48.1516799606922; Wed, 24 Jan 2018 05:13:26 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: richard.henderson@linaro.org, peter.maydell@linaro.org, laurent@vivier.eu, bharata@linux.vnet.ibm.com, andrew@andrewdutcher.com Date: Wed, 24 Jan 2018 13:13:03 +0000 Message-Id: <20180124131315.30567-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180124131315.30567-1-alex.bennee@linaro.org> References: <20180124131315.30567-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH v3 10/22] fpu/softfloat: move the extract functions to the top of the file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 This is pure code-motion during re-factoring as the helpers will be needed earlier. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- v2 - fix minor white space nit --- fpu/softfloat.c | 120 +++++++++++++++++++++++++---------------------------= ---- 1 file changed, 54 insertions(+), 66 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 3a4ab1355f..297e48f5c9 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -132,6 +132,60 @@ static inline flag extractFloat16Sign(float16 a) return float16_val(a)>>15; } =20 +/*------------------------------------------------------------------------= ---- +| Returns the fraction bits of the single-precision floating-point value `= a'. +*-------------------------------------------------------------------------= ---*/ + +static inline uint32_t extractFloat32Frac(float32 a) +{ + return float32_val(a) & 0x007FFFFF; +} + +/*------------------------------------------------------------------------= ---- +| Returns the exponent bits of the single-precision floating-point value `= a'. +*-------------------------------------------------------------------------= ---*/ + +static inline int extractFloat32Exp(float32 a) +{ + return (float32_val(a) >> 23) & 0xFF; +} + +/*------------------------------------------------------------------------= ---- +| Returns the sign bit of the single-precision floating-point value `a'. +*-------------------------------------------------------------------------= ---*/ + +static inline flag extractFloat32Sign(float32 a) +{ + return float32_val(a) >> 31; +} + +/*------------------------------------------------------------------------= ---- +| Returns the fraction bits of the double-precision floating-point value `= a'. +*-------------------------------------------------------------------------= ---*/ + +static inline uint64_t extractFloat64Frac(float64 a) +{ + return float64_val(a) & LIT64(0x000FFFFFFFFFFFFF); +} + +/*------------------------------------------------------------------------= ---- +| Returns the exponent bits of the double-precision floating-point value `= a'. +*-------------------------------------------------------------------------= ---*/ + +static inline int extractFloat64Exp(float64 a) +{ + return (float64_val(a) >> 52) & 0x7FF; +} + +/*------------------------------------------------------------------------= ---- +| Returns the sign bit of the double-precision floating-point value `a'. +*-------------------------------------------------------------------------= ---*/ + +static inline flag extractFloat64Sign(float64 a) +{ + return float64_val(a) >> 63; +} + /*------------------------------------------------------------------------= ---- | Takes a 64-bit fixed-point value `absZ' with binary point between bits 6 | and 7, and returns the properly rounded 32-bit integer corresponding to = the @@ -299,39 +353,6 @@ static int64_t roundAndPackUint64(flag zSign, uint64_t= absZ0, return absZ0; } =20 -/*------------------------------------------------------------------------= ---- -| Returns the fraction bits of the single-precision floating-point value `= a'. -*-------------------------------------------------------------------------= ---*/ - -static inline uint32_t extractFloat32Frac( float32 a ) -{ - - return float32_val(a) & 0x007FFFFF; - -} - -/*------------------------------------------------------------------------= ---- -| Returns the exponent bits of the single-precision floating-point value `= a'. -*-------------------------------------------------------------------------= ---*/ - -static inline int extractFloat32Exp(float32 a) -{ - - return ( float32_val(a)>>23 ) & 0xFF; - -} - -/*------------------------------------------------------------------------= ---- -| Returns the sign bit of the single-precision floating-point value `a'. -*-------------------------------------------------------------------------= ---*/ - -static inline flag extractFloat32Sign( float32 a ) -{ - - return float32_val(a)>>31; - -} - /*------------------------------------------------------------------------= ---- | If `a' is denormal and we are in flush-to-zero mode then set the | input-denormal exception and return zero. Otherwise just return the valu= e. @@ -492,39 +513,6 @@ static float32 =20 } =20 -/*------------------------------------------------------------------------= ---- -| Returns the fraction bits of the double-precision floating-point value `= a'. -*-------------------------------------------------------------------------= ---*/ - -static inline uint64_t extractFloat64Frac( float64 a ) -{ - - return float64_val(a) & LIT64( 0x000FFFFFFFFFFFFF ); - -} - -/*------------------------------------------------------------------------= ---- -| Returns the exponent bits of the double-precision floating-point value `= a'. -*-------------------------------------------------------------------------= ---*/ - -static inline int extractFloat64Exp(float64 a) -{ - - return ( float64_val(a)>>52 ) & 0x7FF; - -} - -/*------------------------------------------------------------------------= ---- -| Returns the sign bit of the double-precision floating-point value `a'. -*-------------------------------------------------------------------------= ---*/ - -static inline flag extractFloat64Sign( float64 a ) -{ - - return float64_val(a)>>63; - -} - /*------------------------------------------------------------------------= ---- | If `a' is denormal and we are in flush-to-zero mode then set the | input-denormal exception and return zero. Otherwise just return the valu= e. --=20 2.15.1