From patchwork Sun May 16 12:34:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 439879 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp271942jac; Sun, 16 May 2021 06:08:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIUlp9LDmv0KL6DqZyx6Ycq2JrJm7LTkdfN2BCnJzzx9ACEMubpybSFTYfC8jlR2i5r9To X-Received: by 2002:a9d:247:: with SMTP id 65mr45036758otb.330.1621170488868; Sun, 16 May 2021 06:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621170488; cv=none; d=google.com; s=arc-20160816; b=AlWyL0MeaTFo93vWrH5OkFUkGAlrMsxK5HOUdk3gmrdA8kMXaifi7gB1/ke78TXhvD gi2kLWCJQOoPOA4f8rrYsatoF0O2Ui8X5p8vECO1dHkBOLPwFoQsCePhZOsbgvIvLwr7 AfDoC761+7SySboBQ1FfBQPfAzin1q/Facg+3zvSmzTK59b05qa3lbmkr+3XUMNK7bnS bI/A7c77R2j04SjxAld1iO/jIcBuD95OG56gOYfA0z0Yk29Q6y9+Z6a6STKsDPf5O1gH C2BJ0s3nvVi5gS3a2UppKwZfmaNpb7yGcwwL1Dp1/rJW/sA3FogiUxHxeHY3tPiPA20d xiEQ== 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=Kf0PanQBNBj6/59BHumRFDEAjrwtcxTLlkroKmB/JAI2eLPBFlfSFQF5I9r9rEa9cN q73svnB9+/GNavIC+BqLtjAXTOs9dD8j5vbzJCuVcPeyheYxamb0emoeNDKN2c5Qh4l0 j+DyCHMrRlyIlES+oHGfiQtSV4WdpuNbFq/wUUl6bOJLOxivtgivzGBVb21lo+Q3hPB6 i37efpH5vKgTHIRQcs5zSgxCaBkmX8wq2LmnkBMKcGywn2MSVRxsAZQFYCah6d39sM/3 /rnJqGDN7eZ/dyv5LuH4hmN966ZugVQZ1JRdWBFq6LB4/K3YhcA6FolVbxh1jCUWpkFo Fu3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Iyvgq1tZ; 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 l16si11369990oig.35.2021.05.16.06.08.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 May 2021 06:08:08 -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=Iyvgq1tZ; 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]:58628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liGV3-0001dG-Uv for patch@linaro.org; Sun, 16 May 2021 09:08:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liFzb-0007qQ-KP for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:35 -0400 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:36452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1liFz7-0007rj-Bc for qemu-devel@nongnu.org; Sun, 16 May 2021 08:35:35 -0400 Received: by mail-qk1-x729.google.com with SMTP id c20so3322063qkm.3 for ; Sun, 16 May 2021 05:35:04 -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=Iyvgq1tZ+Wc/X3y9EH47MrrlnfZrHPU64rQ7pY94+3Nc0wQo2ccTHg6hSLcLSs3/zL 4Z7fIhuZwZN5oa/PB0ttML1tVdBF125qddRGssIEXS4IIJAguAQyvbl4cPRopt5ZWuQQ ucQAvz5a9tYRdYK8x36Xq+aV993J/ZAgpaBqTHtL3mPSKHdwHacTRUXdlPiDsm9PSHvE Evw45OlpJWPPgG6Fv8KZt2CIwCKwKjDGQXwORWNan7juohfmR280uImstyDjdoBl8rY0 Jb9iA7ZPmvhl5uGKAToKVLi/jQIxKmiIpvTO1dLPZG90DALoyLIYqRmypSBFDC0YpQEb jODQ== 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=sgcBEC8lpy47CHSL6k4YjFq7+lpni6/g5QBO3w5lC6rZyQciMa/O1HpNMTTewjewkT WnNAfQ6kZVtwEzc3XYB35Oj9fCbkXplZ/LvYvjaBIOPDsl5wSyNBam85BWIsonGPwtvT F0RtTNWYwmNYuIqKTcfGrgSO72htytvMkB3Gr43LlOx3hzNL22QuX1QOv2wxtRiS1lio L+ieUz1uviYs9fmxdPwaPc36wXq0YVQc8BsMGW8eGYHy1Dakn6njGE0JeOR0PgYwiRKM DdMn/hiq2n7CECInVjoZ8MFsBmnJYqTFU6cRmFx7MW3Ecj1F6DDK6Q4xmakPy0zL99QX x9TA== X-Gm-Message-State: AOAM530a4ybcaXbmDcNyU1uDwU1/hxUKkuMg9DqVRJ0M7R8Nxxg17u9z Q/8431mNDK4KXU+UTgc0I9DH2dUzak3uNZuQvkQ= X-Received: by 2002:a37:a3d7:: with SMTP id m206mr51287967qke.343.1621168504040; 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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 05:35:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 38/46] softfloat: Use mulu64 for mul64To128 Date: Sun, 16 May 2021 07:34:23 -0500 Message-Id: <20210516123431.718318-39-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::729; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x729.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?= , David Hildenbrand 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); } /*----------------------------------------------------------------------------