From patchwork Sat May 8 01:47:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 432559 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp859363jao; Fri, 7 May 2021 19:24:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbsHIzUDmoPb/OkdnoJDZXZdG2Sc6dePLBSw5wrULsPqM7jW7pdY8KhmOIjIY4OIS9WgHl X-Received: by 2002:a05:6e02:1488:: with SMTP id n8mr12901698ilk.158.1620440664231; Fri, 07 May 2021 19:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620440664; cv=none; d=google.com; s=arc-20160816; b=fsaL6wmwwgeNz7TMh1socg9FcRsIWJScyBlCtWBPJ9ytWY0FGX+mocPoMQllX6A7cR ZZA5Cfr+QoRvKaj3bUqfNyqos7fOF8IoLOWDO55guUuye5wKFJXkO0Zv7k0sr0H3fZBW k7kQWLJHopHjq3uYFZIMENhUlY91Jo7yQejmQK2qmu+igbUbXn8spFfEAmTAPtvZv1fi mKgkm6OyR9bmzxg7rFOt5u8wevn4XXO0JnqYkUb2vdOX56m6l1ClOLd7q0VRM5ALrTV5 eWQE/Dsx+E1yBTgRAKu2fnVrMb0hVZpDF4UTIXBqNYg8B4VlNdC+gBoQB2G0nQ4pk3h+ DByg== 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=MnGbP0t9ipMuFDDfgVLV3xJxRcipksJ9kWE5+MnyCZM=; b=HBPLxWeD8kJVqjrauyB+2cTOB2gbrpt1Nmzxc1awiRyrVTEcHw/GKFP20L5bxk4xez GTGVKgm24vPG8FhfsrEHBhSAVKY6AJZplyalC9/hawKLMJXEi8LWAFt5m/BIrfbiJHqf E4yuhwvEdidw4kCnD6jPPQShYFr/55rj1rICYQ4oRz5+g5T34dfyo7BcLXYo8qRLq3DX KJ2/JDRrxDw8iq4K4M8omlCX1GcmvC8/sYCKwrhNYQxUUrMoWn/3z6k03S1PM/Xg8oEg U3T/q5RHq/Ac36SX2IslKRWOu9AFq0vsv+xT/Q7pCpLlS7pftOE+KeD4ZiGWwcPbbTkv Cfzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tijmRvN3; 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 a2si8141217ilm.87.2021.05.07.19.24.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 May 2021 19:24:24 -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=tijmRvN3; 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]:52922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfCdj-0000XR-Mq for patch@linaro.org; Fri, 07 May 2021 22:24:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfC5E-0004pG-3m for qemu-devel@nongnu.org; Fri, 07 May 2021 21:48:44 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:46740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lfC50-0003gC-UF for qemu-devel@nongnu.org; Fri, 07 May 2021 21:48:43 -0400 Received: by mail-pl1-x62f.google.com with SMTP id s20so6128494plr.13 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=MnGbP0t9ipMuFDDfgVLV3xJxRcipksJ9kWE5+MnyCZM=; b=tijmRvN3nJP+w/YSkX7nG8pcWswdCBBCCN9akvBgFgKdbtEeMRbNwBwuIs3zXG1f2R ijrMr6pn2X03jmO8CGPK5S1hBCN7MnxtI/tm1UxcEAS39tt9qvxUyxumRzrzYNorwIGW BYTTE3Dqg6aYAbjQHrv9rMbFA7HdvLpMlXUCGejPkDjpR/20VEfIb0HlVV2tHDt0WRFF zAL1GiV4sAbu4fT3iodC1DZSCDTRveVg+Op/l4RXeERTfp/85em/OqNaiRhqRbZiMgun EgVO7lfCTC2m9sd0MI3LLsP8LFJ6/J6O4eReSRN/1kb/t6IropD+P5JFH7szjDISDbW3 scCg== 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=MnGbP0t9ipMuFDDfgVLV3xJxRcipksJ9kWE5+MnyCZM=; b=dPdktfxHNM9aBYkhE/dusScA4avpLFc6PkcZy1GUEw4SNfd8DEZ74524ayt9yoMcOi 2Uda5znABO3Sm1aWrFS4UnKoOZ6FhYgYh/eKEpgg8Ffg45FP7LTjAiTfkg7qW/XHNL1q 1Y9v999AdVcaGzVhSS06OtK3tamoc7OxfZvrbrxzGViJd648wzirkmWZM74/xB5P6LnJ /PvRwH5S+0k79U43r2Tdxhhzrj04wFxPGUehmqQKe2lWZqRZctJtdvD2yfV5LMuvuRBW u5f0+JhXLBN44M7GgmSMcW3nUb7+YbOQGPWl4psEFZp19Rh7HTKn/nOBxBtkSLID28uh nAKA== X-Gm-Message-State: AOAM531q6XXV3fvr92sU7spIeL4NRQWPGfJuK6jCDV9oBMrMbu6HcLPj 4v+vcOGOfup1K5jX5hwM0nLYjX6emVLPVg== X-Received: by 2002:a17:903:230a:b029:ee:a909:4f92 with SMTP id d10-20020a170903230ab02900eea9094f92mr13467728plh.44.1620438508939; 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.28 (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 39/72] softfloat: Use add192 in mul128To256 Date: Fri, 7 May 2021 18:47:29 -0700 Message-Id: <20210508014802.892561-40-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::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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" We can perform the operation in 6 total adds instead of 8. Signed-off-by: Richard Henderson --- include/fpu/softfloat-macros.h | 37 +++++++++++----------------------- 1 file changed, 12 insertions(+), 25 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée Tested-by: Alex Bennée 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); } /*----------------------------------------------------------------------------