From patchwork Sun May 16 12:34:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 439868 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp265013jac; Sun, 16 May 2021 05:58:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNUhl1HvCLi1jbnk0WvMV2T4s4Lmu0LXwrAZUBbRjeMEl7JuFgTEbATGjDka7z49xQ0fSt X-Received: by 2002:a92:c26d:: with SMTP id h13mr20186253ild.131.1621169884619; Sun, 16 May 2021 05:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621169884; cv=none; d=google.com; s=arc-20160816; b=xHfsRxnpPrbhfVJVs2NrwlhtIW9uEOq6QMHlHSgh5ppWVjWJe0ZEa8QxNkzJx1LH1+ gL1+0UHiUgQJ710j4SiLxU4GL0QDt+ItJBMYTcqLPqDqNb3Xul7clvng1kHVDip4KCpl ag25FebbdQC9FTaFESYBhObG5rhguBmQhtpXAqQ1rZcZyfL2/omz//JWzvK6Xem+Pr2U vJiEqBxgrZ3J/a2o7RKe+pcjuQL88GUbl3mzmYaFpFFKnkVMgEohNZguRfe1yRiZBFYH +bKkt1vp6IL/4y82DnMiuWebuWGIx5Csxg+FVqwWpoFkBOVuaSjgR7Afp87HCb61kevt frlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=SSsnZ91q8QYxYfIeEERPVDuhgJY0Ge1EGClwWnWfqNg=; b=zd4kl4wxnnf9O+2BfwjsJU58kUJ38ptPgdGvWVigeBv3CaMdl9rhWWAN4PfWNoBFc5 KwhXlDJEYp88aRXdWXYwzGJOhfe1t8ZG9KqNuYJAjzqrWwziSwBkaKnIJa4ONSHZWl5g UEvm+23Nf+jsu/Z6ab9PFNc1L8tuwUqBD25NEtxr7X9LQ6n1hapK6drAKckJG2BzyeUx H2eerkkKUCeIqt4XQNs9RlaEG3Agf5yAg+xwWbaUTOcqgXkyVX7gw9YmbOkY15YkHjRX fDzzFOLb/dfZJrsetJ0E+HDAb+lGxtU5ZxWMkL3ey1zGqfEiAsFoZh7+AkDKoEvidu2E HkSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aEjx55rv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h21si14088901jav.99.2021.05.16.05.58.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 May 2021 05:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aEjx55rv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liGLM-0005Ng-41 for patch@linaro.org; Sun, 16 May 2021 08:58:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liFz8-0007WG-Jz for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:06 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:46729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1liFyu-0007mm-6u for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:06 -0400 Received: by mail-qt1-x82d.google.com with SMTP id m13so2984845qtk.13 for ; Sun, 16 May 2021 05:34:50 -0700 (PDT) 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=SSsnZ91q8QYxYfIeEERPVDuhgJY0Ge1EGClwWnWfqNg=; b=aEjx55rvfM2q0aWQEtXILk1yqJmsfESPdxI47NnXiXmAWZzOtt4I5xiyBGDLfobLyr r9DEY3zdDtJ8Hy5WfTzxQlsCx0QgfdeAkt7DYqMouz/ixlbkRE4ldxOS4brDW1+/rxhH 9qxU5UV/sG+d7MrHPNzL0Q9UtJac8i3azF1BUbjREswFEHLDCiSGIdkMVhoIa+cyaDu9 /qBymHTP9BRHZQVZKQ8ftmhxIrxRo5RqBo2yNSW/qshZ7j6jZWcYqTiYA4Xw4VBBu4ms /XAcqS/EsDIe/b0FZ3A7cn6gPT24dYQI47eoSC57HqDmEi//hmt9Ka83un1KqFl4X37q EKYA== 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=SSsnZ91q8QYxYfIeEERPVDuhgJY0Ge1EGClwWnWfqNg=; b=BbMBP4TR6lJqdYmRhr1czT0Dlg2utCGBx97RayY/V1KYeZZSHy/VPEdNiKD/rDwZQ9 OZL9iiXGSyE/Z1fzFGPAWr2z9YO48ggBywpJCL2IYRrKVGahD9UHvcLoue6Fu2AHwn7Z HM923DF1g8CQTyU3zRY3UZUE/kaEdGOHbbmkuvAGquD1uEMgxU8mb4Q1L7kgf+66b7xB 5uxwqyYwzrJhcSski4jKvwX322Q7+aeCvdysH4HG3XiWSvw211jf0Y1ci7DAPis7A80m ioS2cLsNChYH1GnB3BffH/zCi9GqWnbLcrb2Y6d5YIYJXwxG9+xAoQliiyTKYe0TLKUr NFBA== X-Gm-Message-State: AOAM531vsS4kIz1go67gERcoUOzH/m2SSb26k7O6YvLYZ37xfUUNkIhR 5V73OWItlrVo54pb6QTgnZjpaUWKJAGtEuM/n7g= X-Received: by 2002:a05:622a:1044:: with SMTP id f4mr36340056qte.181.1621168489511; Sun, 16 May 2021 05:34:49 -0700 (PDT) Received: from localhost.localdomain (163.189-204-200.bestelclientes.com.mx. [189.204.200.163]) by smtp.gmail.com with ESMTPSA id s5sm8500553qkg.88.2021.05.16.05.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 05:34:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 20/46] softfloat: Use pointers with pack_raw Date: Sun, 16 May 2021 07:34:05 -0500 Message-Id: <20210516123431.718318-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210516123431.718318-1-richard.henderson@linaro.org> References: <20210516123431.718318-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x82d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" At the same time, rename to pack_raw64. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- fpu/softfloat.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 5a736a46cf..b59b777bca 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -614,31 +614,36 @@ static inline void float64_unpack_raw(FloatParts64 *p, float64 f) } /* Pack a float from parts, but do not canonicalize. */ -static inline uint64_t pack_raw(FloatFmt fmt, FloatParts64 p) +static uint64_t pack_raw64(const FloatParts64 *p, const FloatFmt *fmt) { - const int sign_pos = fmt.frac_size + fmt.exp_size; - uint64_t ret = deposit64(p.frac, fmt.frac_size, fmt.exp_size, p.exp); - return deposit64(ret, sign_pos, 1, p.sign); + const int f_size = fmt->frac_size; + const int e_size = fmt->exp_size; + uint64_t ret; + + ret = (uint64_t)p->sign << (f_size + e_size); + ret = deposit64(ret, f_size, e_size, p->exp); + ret = deposit64(ret, 0, f_size, p->frac); + return ret; } static inline float16 float16_pack_raw(FloatParts64 p) { - return make_float16(pack_raw(float16_params, p)); + return make_float16(pack_raw64(&p, &float16_params)); } static inline bfloat16 bfloat16_pack_raw(FloatParts64 p) { - return pack_raw(bfloat16_params, p); + return pack_raw64(&p, &bfloat16_params); } static inline float32 float32_pack_raw(FloatParts64 p) { - return make_float32(pack_raw(float32_params, p)); + return make_float32(pack_raw64(&p, &float32_params)); } static inline float64 float64_pack_raw(FloatParts64 p) { - return make_float64(pack_raw(float64_params, p)); + return make_float64(pack_raw64(&p, &float64_params)); } /*----------------------------------------------------------------------------