From patchwork Sun May 16 12:34:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 439860 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp261878jac; Sun, 16 May 2021 05:51:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7tYomxVCECQlvflBl71MiQrwLKG2/dsNL/aaEoBHCAZIpEUDsW/EHtI4p0b9VBH3K2zBP X-Received: by 2002:a05:6e02:128a:: with SMTP id y10mr46894429ilq.166.1621169470914; Sun, 16 May 2021 05:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621169470; cv=none; d=google.com; s=arc-20160816; b=wyD4X9A1IvbdR1brqUOrT8eSkvLWQXjZTJameWnx3jKlIWCDjRZkewrzYGfRZDTMdD OWfClbPTrC3jlWHqT/uAjLlVoaHFBJXgAe/khq+LQ/SLldFnPZLDxDQ1OCNnl4OiR/Pp HFX0dWAfrbmkp3/GiJ88c8hHNjKZwyUwRvHuRGNB2hDL832Q+s08LFRO5/1UUSIFQQt+ 1CYV4sM2QMvoWcqtiT9399nkUAUpzffndim/XpWA+2SkNhknekRoITeWltFUpoKeAHnL Y24o7Zas/62M6Qv5Nps5cshNT2LsV0GsElHbTqM7luJI89Mi5WfGbAlQAqS797sOzcJ+ enJA== 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=Ni3IITrUvu6KOgaXHOkggF2jGpEbkqCHdxNG/RCcdrM=; b=l0sZaBWOcvGamNmzCrGrGn9rqUV6F6Zf833bb3lehcuI+Z3epXfCwiSgLe+OMUL65d Jnd0Qvyi+Xwbwwz/fat6u+6gL/lLh76TEqrqZWyDvuPtDyT2yU+K3odAi/UQOd7BjJTr WsV1vT/Ani30SW5ih4DI39gG0YntaC48e1wW1bkIrqcbScVVg0D0DfJH14r67SWLVHe1 Ji1O6S/ADIFGZ8yYRtX943RiVF8yGVzNw3hhE+QZ6CHWBEtbKdT0olgveyxMdZcmE/2D IBRCn3h54vwlBEBRTPLEhZ4D9xYTXmIsMQ4So+aro1c2Ehs8RKMGTFddUhiEVIIDhf1c m7zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hdUoRcf7; 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 t19si14485324iog.66.2021.05.16.05.51.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 May 2021 05:51:10 -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=hdUoRcf7; 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]:38768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liGEg-0002vz-CL for patch@linaro.org; Sun, 16 May 2021 08:51:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liFz4-0007RY-Ks for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:03 -0400 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:37607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1liFys-0007md-3W for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:02 -0400 Received: by mail-qk1-x72c.google.com with SMTP id i67so3308791qkc.4 for ; Sun, 16 May 2021 05:34:48 -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=Ni3IITrUvu6KOgaXHOkggF2jGpEbkqCHdxNG/RCcdrM=; b=hdUoRcf7f4CQa6H0ztH7P4gUsIcYZv7vSTbNK92r79BO3I7Goe8z7LyvT0u7lZ4ylN GgEdBTOxJEQ6IBgi90wAHZrl2X0xzJ32LJkEm5zpzMPuLdR/gGROIOAqaQdgBWwc2+Ac 4mtoEHKT47WSnONA5KmXqElvqZrFeM4UE1yv25cQNUhEeckWw6V5fzan8axQrpt1Uxmy r8N8hrubx80Y2ABr/P083m/WoL6J3kyaNiJ5g7mDvIH3HZ17Mt/YXgBvnUKJMbGocUv0 h/AzyUgzSeKMyOXnsdUHP7VTEMzxuFFCckOVEjcOnPcgOJDurTEANQhtyppPPeQ2hUyJ vsEg== 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=Ni3IITrUvu6KOgaXHOkggF2jGpEbkqCHdxNG/RCcdrM=; b=qaP9eyaWDGDsDZ4GqmpLEVZMvn2qBUPa8nORiTGIGCAKLq5Feq6plhjhRddQpQfGVW /Ebj/1Mma1l7/6jqUFOMJCDP0DbYRcpBtNEGeNP89umJh9BUd/o16aYQZZmlWIYBGJtO UeBnFNsaj+4wFCAYLCyzCQG5ugBGAxlOeCJwTp1vaTyUwX2qzCAL9aSc5S0PQoiJ6ezp VfACF4G/7vRbbn3XdF3OTbyE5vXyewD7ql7PfVAFjzTtEWUmKUqd5muMZsNHLBtDGV7y wya/I2TeR+8buCl6MRQh+Quj1SVIsjSlOJ1jVSgwTrHLCDP8fZyGfGopQ5GcmQOCvDiO FTzQ== X-Gm-Message-State: AOAM530CTOBiPNXEZseQwzU0gzlkmFwG8dJKsbYbRw4Wue2nohi8JsVF jVbLA6js5Ohe7B1LBlIbtyEJlpNvt8jDXjHMSZg= X-Received: by 2002:a37:6257:: with SMTP id w84mr53266861qkb.158.1621168488095; Sun, 16 May 2021 05:34:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 05:34:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 18/46] softfloat: Use pointers with unpack_raw Date: Sun, 16 May 2021 07:34:03 -0500 Message-Id: <20210516123431.718318-19-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::72c; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72c.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?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" At the same time, rename to unpack_raw64. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- fpu/softfloat.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index c7f95961cf..5ff9368012 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -580,36 +580,45 @@ static const FloatFmt float64_params = { }; /* Unpack a float to parts, but do not canonicalize. */ -static inline FloatParts64 unpack_raw(FloatFmt fmt, uint64_t raw) +static void unpack_raw64(FloatParts64 *r, const FloatFmt *fmt, uint64_t raw) { - const int sign_pos = fmt.frac_size + fmt.exp_size; + const int f_size = fmt->frac_size; + const int e_size = fmt->exp_size; - return (FloatParts64) { + *r = (FloatParts64) { .cls = float_class_unclassified, - .sign = extract64(raw, sign_pos, 1), - .exp = extract64(raw, fmt.frac_size, fmt.exp_size), - .frac = extract64(raw, 0, fmt.frac_size), + .sign = extract64(raw, f_size + e_size, 1), + .exp = extract64(raw, f_size, e_size), + .frac = extract64(raw, 0, f_size) }; } static inline FloatParts64 float16_unpack_raw(float16 f) { - return unpack_raw(float16_params, f); + FloatParts64 p; + unpack_raw64(&p, &float16_params, f); + return p; } static inline FloatParts64 bfloat16_unpack_raw(bfloat16 f) { - return unpack_raw(bfloat16_params, f); + FloatParts64 p; + unpack_raw64(&p, &bfloat16_params, f); + return p; } static inline FloatParts64 float32_unpack_raw(float32 f) { - return unpack_raw(float32_params, f); + FloatParts64 p; + unpack_raw64(&p, &float32_params, f); + return p; } static inline FloatParts64 float64_unpack_raw(float64 f) { - return unpack_raw(float64_params, f); + FloatParts64 p; + unpack_raw64(&p, &float64_params, f); + return p; } /* Pack a float from parts, but do not canonicalize. */