From patchwork Fri May 12 09:38:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 69218 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A4B653854158 for ; Fri, 12 May 2023 09:39:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4B653854158 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683884395; bh=yILdk8uE/PVQhGqlI4hWRCVdWodqyxrLIGfsGa69kJs=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Wnn4bmjXyFOl+8gLfLA7/iGbyRjGyzrwkauSy00joUjGDBxYDPjNG9NvO1IQ55mka hZ7FdBfBUzTHWDQt9z0P5qKTb57eoCpCmAsHeZBsE6yvV5f81dDwy3AnFJDa0kYFvp vIAqAslGxSuQnjO8/TyBBv/8HxMB33FK20IzXskQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2064.outbound.protection.outlook.com [40.107.241.64]) by sourceware.org (Postfix) with ESMTPS id 6100E385696A for ; Fri, 12 May 2023 09:39:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6100E385696A Received: from DB6P195CA0023.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::33) by DB9PR08MB8738.eurprd08.prod.outlook.com (2603:10a6:10:3d2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Fri, 12 May 2023 09:39:11 +0000 Received: from DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:cb:cafe::f8) by DB6P195CA0023.outlook.office365.com (2603:10a6:4:cb::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.21 via Frontend Transport; Fri, 12 May 2023 09:39: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 DBAEUR03FT034.mail.protection.outlook.com (100.127.142.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.23 via Frontend Transport; Fri, 12 May 2023 09:39:11 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Fri, 12 May 2023 09:39:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3c6ad96ff7d89647 X-CR-MTA-TID: 64aa7808 Received: from eda447ef318c.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BE1C969A-A7BF-418C-B10B-0086599A388E.1; Fri, 12 May 2023 09:39:05 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eda447ef318c.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 May 2023 09:39:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bo0nFkjE33H5Vld3XEYL+Mf96IT+l+wNQ0Q21crA6IjYDfGGqGYNWfGNB6WCowij2HR5e17vEx+d4luyIaV5UQZ6is3yGkdlGyUzS/3TymXDo/D8Gsocss4ZTxr9c6PCdM6VBGNbB+gzo0c19aFEy0MOPXhRGlMhBInVkvLycxfdeJcL5294MGZTmh0l180ce6OH5Ui4pZN9/9KOOOc8yvOf/z6AfoepdCBAo5IMQZSrwYYc6C7f7qOIL7xpL4AcHeTzDOz4bEc2lWUMZTDXCEx3OsoM1sw+0JkR2tcs82bgGkHI0lFO0OtB3AseOlpFAo4jAiKH7Ldx+Yfg0qyqtg== 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=yILdk8uE/PVQhGqlI4hWRCVdWodqyxrLIGfsGa69kJs=; b=QgYIrmphZFyzpJV+3vMpObbw6zAt/TJdP5nEC0ovQC1iotEJSvaSCO3aaqIh+VZ1UNFg307uXgvV/b5Q1/J11Jf+P4jmecbTisRW17TVAyaH0cEkqYkZUi8TnvHVK/2aEW7GzDcgv7/l8QemeZuTBKVVEKkgus/sXlUM7qhq2qdCfopNDa8mr5nCnRijPKJocLotPu+CUSmFHSHfgEIbjU5KT5CDwTlJgvgHUuVoXCayyion9D17UHjPDSe9/vUSNc9qELTVcH3mEyJdXOSV8jbXVnuSFhWPDKabMljXZuxH6OSUI45Gb6zoi7ogBhD6dZxRHch3zdGSQ2+AZslehA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AS9PR04CA0031.eurprd04.prod.outlook.com (2603:10a6:20b:46a::10) by PA4PR08MB7547.eurprd08.prod.outlook.com (2603:10a6:102:26d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.20; Fri, 12 May 2023 09:39:02 +0000 Received: from AM7EUR03FT051.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46a:cafe::6c) by AS9PR04CA0031.outlook.office365.com (2603:10a6:20b:46a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.24 via Frontend Transport; Fri, 12 May 2023 09:39:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT051.mail.protection.outlook.com (100.127.140.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.23 via Frontend Transport; Fri, 12 May 2023 09:39:01 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 12 May 2023 09:38:57 +0000 Received: from e129018.arm.com (10.57.21.161) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 12 May 2023 09:38:56 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 06/26] arm: [MVE intrinsics] add binary_lshift_unsigned shape Date: Fri, 12 May 2023 11:38:35 +0200 Message-ID: <20230512093855.79529-6-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230512093855.79529-1-christophe.lyon@arm.com> References: <20230512093855.79529-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT051:EE_|PA4PR08MB7547:EE_|DBAEUR03FT034:EE_|DB9PR08MB8738:EE_ X-MS-Office365-Filtering-Correlation-Id: efc0b4d2-be73-4591-993e-08db52ccbdf9 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: NhrUo/9voBPiHn6jCuLqOPcxdz6bY4wRU2Zhefe48/bmvNYc2XSl9/JFu0vSRBsw8wxXv6NwUTPRsfu372ksYe8vColRMXvlb6lbwpeFvcHlxK7RGYsqIBu6p3hI2O3sWQA3sgpemG5I/85YM5mXZ88u6iJzTYdmHw3osOIX6VGKi9ZjDrn2CzHlKxgca3HxXmQXKOpdP0QLU/GnDxRTxF0NjXVGX/XdlXkP0v56kACw5A15vUwOVuMpAurNbtgmYCnzG9EouDVKGWcZdWBULJpVbvrxQ1qLAuLtTuvKC8F6rJBdQde4cI848NdfjIfPpwrURktnUT1N1d1xoigo3R21xhx35gAPdv08Eu7vylnHY8+qu39PDFmlv8gKAcm0NBEq8SHKW5JlhvjMyRVf/NOmXRH7iLjl+GTjR5MT2QRloQePPoR7HfYrGcoE2YLNcxK8cpF++v2fzLPLnvF098fEy6FaPufMRhYCz70yleryBrNEjkzOIHd2+fiqhzeLNKA9P/8+Qg/r7swbkqjMUekkhVqlJNVO/ITiVJH15uG+frNAYw9yCEu1SqQBWOBQsR3+T+9o7gYTCnUzUrR1Np66z4RMMLJWA4y7q9m0J+NDJ4ncWywSwiGPH+Gjx4WadskyPEen3s1h1qZkbCcimA1N0A8LkcQWVjTIFzfy9xs4bvQLSzXENyMQR8rQV29FKT4R4Ndi2/JwvoRFD/4/e4lfZIc4URJUYWcu3nn6B0jvq2YobKFIjfK+TRypMsAT X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(136003)(39860400002)(396003)(346002)(376002)(451199021)(36840700001)(46966006)(81166007)(4326008)(5660300002)(40480700001)(356005)(316002)(478600001)(44832011)(41300700001)(336012)(36860700001)(426003)(110136005)(47076005)(70586007)(70206006)(6636002)(82740400003)(2616005)(8676002)(8936002)(26005)(186003)(1076003)(86362001)(82310400005)(36756003)(2906002)(7696005)(4001150100001)(6666004)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7547 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 30fc895e-8d43-49e3-3e95-08db52ccb822 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dCC9qBLuuECgx+USndNk146m1aWOX3x3VCfRb6N180P1xgjxsdGvpobyy6AAcqs3UzLDPADLk41B4ZXzaCYbqs0IA6OPh8VSyMysYquXUY8xoquNsLmOoBIdSAXp9ES92pe+U/rtqRFhWIKsb3fqx+6cHQcLeRxwK50jqtiuX+BX4IQWKfuJ3i4HopG5QDNoUJn5P7TFoo/jLRmAfzcH3AuQJ0R1XwZmz5k3cDSUqrP0UGx9g3ntykwzdGY3ZV6E+mIIlx0KO9BJTwoWMNoVbTiz8xi4K0lMRmJM+n30t3/tdfypyeYv1SnLuE347Y39f1vgyIZe+TAVIpHtrjm67Xflykwq3IN2iB8LS/siIFhJryUKZeieGr0xD0a2eadtCmgwUHFPEEzzKNfwZYboBjBdTG3YPmndq14qyHE5dfYFqvy/n1dEa60b9dRAU1+UR/UxMrTF4EEj8rwSFrD77E2eiavq2eyjuFn821Z4zAxW4ztc92DuHXJG7zAZd9nkfFmKAeE/EWvw0Z4y+WQlXjFq25nWUx+vTmolDrBTuspHItqKa4A7br1Y5fFTnbjRFyr9XmT+SvtrBnCmLcbY57KkcfJruPh2ljso4Bb1A89iiQzdfBrQdedd/KeWFNs4WOLZ+6ZQFtfEcac+ZZ2UMw+25GKbtrcXgSeXDd9OfMJnLqEH+sYq0P979OksT0Vu8XEo2NYK5GhWWQrEW1d1PQ== 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:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(1076003)(26005)(47076005)(81166007)(2616005)(6666004)(7696005)(82740400003)(426003)(36860700001)(186003)(36756003)(44832011)(41300700001)(4326008)(2906002)(40460700003)(8676002)(70206006)(40480700001)(70586007)(4001150100001)(478600001)(110136005)(82310400005)(86362001)(5660300002)(336012)(8936002)(316002)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 09:39:11.6958 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: efc0b4d2-be73-4591-993e-08db52ccbdf9 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: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8738 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christophe Lyon via Gcc-patches From: Christophe Lyon Reply-To: Christophe Lyon Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This patch adds the binary_lshift_unsigned shape description. 2022-12-12 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_lshift_unsigned): New. * config/arm/arm-mve-builtins-shapes.h (binary_lshift_unsigned): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 58 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 59 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index ee4bc3f8ea4..91540838e03 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -526,6 +526,64 @@ struct binary_rshift_def : public overloaded_base<0> SHAPE (binary_rshift) +/* _t vfoo[_n_t0](_t, int) + + Shape for vector saturating shift left operations that take a + vector of signed elements as first argument and an integer, and + produce a vector of unsigned elements. + + Check that 'imm' is in the [0..#bits-1] range. + + Example: vqshluq. + uint16x8_t [__arm_]vqshluq[_n_s16](int16x8_t a, const int imm) + uint16x8_t [__arm_]vqshluq_m[_n_s16](uint16x8_t inactive, int16x8_t a, const int imm, mve_pred16_t p) */ +struct binary_lshift_unsigned_def : public overloaded_base<0> +{ + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + b.add_overloaded_functions (group, MODE_n, preserve_user_namespace); + build_all (b, "vu0,vs0,ss32", group, MODE_n, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (2, i, nargs) + || (type = r.infer_vector_type (i-1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + if (r.pred == PRED_m) + { + /* With PRED_m, check that the 'inactive' first argument has + the expeected unsigned type. */ + type_suffix_index return_type + = find_type_suffix (TYPE_unsigned, type_suffixes[type].element_bits); + + if (!r.require_matching_vector_type (0, return_type)) + return error_mark_node; + } + + for (; i < nargs; ++i) + if (!r.require_integer_immediate (i)) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } + + bool + check (function_checker &c) const override + { + unsigned int bits = c.type_suffix (0).element_bits; + return c.require_immediate_range (1, 0, bits - 1); + } + +}; +SHAPE (binary_lshift_unsigned) + /* _t vfoo[_t0](_t, _t) i.e. binary operations that take a vector of unsigned elements as first argument and a diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 07b12b4af68..6ae1443f26b 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -41,6 +41,7 @@ namespace arm_mve extern const function_shape *const binary_acc_int64; extern const function_shape *const binary_acca_int32; extern const function_shape *const binary_acca_int64; + extern const function_shape *const binary_lshift_unsigned; extern const function_shape *const binary_maxamina; extern const function_shape *const binary_maxavminav; extern const function_shape *const binary_maxvminv;