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 9BE44A034C; Mon, 12 Dec 2022 08:16:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 312D74021D; Mon, 12 Dec 2022 08:16:15 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2053.outbound.protection.outlook.com [40.107.13.53]) by mails.dpdk.org (Postfix) with ESMTP id F0FC140151 for ; Mon, 12 Dec 2022 08:16: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=jT9naJwMvfDbfoqa4t4rq+FY1mHNTGoDqKp1lpJrDZk=; b=l0pRhXNKJTDlbQsm8R2XT7WPXhLj3uqHMxys58AcF1FFMn4GEnN4p/a5LDXf/dMpxewNoREF/H6+lZVlfIkOw2E9Ifkdxp9XnOtVwgQRXeU0xfQYkynOJ4SKgmb/ndelNa8gQmeOH1HxSqVX/uO0B1pXwdQnuz3Ybz+0DTygS2A= Received: from DUZPR01CA0049.eurprd01.prod.exchangelabs.com (2603:10a6:10:469::9) by AS2PR08MB9365.eurprd08.prod.outlook.com (2603:10a6:20b:597::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.8; Mon, 12 Dec 2022 07:16:12 +0000 Received: from DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:469:cafe::4a) by DUZPR01CA0049.outlook.office365.com (2603:10a6:10:469::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 07:16: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 DBAEUR03FT054.mail.protection.outlook.com (100.127.142.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.20 via Frontend Transport; Mon, 12 Dec 2022 07:16:11 +0000 Received: ("Tessian outbound 73ab5f36653e:v130"); Mon, 12 Dec 2022 07:16:11 +0000 X-CR-MTA-TID: 64aa7808 Received: from 234c656d93fe.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 77284AA5-685E-4F2E-9FFD-DB44EF1DEE99.1; Mon, 12 Dec 2022 07:16:05 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 234c656d93fe.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 12 Dec 2022 07:16:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kOfPSpujoWCiCy65ZRRJ0RWgZNpwzh1C8y4bEant3Dw+vRJR+3xMPovYeBNzJl5RQIQMVMP0wVkJ8iiGxhD3mhlzEDGgVVaC/Mc+xJPlorkRdqwoYluSHYLTYRByaR74aTNwEnMrx/uf+JmQomVi3SGNwtX+wucOvdeNHV3/5Af7ManIL+N7MtG6qan9o3y8UUE2mEcHNa4ODBcLh9VAay/WFVZuVhwWq7f8f1d2s0fv8wP45iBFR++oS+bPWA9sq+zyH+/lE3xI7DdU9b901SueEFC41uGbkqNXX7kv4jdKJNAkHXr5OsGNVRXPARUnjCVxkgYMoDzBsmUm2CSDbg== 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=jT9naJwMvfDbfoqa4t4rq+FY1mHNTGoDqKp1lpJrDZk=; b=M1/8oT2GU0FinQoVJikdklu3/3DUIcaC55STIDQTNTsiZMwTypZmhIeFdVY2G6p+C0ieIQrd7rv8IdY5WCNMz9XxQ51dqB5+FTXEo+TPAxY+bQd3BxMBD/tcd7SoB7SnshMOYLUqRU+ucgTgj6x8TzDaHf5asCT6I3BSn0eqKYQLb0tlwuHUT8XgwpDTVz6GVtlq+kwXBtyKP/ATWq3LOXHko3Rqb332F2+pRvRo3lh8r+BcLlbUeVxLR87WrgdSWmi70GqqqXNllU5DwYx9LA+zypzzmF0IBUrNTQTnw7vEwFFvex9m/YccCbCV8dmiEd+96He7dUd3C4oYqZcVdw== 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=jT9naJwMvfDbfoqa4t4rq+FY1mHNTGoDqKp1lpJrDZk=; b=l0pRhXNKJTDlbQsm8R2XT7WPXhLj3uqHMxys58AcF1FFMn4GEnN4p/a5LDXf/dMpxewNoREF/H6+lZVlfIkOw2E9Ifkdxp9XnOtVwgQRXeU0xfQYkynOJ4SKgmb/ndelNa8gQmeOH1HxSqVX/uO0B1pXwdQnuz3Ybz+0DTygS2A= Received: from AS8PR08MB7080.eurprd08.prod.outlook.com (2603:10a6:20b:401::19) by AS8PR08MB5928.eurprd08.prod.outlook.com (2603:10a6:20b:29b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.9; Mon, 12 Dec 2022 07:16:04 +0000 Received: from AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::7a19:6a76:8969:ae6]) by AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::7a19:6a76:8969:ae6%4]) with mapi id 15.20.5924.009; Mon, 12 Dec 2022 07:16:03 +0000 From: Ruifeng Wang To: Srikanth Yalavarthi CC: "dev@dpdk.org" , "sshankarnara@marvell.com" , "jerinj@marvell.com" , "aprabhu@marvell.com" , nd Subject: RE: [PATCH v1 4/4] common/ml: add Arm NEON type conversion routines Thread-Topic: [PATCH v1 4/4] common/ml: add Arm NEON type conversion routines Thread-Index: AQHZCzxK1cMWLgagKk6Ugs2cmKzBSa5p1gWA Date: Mon, 12 Dec 2022 07:16:03 +0000 Message-ID: References: <20221208193532.16718-1-syalavarthi@marvell.com> <20221208193532.16718-5-syalavarthi@marvell.com> In-Reply-To: <20221208193532.16718-5-syalavarthi@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 9F6D1E28BC703545AEF8F2D91C20EB88.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AS8PR08MB7080:EE_|AS8PR08MB5928:EE_|DBAEUR03FT054:EE_|AS2PR08MB9365:EE_ X-MS-Office365-Filtering-Correlation-Id: bcf6255f-1619-4a66-47be-08dadc10bf87 x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr 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: ayjfZNtN9THeVpvsbTZPeFl5CNj5cLXMMCCa+l57jKG/34tzFl/vz+HFzm/sEw14uRch+tKbSTLKDbHAaaoA1nT+Y/lSfo+9xga4kpYX+gbjIf299I4NO7x4ai4pfGh1Ay8PYfNHF2muW6c4gQoIKj0zlqbszxFOqxbjxqe1zRsfvRzTp9UP56DBj95B/DRBTc/zt0I3x3Mh6a+VhLgfBIu2F/vbGT64SVaWrK2p2n/jV1NBpc+a4fS2ge5zW9HXDHEZMLx9Bws0cXp+85jJLeaWLKjL4NUfJowuXEqjwvmxe/zwqzkXFzjZH2Db6c/Q4Wai/IH5dWk+X0w6sD6dYEGHHLxdznwdy1gbdP0Tiztb+wkxob66rFtTCDw+BQcIfYyptjpgov8huWOv67siI7WCSe4A0yVrFCOKFL6hXg9lgK3Y7JDtxWoecR+lSeDQ/MtenYPDdatDfFeAdyyjICWBzE4Tt50nXlzoAn1/y4hIpax0eixvGfMrc4DLs1CsBD5eYxMYBpepENm4wh+of3r3cHghi6mjSC3bQICoRHmsT+jDXnw9wpw9lafRIQWqnjMMNPP4wnIrePa3IICAVR3L+rlCN3dEbDMnkQeydRVaCBDj4TS2CQAo316z7j7KhG0ZnZGFMGC7EKmQl7oR98hbCuJ5TJJ2REjOSnuu2lxzWrbpGZMwpAAcl/gNRdz7itZEOksAZTTmqy8gmOJ3FA== 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:(13230022)(4636009)(396003)(136003)(376002)(366004)(39860400002)(346002)(451199015)(55016003)(6506007)(83380400001)(7696005)(478600001)(9686003)(53546011)(86362001)(2906002)(33656002)(38070700005)(54906003)(38100700002)(6916009)(76116006)(66446008)(66476007)(186003)(66556008)(71200400001)(26005)(64756008)(66946007)(4326008)(8676002)(122000001)(316002)(52536014)(5660300002)(41300700001)(8936002); 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: AS8PR08MB5928 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: DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c6c395d5-e9f8-4ec1-2c0e-08dadc10bad5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4M4kxKLoJANADXfLRKk2O6+hFEit1U+39RQDZWoEpN9bznB3vWKb5LAQBD1KYwYDk7Z4dNC2rXONQST+o/qsdH+8fyFJ3hmZEfruDCUXiSVxL/QdzJcasLzeerlN1x3YEyrZNaVXEDojUSl2L/Xu9ZAVX+26YeTVu7j3jQX+5qEiheEAFFubNI1IMjozK5gKPssYvC6s4Wu55I6WkCv/Lxt3rQ6MILtjf/lLRGnso6qjwvwJOAo/l96iJJ6q7MmtOewFP+SK/rv81C9FL3IPP+VzgQpH3DyEyXaTJ3YxzpsuQZ29EHGvQXEHLewc2IB4z04YogdntxiQuenEpiYQ7XHA48ahUUve6CdtDpN8DlhapiG+3XRGQd+8amn/IpKxNM2YTq/972+W00aoQY330xn4sZfCQUR81Rvl2f1fU7DQZw/SmPlSMUjw9AoiR0OiwcnpamO2NKIlxZcCax8wggs+S7Z75JFlv2WKUUn/ya764XSLYro7bZ+TjhzPZwHbY2e5XZGDaaqLREYL69RKMGMcP6zyeasx9GjjWwDnrqFeqNCu8P6MZvON9N8DJNLQKYh0Ao2kbrgOYEEiM6kZp/ZKAaCRzM8zVuSLo8jM5/BcVxjKl2NgUV0TjX9vp8TNy9AEP05dTs5YmrxzzS7FAnc/yR3jN2KGMfWU3BcAY8NqpMcwkdo3XVbPTGklCojcLdxsqcLmglt2/t44Im5seA== 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:(13230022)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(83380400001)(86362001)(40460700003)(33656002)(2906002)(478600001)(40480700001)(55016003)(356005)(336012)(36860700001)(82310400005)(47076005)(82740400003)(5660300002)(52536014)(26005)(9686003)(8676002)(41300700001)(186003)(81166007)(7696005)(53546011)(6506007)(6862004)(4326008)(8936002)(316002)(70206006)(70586007)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 07:16:11.7091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bcf6255f-1619-4a66-47be-08dadc10bf87 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: DBAEUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9365 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: Friday, December 9, 2022 3:36 AM > To: Srikanth Yalavarthi ; Ruifeng Wang > Cc: dev@dpdk.org; sshankarnara@marvell.com; jerinj@marvell.com; aprabhu@m= arvell.com > Subject: [PATCH v1 4/4] common/ml: add Arm NEON type conversion routines >=20 > Added ARM NEON intrinsic based implementations to support conversion of d= ata types. > Support is enabled to handle int8, uint8, int16, uint16, float16, float32= and bfloat16 > types. >=20 > Signed-off-by: Srikanth Yalavarthi > --- > drivers/common/ml/meson.build | 5 + > drivers/common/ml/ml_utils.c | 48 ++ > drivers/common/ml/ml_utils_neon.c | 950 ++++++++++++++++++++++++++++++ > drivers/common/ml/ml_utils_neon.h | 23 + > 4 files changed, 1026 insertions(+) > create mode 100644 drivers/common/ml/ml_utils_neon.c create mode 100644 > drivers/common/ml/ml_utils_neon.h >=20 > diff --git a/drivers/common/ml/meson.build b/drivers/common/ml/meson.buil= d index > 84ae84ee4e..f7ce19b4b4 100644 > --- a/drivers/common/ml/meson.build > +++ b/drivers/common/ml/meson.build > @@ -17,6 +17,11 @@ sources =3D files( > 'ml_utils_generic.c', > ) >=20 > +if arch_subdir =3D=3D 'arm' > + headers +=3D files('ml_utils_neon.h') > + sources +=3D files('ml_utils_neon.c') endif > + > deps +=3D ['mldev'] >=20 > pmd_supports_disable_iova_as_pa =3D true > diff --git a/drivers/common/ml/ml_utils.c b/drivers/common/ml/ml_utils.c = index > e2edef0904..3edcf09fde 100644 > --- a/drivers/common/ml/ml_utils.c > +++ b/drivers/common/ml/ml_utils.c > @@ -120,71 +120,119 @@ ml_io_format_to_str(enum rte_ml_io_format format, = char *str, int > len) int ml_float32_to_int8(float scale, uint64_t nb_elements, void *in= put, void *output) > { > +#if defined(__ARM_NEON__) > + return ml_float32_to_int8_neon(scale, nb_elements, input, output); > +#else > return ml_float32_to_int8_generic(scale, nb_elements, input, output); > +#endif > } >=20 Maybe __rte_weak can be used to remove the ifdef clutter. Something like: ml_utils.c __rte_weak int ml_float32_to_int8(float scale, uint64_t nb_elements, void *= input, void *output) { return ml_float32_to_int8_generic(scale, nb_elements, input, output); } ml_utis_neon.c int ml_float32_to_int8(float scale, uint64_t nb_elements, void *input, void= *output) { return ml_float32_to_int8_neon(scale, nb_elements, input, output); } > diff --git a/drivers/common/ml/ml_utils_neon.c b/drivers/common/ml/ml_uti= ls_neon.c > new file mode 100644 > index 0000000000..b660de07ec > --- /dev/null > +++ b/drivers/common/ml/ml_utils_neon.c > @@ -0,0 +1,950 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright (c) 2022 Marvell. > + */ > + > +#include > +#include > +#include > + > +#include > +#include > + > +#include "ml_utils.h" > +#include "ml_utils_neon.h" > + > +#include This line can be removed. It is included rte_vect.h. Thanks.