From nobody Wed Feb 11 02:54:34 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 1512997737608287.9968069198685; Mon, 11 Dec 2017 05:08:57 -0800 (PST) Received: from localhost ([::1]:52701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONpG-0008BN-3g for importer@patchew.org; Mon, 11 Dec 2017 08:08:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONe4-0002QJ-BL for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eONe1-0007gx-9i for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:20 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:44849) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eONe1-0007g1-0S for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:17 -0500 Received: by mail-wr0-x243.google.com with SMTP id l22so17456934wrc.11 for ; Mon, 11 Dec 2017 04:57:16 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m11sm16176601wrf.56.2017.12.11.04.57.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:57:11 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EFF153E099E; Mon, 11 Dec 2017 12:57:05 +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=b6zTeLeoJwXTa0YonO9q4Wjz9CylVVC+D6KJ/p8yPj8=; b=LNuw23AhkRiW4FD7dTWhUPsapQxPk7FgF5V3jTOZRwAsS6z7lVNsZgIYwb+sbaycs2 vjm+DK1doQlVovfjI6757iujBMB7Esn+x0Z2YjcVZedsNKrdJ3rwV1RxR0YueBcBYnVI wweu9s0QF1xQXKlB3MGvKDMsCdSjL2OrgYFr8= 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=b6zTeLeoJwXTa0YonO9q4Wjz9CylVVC+D6KJ/p8yPj8=; b=dfUrm3XiVPScZ0nQCYn8+HsULm6noMt71lqrP728hM3kj0DSEb/vJVPV1JJgOXLd0U KjL/NVeuu/hWVv3hkUegD/ocd1w8Cr+HSVIX4PdSqDfIVE3PDeSPNsp4CtDybElAxPId 9YChGak7ywV/9S0+nj3UoiCaOgo5jaFmzRc3wLWuqvagkQw/hutxWM89s7y+Qzzqcpss F1JfkEza5uG/m0Lvgiin1ePVxFMnJB0dLdoIbd4ymJH+E2Z+8wKoP7Awfd1vw7hHoTvB qz2D/XJDyRQjO8+/eQXZ2zh3zIZ2n/P3hhUXPK3Z9Fu+2SMTSUOf7Twt36aKNoI2U2/v XVMQ== X-Gm-Message-State: AKGB3mIH3TgZdPJHx2K1zFefKMds02abhpsRudCwi3zUbFeWqCFSXeo6 wJPJNYZZxlQcu4bsIqjtBlHanA== X-Google-Smtp-Source: ACJfBot4WVtOG43nimEmaPnfBKnoeUXiGTMJkrp7u37a9VrwWt7XeE/pYDUCiTG8U1E5r5ot7QrYsg== X-Received: by 10.223.158.147 with SMTP id a19mr312760wrf.179.1512997035709; Mon, 11 Dec 2017 04:57:15 -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, aleksandar.markovic@imgtec.com Date: Mon, 11 Dec 2017 12:56:54 +0000 Message-Id: <20171211125705.16120-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171211125705.16120-1-alex.bennee@linaro.org> References: <20171211125705.16120-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:c0c::243 Subject: [Qemu-devel] [PATCH v1 08/19] 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 --- fpu/softfloat.c | 119 +++++++++++++++++++++++++---------------------------= ---- 1 file changed, 53 insertions(+), 66 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 44c043924e..0850a78149 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -132,6 +132,59 @@ 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 +352,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 +512,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