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 E4F2841EAA; Thu, 16 Mar 2023 03:43:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FAE140FDF; Thu, 16 Mar 2023 03:43:15 +0100 (CET) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2041.outbound.protection.outlook.com [40.107.8.41]) by mails.dpdk.org (Postfix) with ESMTP id 84B5C40EF1 for ; Thu, 16 Mar 2023 03:43:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pnIcbUB89NZIW9MwMcrzYdvn31/9j9LiSsqa2+APLjc=; b=TMEgMZFWmxXpEYi/ic/hdGsYD6M3TorX4C3HxFJ8fw3f758aLzpCvpopXLONXUGzfy70qGnNGm9sYa3j92Xh75+NZi05ut0DqC07cYv4KWoUEw4e5b/64/lWv78rewule/I+jx/m/YVJ38PSeW+X2kTqNOoZpf8AiSOedqC+INA= Received: from DB6P18901CA0008.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:16::18) by DU0PR08MB9417.eurprd08.prod.outlook.com (2603:10a6:10:420::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Thu, 16 Mar 2023 02:43:11 +0000 Received: from DBAEUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:16:cafe::d2) by DB6P18901CA0008.outlook.office365.com (2603:10a6:4:16::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.25 via Frontend Transport; Thu, 16 Mar 2023 02:43:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT005.mail.protection.outlook.com (100.127.142.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6199.16 via Frontend Transport; Thu, 16 Mar 2023 02:43:11 +0000 Received: ("Tessian outbound fcd8b5fba459:v135"); Thu, 16 Mar 2023 02:43:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 15b91cc14b01bfa2 X-CR-MTA-TID: 64aa7808 Received: from 93c88f686a4b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0037C9F5-9970-443F-ABFA-6233A0A2491E.1; Thu, 16 Mar 2023 02:43:04 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 93c88f686a4b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 16 Mar 2023 02:43:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+Y95nLdCtYjo3d8o8OBCOSW/vOsZVUXiwvFooBCU7wgTMiJJPoQ6vbWLX5CLcXAmrHE4AZoRqSRRUVFILkQUoPh6mU7d/ONwC492lHyHwc1NCNKgVafLmNpzkm7bpjAMllKbzcUZJKarBL66RU2Dx5wZ7ORNUxMQL8ngbBKEq5ATojZilAR0W54Nc98vQR51yNBPXdFAjvFzu97caxID1KGzkVsS2dLOVWt0hJ0kjsPrP1fqHnINMx34ERWsfLcYDZcXWjKmQAiJ0YyqSWjw4gf4ANaWpL4VG1mE91sHbpXGnt7lxgXIUoi2rEkOJBijc/bxTuzhh4ZkfblzVlsng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pnIcbUB89NZIW9MwMcrzYdvn31/9j9LiSsqa2+APLjc=; b=N7yvnEG9pisj0d6xrmatgqUmbtjAoh2x5A479PSgaXZeu3ndb1R4HW4RSg5Fjkmv7qnk/T3CUfmtXF/zHvcdxBqtu+Ue9l+Q3u3OhcrUbLGBgybL3XBAuO/aTgDb9ggrsMnSMobC7swsnJmB5U33Rzzahocu6gn9cLiqKDg2FcNkFP9PzkkdzYcCy3Z6rRKVonc6eNzBZgGeYIwONPYB5FnGHtHJywySRx6vhHyifM5LPikwUuyJGtEZ5dFOb3KU+LUGMkHoQv4W2ijPCOsq8yWw40AposuhyPckVo2VN0FdsksSbWq/9ieKv7K9oIfIiATLCGRJICumjti/6U8ZNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pnIcbUB89NZIW9MwMcrzYdvn31/9j9LiSsqa2+APLjc=; b=TMEgMZFWmxXpEYi/ic/hdGsYD6M3TorX4C3HxFJ8fw3f758aLzpCvpopXLONXUGzfy70qGnNGm9sYa3j92Xh75+NZi05ut0DqC07cYv4KWoUEw4e5b/64/lWv78rewule/I+jx/m/YVJ38PSeW+X2kTqNOoZpf8AiSOedqC+INA= Received: from AS8PR08MB7080.eurprd08.prod.outlook.com (2603:10a6:20b:401::19) by AM8PR08MB6513.eurprd08.prod.outlook.com (2603:10a6:20b:366::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.31; Thu, 16 Mar 2023 02:42:58 +0000 Received: from AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::3e2c:a99c:db5b:601f]) by AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::3e2c:a99c:db5b:601f%6]) with mapi id 15.20.6178.031; Thu, 16 Mar 2023 02:42:57 +0000 From: Ruifeng Wang To: Srikanth Yalavarthi CC: "dev@dpdk.org" , Shivah Shankar Shankar Narayan Rao , "david.marchand@redhat.com" , nd , nd Subject: RE: [PATCH v2 1/1] mldev: split bfloat16 routines to separate files Thread-Topic: [PATCH v2 1/1] mldev: split bfloat16 routines to separate files Thread-Index: AQHZVaPWSa+eiM2DCES5dVmL4b0Uda77nkEAgAAL7oCAADGIAIAAzBKw Date: Thu, 16 Mar 2023 02:42:56 +0000 Message-ID: References: <20230313114342.10812-1-syalavarthi@marvell.com> <20230313120306.28911-1-syalavarthi@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 838C9182B791A246AC9C17A958BC2EE5.0 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AS8PR08MB7080:EE_|AM8PR08MB6513:EE_|DBAEUR03FT005:EE_|DU0PR08MB9417:EE_ X-MS-Office365-Filtering-Correlation-Id: 22100be1-f263-48b6-0040-08db25c82f1b x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gfDIJgX7kyB+9PFVyfn91f5x+G2RmHm0FCgpLG0fRzJWfd9DMN/JI8Tdu7CHlfgbdXXLr3/KN9i3RCiLbmXyyXI4mWKkkI9gd0gOYvc/OGxQJ2O0DQK9CYp/iHfOZ5/kplbkv+7smW0bGRfmImPlhAGWPgAvgWb0MaRP2yOOnYJ0DvqJWyTCIxvCz2ndABLsbYHLiN4Y5Fx3xJTMMwT5cAM5sem8yuYcOtvQooaHS+vCpJCmrn5e7iaAKWAw4Ox4mYTHHNhv4eDHZYGCbW/A3o0iZrM03zX7ud6BBU9j+3E6rpBxO0DvOrHGUp9G98ISKjML+f9ZPkVAz5yibvQSumIqmPlO1YPP2ayJQNpYbchfCIujfA3SaLzgrds3W2mUlWb+e4CPr9u96FkmNfNixWaTOh2PZGtpy0xOO2D3R/dRtmCRFwaQRGjnzny/QHQiStJwqoo+jqLKy+oFDRfuSIrdLuZpqcswT87KXqv7/ThYdvx3rjmMMABcshpooFJmTrnPHp6kht5f4c+cyVtGs1did7rKEJyQwfxpQKm5DILMSLd3WtTuRxFCb4VEmm/JfiHdLi1/wm2kSMbCUVSCAC6j7LMtvk3JoR6rTgmREJlw/NZkOGqAxMPtN9Fye7EuQimfzpnKnvpoGrZo8xIWpTAZkIwj9puv0kD0M4axDWgeEZ+2H0d3cxwgvkZbgZeD X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB7080.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(396003)(39860400002)(346002)(376002)(136003)(366004)(451199018)(8936002)(66476007)(66446008)(64756008)(66946007)(66556008)(52536014)(76116006)(8676002)(6916009)(4326008)(41300700001)(55016003)(38100700002)(33656002)(86362001)(38070700005)(5660300002)(122000001)(2906002)(966005)(7696005)(71200400001)(9686003)(53546011)(186003)(6506007)(26005)(66899018)(54906003)(478600001)(316002)(83380400001); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6513 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 465db629-da5f-4190-878e-08db25c8263c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 94ZNQvZ607pqSyBVUAFSh1GqP15UXZGntzDjmDHEYLoDa9/THp7f0hKahYpREHisrcQW2kllzAlBXYk+ztPiTLra8P6SHzzH+4RtkrNyzBpeGY8LyUh+d8/c6GFpbA8k5yGPORtl7da2km0Sp9F0chhJfBDoewbKf09ANrFSZsN9xtOP0yQHLYkEkiDrCFUwJxnoccbs/N1KyKImCLKu5soTUvmrgNqrB4QO4DcD9rPIWEGDAEdec8JQHWqf/8Q9oyFJ/s9/ZrRrIA5ZbK7lGtg5NUsh1zH4mDBU3JjBXw6xMo9SwrqjvXZHfm8vbv+U8c1lpWSQviQU4ZGs3NnTcPYJjW9XV+jDYQ9cAoWSFiRDmh2tdW4NVsi2gUMbiDBZxmnC/EjslQUZdxcuFsdjOFcuCu3MB0WwynFdOe6i0WvpJ1QwaXd4GX5++hLBY9a6HYFDk+YBBGgaTnTGTQgrQWBxHGhPcAUntz+KAdnpUXpZIjUH17awvWKrw6qt+SqTfHp45GgK+9cGpZgbZ+y7AZkJ+QMLhovkPLJbAUSI+vdSbTN/8maEBbrgBgivy/NKNPl98tyAyyINe1H+UYC/Vsexv1oNnTCUQldJtndeDkDDpkxYwageS0ObOwG6i5S/i5czojVEUa7vp4rjw3EHDkKalAwwgJcUuIxpGhc8DUDIvWrYQN/9Ev7y4O4CFO0A X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199018)(36840700001)(40470700004)(46966006)(66899018)(7696005)(54906003)(6862004)(70206006)(41300700001)(82310400005)(478600001)(8676002)(8936002)(52536014)(40460700003)(70586007)(966005)(82740400003)(40480700001)(356005)(86362001)(55016003)(36860700001)(33656002)(81166007)(26005)(5660300002)(53546011)(9686003)(186003)(4326008)(2906002)(6506007)(316002)(83380400001)(336012)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2023 02:43:11.7042 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22100be1-f263-48b6-0040-08db25c82f1b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9417 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 > -----Original Message----- > From: Srikanth Yalavarthi > Sent: Wednesday, March 15, 2023 9:39 PM > To: Ruifeng Wang > Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao ; > david.marchand@redhat.com; nd ; Srikanth Yalavarthi > Subject: RE: [PATCH v2 1/1] mldev: split bfloat16 routines to separate fi= les >=20 > > -----Original Message----- > > From: Srikanth Yalavarthi > > Sent: 15 March 2023 16:12 > > To: Ruifeng Wang > > Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao > > ; david.marchand@redhat.com; nd > > ; Srikanth Yalavarthi ; Srikanth > > Yalavarthi > > Subject: RE: [PATCH v2 1/1] mldev: split bfloat16 routines to separate > > files > > > > > -----Original Message----- > > > From: Ruifeng Wang > > > Sent: 15 March 2023 15:32 > > > To: Srikanth Yalavarthi > > > Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao > > > ; david.marchand@redhat.com; nd > > > > > Subject: [EXT] RE: [PATCH v2 1/1] mldev: split bfloat16 routines to > > > separate files > > > > > > External Email > > > > > > -------------------------------------------------------------------- > > > -- > > > > -----Original Message----- > > > > From: Srikanth Yalavarthi > > > > Sent: Monday, March 13, 2023 8:03 PM > > > > To: Srikanth Yalavarthi ; Ruifeng Wang > > > > > > > > Cc: dev@dpdk.org; sshankarnara@marvell.com; > > > david.marchand@redhat.com > > > > Subject: [PATCH v2 1/1] mldev: split bfloat16 routines to separate > > > > files > > > > > > > > Since bfloat16 intrinsics are not supported on all ARM platforms > > > > that support NEON, > > > > bfloat16 routines are moved to separate files. > > > > This would enable using scalar implementation for bfloat16 on > > > > unsupported > > > ARM platforms. > > > > > > > > Bugzilla ID: 1179 > > > > Fixes: fc54766b1612 ("mldev: add Arm NEON type conversion") > > > > > > > > Signed-off-by: Srikanth Yalavarthi > > > > --- > > > > Depends-on: patch-120653 ("mldev: remove weak symbols use in type > > > > conversions") > > > > Depends-on: patch-125035 ("mldev: fix identical code in > > > > conditional > > > > branches") > > > > > > > > lib/mldev/meson.build | 11 +- > > > > lib/mldev/mldev_utils_neon.c | 142 +------------ > > > > lib/mldev/mldev_utils_neon_bfloat16.c | 154 ++++++++++++++ > > > > lib/mldev/mldev_utils_scalar.c | 262 +-------------------= ---- > > > > lib/mldev/mldev_utils_scalar.h | 80 ++++++++ > > > > lib/mldev/mldev_utils_scalar_bfloat16.c | 197 ++++++++++++++++++ > > > > 6 files changed, 445 insertions(+), 401 deletions(-) create mode > > > > 100644 lib/mldev/mldev_utils_neon_bfloat16.c > > > > create mode 100644 lib/mldev/mldev_utils_scalar.h create mode > > > > 100644 lib/mldev/mldev_utils_scalar_bfloat16.c > > > > > > > > diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build index > > > > c9db42257b..5769b0640a > > > > 100644 > > > > --- a/lib/mldev/meson.build > > > > +++ b/lib/mldev/meson.build > > > > @@ -7,12 +7,21 @@ sources =3D files( > > > > 'mldev_utils.c', > > > > ) > > > > > > > > -if dpdk_conf.has('RTE_ARCH_ARM64') > > > > +if (dpdk_conf.has('RTE_ARCH_ARM64') and > > > > + cc.get_define('__ARM_NEON', args: machine_args) !=3D '') > > > > > > I found in ACLE document that "__ARM_NEON" is always set to 1 for > > > AArch64". > > > So this line of check is redundant? > > > > Checking for __ARM_NEON should be enough. > > We can drop the dpdk_conf.has('RTE_ARCH_ARM64') check. > > I will test the builds and submit a revised patch. > > >=20 > Correction. Ideally checking for RTE_ARCH_ARM64 is enough. >=20 > But, __ARM_NEON check is required when building with gcc-4.8.x I have tes= ted this on > CentOS-7 with GCC-4.8.5 Refer https://bugs.dpdk.org/show_bug.cgi?id=3D117= 9 >=20 > Below errors, are reported with GCC-4.8, when __ARM_NEON check is not use= d Thanks for the clarification. So some NEON intrinsics are not supported by = earlier GCC. Acked-by: Ruifeng Wang >=20 > ../lib/mldev/mldev_utils_neon.c:220:2: warning: nested extern declaration= of > 'vcvtas_u32_f32' [-Wnested-externs] > ../lib/mldev/mldev_utils_neon.c: In function '__uint8_to_float32_neon_f32= x1': > ../lib/mldev/mldev_utils_neon.c:297:2: warning: implicit declaration of f= unction > 'vcvts_f32_u32' [-Wimplicit-function-declaration] > *output =3D scale * vcvts_f32_u32((uint32_t)*input); > ^ > ../lib/mldev/mldev_utils_neon.c:297:2: warning: nested extern declaration= of > 'vcvts_f32_u32' [-Wnested-externs] > ../lib/mldev/mldev_utils_neon.c: At top level: > ../lib/mldev/mldev_utils_neon.c:604:51: error: unknown type name 'float16= _t' > __float32_to_float16_neon_f16x4(float32_t *input, float16_t *output) > ^ >=20 > So, we will need both checks. >=20 >=20 > > > > > > > sources +=3D files('mldev_utils_neon.c') else > > > > sources +=3D files('mldev_utils_scalar.c') endif > > > > > > > > +if (dpdk_conf.has('RTE_ARCH_ARM64') and > > > > + cc.get_define('__ARM_NEON', args: machine_args) !=3D '' and > > > > > > Same here. > > > > > > > + cc.get_define('__ARM_FEATURE_BF16', args: machine_args) !=3D '= ') > > > > + sources +=3D files('mldev_utils_neon_bfloat16.c') > > > > +else > > > > + sources +=3D files('mldev_utils_scalar_bfloat16.c') > > > > +endif > > > > + > > > > headers =3D files( > > > > 'rte_mldev.h', > > > > ) > > >