From patchwork Sat May 8 01:47:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 432555 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp856235jao; Fri, 7 May 2021 19:18:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr6SBBjhDXhZPrpeqivPB1ySEQI93BJitp98YFyq26SWlAVWl0sQyyKNoQhgE4L2qBYQUk X-Received: by 2002:a05:6e02:58c:: with SMTP id c12mr12290407ils.152.1620440280543; Fri, 07 May 2021 19:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620440280; cv=none; d=google.com; s=arc-20160816; b=0FRQMB2r/uZ3QWQHxgLLPy6MdLTODggr5vGnOD3O1Dj+DroIB059xQh4oNWJbvQQS6 QryntSgkJ9+VgTvaQz/UKjOmkZ17Z5HUar2mYwkzeOxMUEDaP0UhAHNkNWodijMjcNMA N3qlQyNeBXPJxbSCjodS1tX62DS6bxsUz75QBFKdOE5nij+AXxab4OlwAW8vCj4baayS X/hen5i3nPcSVGI/CMqRpsJYWYScfdV0+sxQz+k1wId+bbQi5sQNnC67LDSliYX7ZGF0 nvAzG2wU+F7rmHiPGBk3740nwZFFF0BY2poOhH5rGFPZ/47zJ9hcVA4jhyNBu/4slGT7 6PZg== 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=RndXytbTpyoZf87SoTBz0zxUXITxwgpEDPn6NB45UNI=; b=yYXJ5SfbHAsVB5AM8ndW9DWSN4b7tdU4A57u0ZQyP7hSvzxcprzUzfKZ6wyIBKLq9E EleIUQSXp0fecaKi13WD9tsTqF5EiQQfFX8YLqHXoNrieDjZCDZ23IIWmXhcMPk4QFKh JGIVr2KlsG1OMlZIbMAuQUf/L8AFq0i19NmPQ/bNTQ/AIFhEXG78nRuGPciXLKXX15kk O1yTB2Wj/TaJrcVupQ+t60E4NJrT49TNS63jdhWG4+r13AC8Icru3bVhiNm9RbjgWEgS CDK7arl1L2AJKU+XTiimHrnva85Es6ThrNlkdPpN8LvGXgq5+5Uag/R/AP5hBB+uuA4C e1+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="c6tA/hOm"; 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=fail (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 16si8333266ilt.35.2021.05.07.19.18.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 May 2021 19:18:00 -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=fail header.i=@linaro.org header.s=google header.b="c6tA/hOm"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfCXY-0007pi-0h for patch@linaro.org; Fri, 07 May 2021 22:18:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfC5G-0004ro-1o for qemu-devel@nongnu.org; Fri, 07 May 2021 21:48:46 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:38815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfC50-0003g1-45 for qemu-devel@nongnu.org; Fri, 07 May 2021 21:48:45 -0400 Received: by mail-pl1-x634.google.com with SMTP id 69so1536078plc.5 for ; Fri, 07 May 2021 18:48:29 -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=RndXytbTpyoZf87SoTBz0zxUXITxwgpEDPn6NB45UNI=; b=c6tA/hOmsdMywC7W6Ey8D5CCg+Rr2zLDoZgOe0uv18/UucQXgny8Uul1FftPE34/rw cXNLzgkJLuYZaFVgzX6J14kK6Hxp1jU7XOoQqRqoNFMbNoooL5qPZDQL1gmgAQELRa8u hH6amW3qXptSWEc14UNCwr93OnEvNqu2dQK3WddfS8SEeFDmyu+USLYn+fZMe5tG8JVT cHZPIpzff7CLJyajAtyVSxN98mte6WvoX7bq+Fy1OVAuyx8a8Y4E/JLMhWqAUoANy7JL ThffoUiqX2jrcdGJpGzFBXW5J10HWYESFYkAz/57aEScwvdFs/jzU8J6e+qT8lc4UXhr vqWg== 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=RndXytbTpyoZf87SoTBz0zxUXITxwgpEDPn6NB45UNI=; b=rVFr6l1mYHa20vI1528ERaEClsTTsjZkhjqPNm8jsjV++bFKtU5N37rRT+II7uqxC9 SXyj6bgPXs4lFOExdLTXZ6uieiFRuCI+m2SzsK5h+zIuXEsUXiUwvKQgmJNu2cmJeVeW PgCWmie7A26uPSFUCVB/gZ4N3icCMpCqIRfLUxmUh6/FMOmL9eu+nDkm8bLchOhkEOZN DEwbtN0EVgTEApsdj7WeQ9UIRykhpv6x3AlNHAOq0DJRc1N7sQkqXDNsGV3YBY4pRUMv r2BbuoKGHszKoUuP3oEx+APEl2wO3x+22uiJj9IYe8TILiHTsVxKOqV5ewQJcARUR09D vkgQ== X-Gm-Message-State: AOAM532gxzju3dx2VALkPaIyZRft1sLm7K9aqpeL5kv8vQyW1FxMhb+H uc1U+fj8mvGOddp1/evGtqbavpu8WKkudA== X-Received: by 2002:a17:902:a9cb:b029:ed:61be:2cfb with SMTP id b11-20020a170902a9cbb02900ed61be2cfbmr13180155plr.9.1620438508352; Fri, 07 May 2021 18:48:28 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id t4sm5819681pfq.165.2021.05.07.18.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 18:48:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 38/72] softfloat: Use mulu64 for mul64To128 Date: Fri, 7 May 2021 18:47:28 -0700 Message-Id: <20210508014802.892561-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508014802.892561-1-richard.henderson@linaro.org> References: <20210508014802.892561-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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: alex.bennee@linaro.org, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Via host-utils.h, we use a host widening multiply for 64-bit hosts, and a common subroutine for 32-bit hosts. Reviewed-by: Alex Bennée Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- include/fpu/softfloat-macros.h | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) -- 2.25.1 diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h index 2e3760a9c1..f6dfbe108d 100644 --- a/include/fpu/softfloat-macros.h +++ b/include/fpu/softfloat-macros.h @@ -470,27 +470,10 @@ static inline void sub192(uint64_t a0, uint64_t a1, uint64_t a2, | `z0Ptr' and `z1Ptr'. *----------------------------------------------------------------------------*/ -static inline void mul64To128( uint64_t a, uint64_t b, uint64_t *z0Ptr, uint64_t *z1Ptr ) +static inline void +mul64To128(uint64_t a, uint64_t b, uint64_t *z0Ptr, uint64_t *z1Ptr) { - uint32_t aHigh, aLow, bHigh, bLow; - uint64_t z0, zMiddleA, zMiddleB, z1; - - aLow = a; - aHigh = a>>32; - bLow = b; - bHigh = b>>32; - z1 = ( (uint64_t) aLow ) * bLow; - zMiddleA = ( (uint64_t) aLow ) * bHigh; - zMiddleB = ( (uint64_t) aHigh ) * bLow; - z0 = ( (uint64_t) aHigh ) * bHigh; - zMiddleA += zMiddleB; - z0 += ( ( (uint64_t) ( zMiddleA < zMiddleB ) )<<32 ) + ( zMiddleA>>32 ); - zMiddleA <<= 32; - z1 += zMiddleA; - z0 += ( z1 < zMiddleA ); - *z1Ptr = z1; - *z0Ptr = z0; - + mulu64(z1Ptr, z0Ptr, a, b); } /*----------------------------------------------------------------------------