From patchwork Fri May 5 16:49:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 68847 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 39402385357B for ; Fri, 5 May 2023 16:52:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39402385357B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683305525; bh=nikgTg67km8I1I8N4zdn2lWErWYkRIm01mgIEHdyB+g=; 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=qi0dlo1+4UPPwqdSD8jY3vkcWMXDsx8y2qyzxL5uij23eS8EJG4ah9jIUBYpnIYZn l2fnyf/sZIpG4odU2KOfw6iyMyAUUa//MARvojlo/knWCV/x7IrsYSYBm9zRt419f8 /voedu3dIkUQP+2ffvy9kJEkqJcDsZKa4Ei8UOXc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2044.outbound.protection.outlook.com [40.107.8.44]) by sourceware.org (Postfix) with ESMTPS id 315CD3856968 for ; Fri, 5 May 2023 16:49:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 315CD3856968 Received: from AM6PR10CA0049.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::26) by AS2PR08MB10323.eurprd08.prod.outlook.com (2603:10a6:20b:5fe::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27; Fri, 5 May 2023 16:49:36 +0000 Received: from AM7EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:80:cafe::ec) by AM6PR10CA0049.outlook.office365.com (2603:10a6:209:80::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27 via Frontend Transport; Fri, 5 May 2023 16:49:36 +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 AM7EUR03FT044.mail.protection.outlook.com (100.127.140.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.13 via Frontend Transport; Fri, 5 May 2023 16:49:36 +0000 Received: ("Tessian outbound 8b05220b4215:v136"); Fri, 05 May 2023 16:49:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4d13baa0b01e11cd X-CR-MTA-TID: 64aa7808 Received: from 8edebf0a04ab.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 94C6B187-6C49-4E0C-B8BB-FD5CE228E601.1; Fri, 05 May 2023 16:49:29 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8edebf0a04ab.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 May 2023 16:49:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g6HWgg5SiBd3swS1e85OF2PsbJLo0joaOtQmqtXBsUyGqvOwwEWpaAusDKkFnL4HEcSpFWcewkEwVTfxFLLAgCsx5kIRxmmDcFteuEXVbQqbRzwCD7l7zNFrY51JdFsKzFwwa1UVHDGJHaWtP9yvplYnm6FD27qnrm87ZvISFBSYlJG0pq42Zrb81uZ64Bra7SnuqS0pmsmD/sdxqH8CTPhbQiQTTEWDQJgi35dYqdrRT0r2Fl9JAMCqNmo408fcJjzyU6xXFyfUrNWIZi1kJpI3tLSuyHPnMriSAM1zJEa6CPoEaK6Dm6KC4EH7/4COMbbq39XTAeiuvF5cEAC4mQ== 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=nikgTg67km8I1I8N4zdn2lWErWYkRIm01mgIEHdyB+g=; b=i5Vb+9Y43sy9fBmOHycVHGNP7X+DD9vYgEUDRFAyWlutZsYRiqoxIVmK9TeeUl2GDrS5S0sInuR7RJZPNt+sU2vURCAzIDqBVlBCnW8ScL7EJazFDp1w2bDpCK6LHdFR5b3D9O6hHDjsEEuXXVTKP+fSiM+fGMWhSVWJhFidGrtUg1m2H7nM0IyyQ4GSkVgITJ9RSy0MW5tZL81kPIrwctF4N2YUQ8yhg9A8ettiJqDCbNJz/loBtkdzA1Q+ZnqN9xcsUKH3PgthiP/fGZ2hC2kGsGfG9RF4jSzGJqBze/TaM0cGzsgoL6hxkp2bWUJHvWcTUacKrbCT2/XYF43BUQ== 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 DB6PR07CA0112.eurprd07.prod.outlook.com (2603:10a6:6:2c::26) by AM9PR08MB6001.eurprd08.prod.outlook.com (2603:10a6:20b:2d5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27; Fri, 5 May 2023 16:49:28 +0000 Received: from DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2c:cafe::20) by DB6PR07CA0112.outlook.office365.com (2603:10a6:6:2c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.11 via Frontend Transport; Fri, 5 May 2023 16:49:26 +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 DBAEUR03FT049.mail.protection.outlook.com (100.127.142.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.27 via Frontend Transport; Fri, 5 May 2023 16:49:26 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 5 May 2023 16:49:17 +0000 Received: from e129018.arm.com (10.57.22.112) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 5 May 2023 16:49:17 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 08/10] arm: [MVE intrinsics] add binary_widen_n shape Date: Fri, 5 May 2023 18:49:04 +0200 Message-ID: <20230505164906.596219-8-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230505164906.596219-1-christophe.lyon@arm.com> References: <20230505164906.596219-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT049:EE_|AM9PR08MB6001:EE_|AM7EUR03FT044:EE_|AS2PR08MB10323:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a602496-ceba-47b9-e90f-08db4d88b5f4 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: ukCRg+KRdaAUCjEEcjT8jyK1N8rauoT/bemZAjXEJldmN9LOJj+XImVXmuo3ZkiOWVK14S6VjT6tpHCCeEaWCiF7DLybyACc4oG0cIooZqj0WE0ZBlMx5xBqC9VMy6El6a3HeSc+bdTiRW0nWfm7i39XxcFxxByEqFYvhF3N6N1UmkRq3CDb56Szsi9ADLQScONyDRzOoS1Vfbp0gBF8toU76kGeA+kWH8C98jhNxV1TNwTQRdyvVwaPeZVkSE5hffaWxZBj8+T8K3x+3xkvRx68V+IiCkJgqcz8VUNVHlhpfAmAN9Z32Oau/eS4rFVan0IILQoS45mwFtzA+JpWRc8UI5IhFaLrG0rEswBD+q2TjxPo7g1SMGxa86SaoNImzJjAmAoljSFklt8RG8RLkIDwXTxJtTGTwcYJpmumH49HdraXZ2itgB1gY1ibeX0cgtcH+TXH6CtgOBBgb8VDuFTh+aAXey4KVQzGRZ28YaKOG49AZ6uc/wau++eChJXREbzRgz9N3NOxiTWqlS+/xuau1UjKKeYfPOaUhbbI9pnYxaZZjYr83OjjWt0wzGpvLSQj08jUy75MLIIGwVp79vHcCpv/A2wXx47nEWcLSyqeCtOz/aQy0rTgvUEyDgpcJ1MrhUWV5mZQDNU/zIbOSBKI7yT3HewFqClOePXN6Okgovw9fDK/cnTtgFQ2SJVqbdFEPtDalBp7hRJuD/66OCOb6AhFQfhqTCgyUNrcf2o= 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)(376002)(346002)(396003)(39860400002)(451199021)(46966006)(40470700004)(36840700001)(36756003)(86362001)(110136005)(316002)(6636002)(4326008)(70586007)(70206006)(7696005)(6666004)(478600001)(41300700001)(40480700001)(82310400005)(8936002)(5660300002)(8676002)(2906002)(44832011)(82740400003)(81166007)(356005)(186003)(36860700001)(1076003)(26005)(47076005)(426003)(336012)(2616005)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6001 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 614a38e0-519e-4a3b-71f3-08db4d88aff7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4vPSyAOEF4wJr81u/cYvKlm46ivTCK/YEkZ0YTGtj9eLWMQYEFLwF76y7frhyb+H1+M0IHwCgz8Q89Y4DK8+eQRvzjMU/QfTyQpLP4xIqCPk6HkRWG/+GcKeW5Px1rN6EBjEHgYXXa4VyZWJFT295YqoAmVJ74GvFy8Y80MQu9aS4XNcZg7YLKgT+sqE/4oqVt/mTYornv0e9fvWtuBbsq1+wgSf0tr5ax6Q+SpQV/kpL1LCL0B8ZCZcOZDOruOjdkwi9XveD9CBkJ8s82ZIr/qG9BEIHP5TD5ncyasO9qlVpLGRAMGN53SWCBYflZKcXW9NkU+yBapaWZytz2249Tp2svI+gUidms1SPjkRuNzPbTmExk/WEWCn+BjhGaMPD178j5HlXbVVXaaQotTvIkV71K2S4XcUn86HnOpQevkaB/JVh29103xTKXdkd6o9/jvz1n1YUegv7uLbjY1GEYXnERRqPOvY3yBtiPuVjTF85YXeFYH9uar/jxtxaHhwkMRrfJVGqGbXd7WsvoSVgur2+/hpdSsYBrhgHOxdVpIbdmYdCebjGlerO0K+Pw+/my/Kzd5CcH5P4pIlSUSRbl8DQ2bmh1WzbGLsuLXceBSZYpin8/4fb0bKWFL6D9Sg+0Fi4/hDUKnNR1JPQswtVKvzhAkfDwN/+XEWz+oSXb2+s0NDgftOEspVoyL1Hv0LRFsta3x9iUBRTrbYWAFCJQ== 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)(346002)(376002)(136003)(39860400002)(396003)(451199021)(46966006)(40470700004)(36840700001)(40460700003)(70586007)(70206006)(4326008)(7696005)(6636002)(316002)(110136005)(86362001)(36756003)(478600001)(6666004)(47076005)(426003)(336012)(2616005)(1076003)(36860700001)(26005)(8936002)(8676002)(2906002)(44832011)(41300700001)(5660300002)(82310400005)(40480700001)(81166007)(186003)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 16:49:36.6049 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a602496-ceba-47b9-e90f-08db4d88b5f4 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: AM7EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10323 X-Spam-Status: No, score=-12.5 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_widen_n shape description. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_widen_n): New. * config/arm/arm-mve-builtins-shapes.h (binary_widen_n): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 53 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 54 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index e26604510a2..1d43b8871bf 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -821,6 +821,59 @@ struct binary_rshift_narrow_unsigned_def : public overloaded_base<0> }; SHAPE (binary_rshift_narrow_unsigned) +/* _t vfoo[_n_t0](_t, const int) + + Check that 'imm' is in the [1..#bits] range. + + Example: vshllbq. + int16x8_t [__arm_]vshllbq[_n_s8](int8x16_t a, const int imm) + int16x8_t [__arm_]vshllbq_m[_n_s8](int16x8_t inactive, int8x16_t a, const int imm, mve_pred16_t p) + int16x8_t [__arm_]vshllbq_x[_n_s8](int8x16_t a, const int imm, mve_pred16_t p) */ +struct binary_widen_n_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, "vw0,v0,s0", group, MODE_n, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + tree res; + if (!r.check_gp_argument (2, i, nargs) + || (type = r.infer_vector_type (i - 1)) == NUM_TYPE_SUFFIXES + || !r.require_integer_immediate (i)) + return error_mark_node; + + type_suffix_index wide_suffix + = find_type_suffix (type_suffixes[type].tclass, + type_suffixes[type].element_bits * 2); + + /* Check the inactive argument has the wide type. */ + if (((r.pred == PRED_m) && (r.infer_vector_type (0) == wide_suffix)) + || r.pred == PRED_none + || r.pred == PRED_x) + if ((res = r.lookup_form (r.mode_suffix_id, type))) + return res; + + return r.report_no_such_form (type); + } + + bool + check (function_checker &c) const override + { + unsigned int bits = c.type_suffix (0).element_bits; + return c.require_immediate_range (1, 1, bits); + } + +}; +SHAPE (binary_widen_n) + /* xN_t vfoo[_t0](uint64_t, uint64_t) where there are N arguments in total. diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 825e1bb2a3c..dd2597dc6f5 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -45,6 +45,7 @@ namespace arm_mve extern const function_shape *const binary_rshift; extern const function_shape *const binary_rshift_narrow; extern const function_shape *const binary_rshift_narrow_unsigned; + extern const function_shape *const binary_widen_n; extern const function_shape *const create; extern const function_shape *const inherent; extern const function_shape *const unary;