From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A0525458F5; Tue, 3 Sep 2024 13:52:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F9644042C; Tue, 3 Sep 2024 13:52:57 +0200 (CEST) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id D5840402D0 for ; Tue, 3 Sep 2024 13:52:55 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WykSB0v93z6J84x; Tue, 3 Sep 2024 19:49:30 +0800 (CST) Received: from frapeml500005.china.huawei.com (unknown [7.182.85.13]) by mail.maildlp.com (Postfix) with ESMTPS id E612B140B38; Tue, 3 Sep 2024 19:52:54 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500005.china.huawei.com (7.182.85.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 3 Sep 2024 13:52:54 +0200 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.039; Tue, 3 Sep 2024 13:52:54 +0200 From: Konstantin Ananyev To: Stephen Hemminger , "Varghese, Vipin" CC: "ferruh.yigit@amd.com" , "bruce.richardson@intel.com" , "konstantin.v.ananyev@yandex.ru" , "aman.deep.singh@intel.com" , "dev@dpdk.org" Subject: RE: [PATCH v2 1/3] app/testpmd: add register keyword Thread-Topic: [PATCH v2 1/3] app/testpmd: add register keyword Thread-Index: AQHa89f+I0n4XrNHb0iCABJqGzKARbIxqvwAgAl4UQCAACOogIAKta0A Date: Tue, 3 Sep 2024 11:52:54 +0000 Message-ID: <0ae233fb72ce49cea5186e1f924db76b@huawei.com> References: <20240716063724.850-1-vipin.varghese@amd.com> <20240821143857.1972-1-vipin.varghese@amd.com> <20240821143857.1972-2-vipin.varghese@amd.com> <20240821075502.3faa0997@hermes.local> <20240827103924.1d1d2711@hermes.local> In-Reply-To: <20240827103924.1d1d2711@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.138.42] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > > > > > >> diff --git a/app/test-pmd/macswap_sse.h b/app/test-pmd/macswap_sse.h > > >> index 223f87a539..29088843b7 100644 > > >> --- a/app/test-pmd/macswap_sse.h > > >> +++ b/app/test-pmd/macswap_sse.h > > >> @@ -16,13 +16,13 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, > > >> uint64_t ol_flags; > > >> int i; > > >> int r; > > >> - __m128i addr0, addr1, addr2, addr3; > > >> + register __m128i addr0, addr1, addr2, addr3; > > > Some compilers treat register as a no-op. Are you sure? Did you check= with godbolt. > > > > Thank you Stephen, I have tested the code changes on Linux using GCC an= d > > Clang compiler. > > > > In both cases in Linux environment, we have seen the the values loaded > > onto register `xmm`. > > > > ``` > > registerconst__m128i shfl_msk =3D _mm_set_epi8(15, 14, 13, 12, 5, 4, 3,= 2, > > 1, 0, 11, 10, 9, 8, 7, 6); > > vmovdqaxmm0, xmmwordptr[rip+ .LCPI0_0] Yep, that what I would probably expect: one time load before the loop start= s, right? Curious what exactly it would generate then if 'register' keyword is misse= d? BTW, on my box, gcc-11 with '-O3 -msse4.2 ...' I am seeing expected beha= vior without 'register' keyword. Is it some particular compiler version that misbehaves? =20 > > > > ``` > > > > Both cases we have performance improvement. > > > > > > Can you please help us understand if we have missed out something? >=20 > Ok, not sure why compiler would not decide to already use a register here= ?