Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp194576lqo; Wed, 27 Mar 2024 10:19:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXj331MnRot9urFcBgQOdl0oGxmFfCIe+h7COdz2daD1X6YoThgzWkotCip+LDTTQOJ1QTZ0kacxHiKvtxirng0IlM5V2J5G1+BtD6j8g== X-Google-Smtp-Source: AGHT+IH/KzCyEgL6ZwegIxUR4nds+qXM75UKb/O+Caxw0BXW49GC8Ybkhr8w8BywJ6NHkonQ6Gtz X-Received: by 2002:a05:6871:438e:b0:22a:52ad:100a with SMTP id lv14-20020a056871438e00b0022a52ad100amr399211oab.13.1711559969202; Wed, 27 Mar 2024 10:19:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711559969; cv=pass; d=google.com; s=arc-20160816; b=LynUbqP41q13MzF9q2jikDG6cXsq1hYpX86OEcPONLQFb5bDh5jcJ+08i2PdzdaAdw H1kk+Ylv06GtWCW3rpeu7B5eJZS1T5FLOODhzmGL20gFRyHlY1l/bfGDDzdpbwiYPnPl TYUE39qDo04mTR99XE0hOy94IRjH9usKmaCWBCziLxxwOqlj7Do2vt/wvdXQfpxbQW0x gUzix9vNOLox4rEDl04HAP0HDbmFM+ylMuY4960EdcnXinYSqPhr28/+/Me717FGEZoS Ux6rZbcJJi/VlCuCrX3vX+ne5eYdml/pcHJj7s99J7DpCKgRvo+LssErlQDrHKbCEroq 1ekg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=+VXTm91dwTerGVrd7vN+CyFvKGg6E8u0C3fPMM7cgQ4=; fh=YeR47KONE3x4MMDyarnE2n31R1PgLh7pBcan97Z0Ty4=; b=S5MWTUPu9Q73GkwSWGOYeWjB5h9A3qlKp/SMoU3ozwMMSheCVPR5F1KDrMgzt4m4LX H5i88nZz4octf+5yLNIdXL050hJWRnTF3SjOExW6ScgjeUt9kuL4dpKTFqqjOfvS34uw Uh4Rrd4Wa0Kw5aF4/F0DchSkwlCOlExE9LZmfFaTPVySpXwsC72OhUSSCI5NnvcOsBcu ZbMGQa0Gno9z8KSw9DmFPheBXNkPP6M67McOPOLdhRYl+U6fr/uiaXZhFBhgvYyAYuDO V78mgY28ZMCcGjrmTKflQiDQ+zd8nvoZmxpoz6qq+69sX4vIddBVu9mZgqhSCfqJ8GNO Z9yw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=Fh6W9ymS; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-121684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121684-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cn10-20020a05622a248a00b0043136a72d8csi10523654qtb.560.2024.03.27.10.19.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 10:19:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=Fh6W9ymS; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-121684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121684-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E5DE61C2F1E5 for ; Wed, 27 Mar 2024 17:19:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 541E114E2DE; Wed, 27 Mar 2024 17:18:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b="Fh6W9ymS" Received: from xry111.site (xry111.site [89.208.246.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 348E214E2D9 for ; Wed, 27 Mar 2024 17:18:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.208.246.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711559917; cv=none; b=fgnIBecakx33EPK6686H9JJeUgF/+Kb2gGuvtI8kLtjCREvwRgHq5ClThI5K2zrL8oa9xtYu/EomgMdUCc5gP/d14AovsdgR09m7bMabKJYBA2jryLkA574loR/vtfsGP9+zcfLD5yl8FD8ixdskrArzsPEqsE29QRL/ytL9QC0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711559917; c=relaxed/simple; bh=F1pqsc6yA/HV/3XyW47RmJKXv1PKsfVTHF8V7dly7UM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KbQJcgoDojUlfh3fCL/UTdnyZIc3LyU83xZ3lYLUlXTUgV7CYgATK3ka056LCuexfd5DsELfHCertr977uX/kHeNgV/jW17MoCDXYdl55kzLmYcETwXLL5fyQmrMIvPbw+eunBczTRMbrilvun0C/6PBANAO5XdIVpiy11nMyD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site; spf=pass smtp.mailfrom=xry111.site; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b=Fh6W9ymS; arc=none smtp.client-ip=89.208.246.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1711559915; bh=F1pqsc6yA/HV/3XyW47RmJKXv1PKsfVTHF8V7dly7UM=; h=From:To:Cc:Subject:Date:From; b=Fh6W9ymSD/DcjLV3NqlAW1P51PmWY56HAen4AMuo3f+cyaQXZkcgYyVl/Ydis5/AY MlagIngvWDwP0K3slPck15SpbCxMdsIpwTDKxBlORqCWxb8qY4ORH8V8kFm/U9tV6D Crh7v/kz1U3Lpk+LL7mYzDuSJnL29eLaik6BWpts= Received: from stargazer.. (unknown [IPv6:240e:358:111f:6100:dc73:854d:832e:8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id B449666B9E; Wed, 27 Mar 2024 13:18:31 -0400 (EDT) From: Xi Ruoyao To: Huacai Chen , WANG Xuerui Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Tiezhu Yang , Xi Ruoyao Subject: [PATCH] LoongArch: Select ARCH_HAS_FAST_MULTIPLIER Date: Thu, 28 Mar 2024 01:18:07 +0800 Message-ID: <20240327171807.27741-1-xry111@xry111.site> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit LA464 and LA664 can do 32-bit/64-bit integer multiplication with a latency of 4 cycles and a throughput of 2 ops per cycle. It's comparable to mainstream x86 and arm64 cores, so select ARCH_HAS_FAST_MULTIPLIER like them. It speeds up __sw_hweight32 in lib/hweight.c for about 14% on LA464 and 11% on LA664, and __sw_hweight64 for about 30% on LA464 and 33% on LA664. Signed-off-by: Xi Ruoyao --- arch/loongarch/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 5a769bb92d7c..d52a95195e7f 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -16,6 +16,7 @@ config LOONGARCH select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI select ARCH_HAS_CPU_FINALIZE_INIT select ARCH_HAS_CURRENT_STACK_POINTER + select ARCH_HAS_FAST_MULTIPLIER select ARCH_HAS_FORTIFY_SOURCE select ARCH_HAS_KCOV select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS -- 2.44.0