From patchwork Tue Jul 18 21:11:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13318278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85A15C0015E for ; Wed, 19 Jul 2023 06:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uisMLCmGF0rttDNpkEPhwGzGkHEVeOcT+UFqHaN3lwM=; b=FLGvaV9JfpOzP1 dOBN5S0J912t8XcI81TkSfNLuX2gXOOtD3nxcEKuMc+AT1DZIZT6/fYDThCUHp781URxWNghm6Q9r 5DWP19qwYy8TOcQRNW1bdY91qisBJ3Uc3V5j4E/ZFw6a8752fu/HiCc54EgRnYynoDxBFyFspTC3k 5KiDPHEo+zzHrXRTNAwbpiL1G2Pg5vqR+Ndd9sNL/5ZStOGhcGQYm2aoXgOHLw1kDGDNjsWZjgDm6 2bC9SpoMdNX/rm27uGcWfALI02Fz/ad0J6RlU9MWioCilGk0hek7ocboD8kOjZ+HTUF/WixKvznv0 5bC0IrxpwjQqd6Sbf1Qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM0K6-005Xo7-0y; Wed, 19 Jul 2023 06:06:06 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM0K4-005Xmr-23 for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jul 2023 06:06:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=mA7H5lazrYggWHjDSH2+KZOVLMThSynpl96+eBz69BQ=; b=PSAtzfV6ZVE95cZ3qArs05L76h 1wXWJsHIAgqwyQxijjRkj6Afj0hTFqmED7TOsGdbYuwYv0VC+uBeDTZkoUkok976yGuRNKejfEzvR nBrWeEyThDU35GBgmFLJ+PEDlenHSXC5+sJSt4fDtqjJoJnFnRN/Eh56zUFisrI8CpsvJ31ZWUr83 4cpmgQU5SPjQVhnW46JoLfld7a7uNhauF5hhsOpsiPbcTiit7CjE5j0JoYrJJ3BgFdd0CrWKleDC3 Cw6REbmfven1ehd8+81ybEdrdzvp/lSposponYns6OWaaYher93L0Kn+BBVnthtKNeKNUzobx0/+e 1v6xzRcA==; Received: from mga07.intel.com ([134.134.136.100]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLrzq-00C3FY-2r for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2023 21:12:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689714758; x=1721250758; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VqCLuF6+Bx4Auyc0wAAAKOAjCrnRB30KAZm7eJddByA=; b=heK88kQY1tz36qU2KBJefbMdwKdmtDiT1YSY5bjhTkGOhY+Uhx2QB17w w8HLZEoHxEiKKg0TcUDgQoaeTkKuWGqQ0AyswxUj7ThQD1r8uMAX24Wuw uJYkAYg2o/sNhH/FDTExI0ZV2F8+JWgNU3lfgXJtKxSz9DTjpLLP8qaEU 0UwsxQYRxdQG7m8/PU7qLuNEW5DkSEXs5Q9skilyvRtDe7poof89d0GeY N4u3dUullG1lPnFN0Jso2af9YkhSobv9+M2QIU6yqNs+k661XHrlLZ71b hI9TX1a+cpsL52r+Pg45cLUREKxW8HB57Foq70T+E59FR/5gHe8Av4L0J A==; X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="432495854" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="432495854" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2023 14:11:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10775"; a="753469037" X-IronPort-AV: E=Sophos;i="6.01,215,1684825200"; d="scan'208";a="753469037" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 18 Jul 2023 14:11:42 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id BDADD33B; Wed, 19 Jul 2023 00:11:49 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Shuah Khan , David Gow , Daniel Latypov , "Steven Rostedt (Google)" , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Brendan Higgins , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Masami Hiramatsu , Andrew Morton Subject: [PATCH v4 2/4] x86/asm: Replace custom COUNT_ARGS() & CONCATENATE() implementations Date: Wed, 19 Jul 2023 00:11:45 +0300 Message-Id: <20230718211147.18647-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230718211147.18647-1-andriy.shevchenko@linux.intel.com> References: <20230718211147.18647-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230718_221242_164716_66B2E6FC X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace custom implementation of the macros from args.h. Signed-off-by: Andy Shevchenko --- arch/x86/include/asm/rmwcc.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h index 7fa611216417..4b081e0d3306 100644 --- a/arch/x86/include/asm/rmwcc.h +++ b/arch/x86/include/asm/rmwcc.h @@ -2,12 +2,7 @@ #ifndef _ASM_X86_RMWcc #define _ASM_X86_RMWcc -/* This counts to 12. Any more, it will return 13th argument. */ -#define __RMWcc_ARGS(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _n, X...) _n -#define RMWcc_ARGS(X...) __RMWcc_ARGS(, ##X, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) - -#define __RMWcc_CONCAT(a, b) a ## b -#define RMWcc_CONCAT(a, b) __RMWcc_CONCAT(a, b) +#include #define __CLOBBERS_MEM(clb...) "memory", ## clb @@ -48,7 +43,7 @@ cc_label: c = true; \ #define GEN_UNARY_RMWcc_3(op, var, cc) \ GEN_UNARY_RMWcc_4(op, var, cc, "%[var]") -#define GEN_UNARY_RMWcc(X...) RMWcc_CONCAT(GEN_UNARY_RMWcc_, RMWcc_ARGS(X))(X) +#define GEN_UNARY_RMWcc(X...) CONCATENATE(GEN_UNARY_RMWcc_, COUNT_ARGS(X))(X) #define GEN_BINARY_RMWcc_6(op, var, cc, vcon, _val, arg0) \ __GEN_RMWcc(op " %[val], " arg0, var, cc, \ @@ -57,7 +52,7 @@ cc_label: c = true; \ #define GEN_BINARY_RMWcc_5(op, var, cc, vcon, val) \ GEN_BINARY_RMWcc_6(op, var, cc, vcon, val, "%[var]") -#define GEN_BINARY_RMWcc(X...) RMWcc_CONCAT(GEN_BINARY_RMWcc_, RMWcc_ARGS(X))(X) +#define GEN_BINARY_RMWcc(X...) CONCATENATE(GEN_BINARY_RMWcc_, COUNT_ARGS(X))(X) #define GEN_UNARY_SUFFIXED_RMWcc(op, suffix, var, cc, clobbers...) \ __GEN_RMWcc(op " %[var]\n\t" suffix, var, cc, \