From patchwork Sun May 16 12:34:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 439882 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp273082jac; Sun, 16 May 2021 06:09:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3dVL3oUtNZxWF1x+Je21H73skK/eEKWaMuoumxV0nU3JthYLbLczFqXYqMWvjJzKqBWf9 X-Received: by 2002:ab0:20ad:: with SMTP id y13mr3086637ual.105.1621170592136; Sun, 16 May 2021 06:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621170592; cv=none; d=google.com; s=arc-20160816; b=nrj1tfv+r2qyrwdRqp6ukHgazy4nnTbs/9RS5t07G1Xr7FRhBB9gfY15X9pm2GfEfq TdcCJv6P0mSJLuPpCeA4T3Ptj7vVJfXQki/7adwOoN7msti+/PBQ76TFKj+jp2+D4IA6 02Ua6+ABJ9cf00NqG8KRxD3aAx1fOmbnsnf/fHaKE/p1V7vHN7wObRMzZETpYNwiLtYN w1Ui7gqoda8f9Y2//yMDuBiRKEtI+2RwZbQ3qOqFBVJodnif+6kyYE/RHETZwEjaJMy7 nDMzZW4ekBSKYCQJ3QNs20V1ZojZcuvzPyG6vvfv/8nt1T4YcT+oXJmklEBwsGYrmYsH 61rw== 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=g5JrLWpPIY2+zmkGea0CLj546B5kax6Igz9HQumup6Y=; b=LCur6mLeH1oaofY/KzqBo3oSaNOg4zByTOeavOW72ipGSoBR7MMsk5EvVZ5HQ0kru1 bf3DmYPprOGXPbsZZgOT1AefZQMr9yuXXni4wJbbeDqdJzMlp30w5z6/CgeWLQSDsKQY qb7UpHXNXOB+ApGSw7OObor6Wrd2iCKyidBsdqwHZJ2q4HHUBd/6zYRLW8EX58+Wku3T MNHNHHxrsbH+Aa+8xYZldtID9ZV+lbE+UdOig7WvlEz0pTawfTiWCGJp4qTnZBTQyqm7 QTBMT0til0yFQVtZyss9PXiwpBC5MFsNbJYWX6mahTywc9ZS6Kh2MOxq68JPFjejzWCO XVdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wBjeJnjq; 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 q4si5758188vsn.128.2021.05.16.06.09.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 May 2021 06:09:52 -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=wBjeJnjq; 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]:36774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liGWl-0005qk-JL for patch@linaro.org; Sun, 16 May 2021 09:09:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liFzc-0007sJ-Bp for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:36 -0400 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:42745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1liFz7-0007rr-QB for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:36 -0400 Received: by mail-qk1-x72f.google.com with SMTP id o27so3288084qkj.9 for ; Sun, 16 May 2021 05:35:05 -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=g5JrLWpPIY2+zmkGea0CLj546B5kax6Igz9HQumup6Y=; b=wBjeJnjq56qyDsvLr6dujVjn5vRr6AVblwxMcjjZKjdeU9FwYv4QubAp1p4aYt8CQR 0KS7XTwX+n0bpv/u1NMoDm1bDeW9ZXt32I0C7IpjYkhcLxNVplXVXaocxNy5RSRXiag2 zMFZ8D9NVZky+WaewFlk8uInJmZOc5FgcifeGDjJrBMKSB0zyhNMLRcrwQo2VhjrfgFz 3sUI3aitw8a1rlLwPtZiGyvZD6vrC/dYv5tDquyWjD8eav3PITNzVIPxrkB2Mo3UmWLN DCwh9/ti9vCcUaPi38nooxs/yLdD2LYK6UbS5qj2RsXXygzy3IggLJmismdxXhj8OI9B DXRQ== 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=g5JrLWpPIY2+zmkGea0CLj546B5kax6Igz9HQumup6Y=; b=d8ba9G3joedWr6cf4B3DGYi5NKiBm2R70hcCYxp+dM02MMlcR3LFx5x/FiAGIrKOyF bWUMoKHrfXwuLJ0CoBvxXRPLXIHOJf8ZGa4sst6xSQsRB04ghKodNVEb5ItS3jk9Drg6 JBp96f1xL3pJoNwvrpDu2zBh9BcJkS1PnttnN7uLd3F8f5f0IIuUAlGzzp8XsR7GPwTv ENCPnfjXuTHuqxbHkmFCtmUF8gDx3Sp5sTHYqxuNc0qIugXr1SwtDEL6TJfHJe1QU1BI RQ/JVXG1gCa8qp3pTtWKMZwwSPMpq/ZPPsX5IoF5KDi8fEEBvdVu4qVCMJLkRpTsGtVW GrJQ== X-Gm-Message-State: AOAM5331XVUwFZU8CvwiHbd2U97nYje+liwNZ/l7/8z89Br8YXAa6QiH O2MdnYohSPVO5a2mAnddSVGqJcanD1OxGuJO0VE= X-Received: by 2002:a05:620a:1585:: with SMTP id d5mr20319823qkk.29.1621168504786; Sun, 16 May 2021 05:35:04 -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.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 05:35:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 39/46] softfloat: Use add192 in mul128To256 Date: Sun, 16 May 2021 07:34:24 -0500 Message-Id: <20210516123431.718318-40-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::72f; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72f.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" We can perform the operation in 6 total adds instead of 8. Reviewed-by: Alex Bennée Tested-by: Alex Bennée Signed-off-by: Richard Henderson --- include/fpu/softfloat-macros.h | 37 +++++++++++----------------------- 1 file changed, 12 insertions(+), 25 deletions(-) -- 2.25.1 diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h index f6dfbe108d..76327d844d 100644 --- a/include/fpu/softfloat-macros.h +++ b/include/fpu/softfloat-macros.h @@ -511,34 +511,21 @@ static inline void | the locations pointed to by `z0Ptr', `z1Ptr', `z2Ptr', and `z3Ptr'. *----------------------------------------------------------------------------*/ -static inline void - mul128To256( - uint64_t a0, - uint64_t a1, - uint64_t b0, - uint64_t b1, - uint64_t *z0Ptr, - uint64_t *z1Ptr, - uint64_t *z2Ptr, - uint64_t *z3Ptr - ) +static inline void mul128To256(uint64_t a0, uint64_t a1, + uint64_t b0, uint64_t b1, + uint64_t *z0Ptr, uint64_t *z1Ptr, + uint64_t *z2Ptr, uint64_t *z3Ptr) { - uint64_t z0, z1, z2, z3; - uint64_t more1, more2; + uint64_t z0, z1, z2; + uint64_t m0, m1, m2, n1, n2; - mul64To128( a1, b1, &z2, &z3 ); - mul64To128( a1, b0, &z1, &more2 ); - add128( z1, more2, 0, z2, &z1, &z2 ); - mul64To128( a0, b0, &z0, &more1 ); - add128( z0, more1, 0, z1, &z0, &z1 ); - mul64To128( a0, b1, &more1, &more2 ); - add128( more1, more2, 0, z2, &more1, &z2 ); - add128( z0, z1, 0, more1, &z0, &z1 ); - *z3Ptr = z3; - *z2Ptr = z2; - *z1Ptr = z1; - *z0Ptr = z0; + mul64To128(a1, b0, &m1, &m2); + mul64To128(a0, b1, &n1, &n2); + mul64To128(a1, b1, &z2, z3Ptr); + mul64To128(a0, b0, &z0, &z1); + add192( 0, m1, m2, 0, n1, n2, &m0, &m1, &m2); + add192(m0, m1, m2, z0, z1, z2, z0Ptr, z1Ptr, z2Ptr); } /*----------------------------------------------------------------------------