From patchwork Fri May 5 08:39:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 90354 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp244584vqo; Fri, 5 May 2023 01:44:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HJZFfG+tyN+20LdNnfcuXmGYBlnHvkk2JQQDEWd6x6/dICIdcWUYOVrbNKYOlfpqkWC2v X-Received: by 2002:a17:907:97c2:b0:965:d18b:f019 with SMTP id js2-20020a17090797c200b00965d18bf019mr555389ejc.20.1683276293285; Fri, 05 May 2023 01:44:53 -0700 (PDT) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id r7-20020aa7d587000000b004fd16f5aa1bsi4233480edq.103.2023.05.05.01.44.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 01:44:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bwEG4Phc; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 38FE038560B7 for ; Fri, 5 May 2023 08:42:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38FE038560B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683276137; bh=DyUVg4L46zjZQFCh0Tg8XX8S+JE3BRZnPc7Ixhqrjn4=; 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=bwEG4Phcctx4Z6MK3FW83BqCtKab6hka9FHYILMQOYA1qlBl9K8qq4wNU6Jbq16R/ aYRFp0VJeM/vtNcWVwi/uzM5qWSsaap87SfuyANuNWiTbs0i4wC0BV/yJOfI824T1r pZbUVcDIJh1zYJi4gEs2ThHw4mwa448ofL4A6j+I= 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-vi1eur04on2081.outbound.protection.outlook.com [40.107.8.81]) by sourceware.org (Postfix) with ESMTPS id 1793A3856DF2 for ; Fri, 5 May 2023 08:40:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1793A3856DF2 Received: from DB6P192CA0003.EURP192.PROD.OUTLOOK.COM (2603:10a6:4:b8::13) by DB9PR08MB7445.eurprd08.prod.outlook.com (2603:10a6:10:36f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.21; Fri, 5 May 2023 08:40:02 +0000 Received: from DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b8:cafe::8b) by DB6P192CA0003.outlook.office365.com (2603:10a6:4:b8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.26 via Frontend Transport; Fri, 5 May 2023 08:40:02 +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 DBAEUR03FT004.mail.protection.outlook.com (100.127.142.103) 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 08:40:02 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Fri, 05 May 2023 08:40:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b5f47ec7d29cf9a5 X-CR-MTA-TID: 64aa7808 Received: from a43ece67fe9e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 45BEEAEF-E69B-4809-9C5F-30E61149B35E.1; Fri, 05 May 2023 08:39:54 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a43ece67fe9e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 May 2023 08:39:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZZKf9IDjgJ37xyL1zOHZFnPQugbLJDLzeGutR+Xcn45SulR+I+FaxH8jG+2Lmqv1Fu1hq7/8T78p7ZLhqA6athvH2fpVJBS+xll9X8M0/e8ZkDW/NnWBr7dkCZgedKmrbjQm2/4WyT3BV8pdtlq0Kj3s0YROwXHnQvahlr9Z5OnW2pXQ6f3H8xN6sNQA36cnFMzJdSL9PuDyCOKxz+cikgKJ0dJ+BcJxP/4oop6MOj5iN0Eby5S50kOcsGM+tfEZ3g1pAgKUd9vyInSvNmPw5uV3ukDLIDFr4I+6g1vyP8ptZVwAxUYmEe/z/MglLO5/mKaEOMqMhNgRNCXsyVoI1g== 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=DyUVg4L46zjZQFCh0Tg8XX8S+JE3BRZnPc7Ixhqrjn4=; b=gpa9FsESMp9cIuvqLIQUF0kNgdWv7S08pUY1bl79DujjLGNnDh4iui4cVln1K9cqqM8sBetT3PcYsGOR7OjAS9gahKlu9lajROGkIFXdCqfkgdWh6KYO71iv0D3VM2yFYuZHb7pNCnQ60czRSUiWS/T/BngorZ8bomhOoJSCPB3nw3xrDmiYzeH/MUH6P1s2eAer4YYerMkyZRtopOOQaKTmGGWcmfUgbHyFxgFneQlve1w6/v+Bsd+fC31MltAEEwZqXiWBWrE3uT0oI4Mo1PGIeZCnvUQv/iBaZR17shWRAKJtF7jUgCu0ku8y4txW0TnfunrXlhYt3wDrLbOWtg== 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 AS9PR06CA0525.eurprd06.prod.outlook.com (2603:10a6:20b:49d::16) by DU0PR08MB7833.eurprd08.prod.outlook.com (2603:10a6:10:3b6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22; Fri, 5 May 2023 08:39:52 +0000 Received: from AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49d:cafe::74) by AS9PR06CA0525.outlook.office365.com (2603:10a6:20b:49d::16) 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 08:39:52 +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 AM7EUR03FT020.mail.protection.outlook.com (100.127.140.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.12 via Frontend Transport; Fri, 5 May 2023 08:39:52 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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, 5 May 2023 08:39:49 +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 08:39:48 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 08/23] arm: [MVE intrinsics] add binary_lshift shape Date: Fri, 5 May 2023 10:39:15 +0200 Message-ID: <20230505083930.101210-8-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230505083930.101210-1-christophe.lyon@arm.com> References: <20230505083930.101210-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT020:EE_|DU0PR08MB7833:EE_|DBAEUR03FT004:EE_|DB9PR08MB7445:EE_ X-MS-Office365-Filtering-Correlation-Id: 382e61c3-101e-4f14-1b1e-08db4d4451cf 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: FB+FCA4oMMMG+0bmVhK6CwOcmnljALmTKCDko99UAP1uEzVn8XwpaBi5UwWA8w98u0vIHEmCS2u7DIQ8C6CxhwSdEdiuwdLBzc6XnEdt9vxWl0DbKxKZEvSoU8Kj2VPRINslVx91JzTTdvYhuzDJAtlkOkEbrXJ8qW5K/0fQzrOAWRVTMOFTrc7IEh0DMKEULeZQWWXATiiJVh6ps9RjKvD8W5qJT4TGTZsu3bxbYn/syRYKSxsiQpZoYm2YrYvDN6OcFTy4BRg8OQ2ZITiQ/uSGHVo6DhgAT6CvnwfHNpchOH0xP+cE9UQT2SxU8qIijLyBg29n/oHC9D8PBLBGgw1mV2qrOn+V8jbqB5DmeNdIg7RDuwpRJAnWMyBkJoIOj2IpaVNN6NAlczPp4RngyxxPm0gllDz7ouhR9/CwQxJ6q6bt63xseV40KYXpT/mTYznmpw79VFkOAxIW2IqUm0rxYMsNSml2DKQ46JJ5RmVwkAvOe6syGJXqTQVJzJOyVn5sP95mG/zQRzv7+T09GFqj2VA1DoUZtRGp9YV9j4QpTKToTSZEo3ocXDlsFcx4MhOyZPDy/cTrpFRrJkUEpa8bZx2uQEHwknfOeHvGCteXxwwzlejl+I7sPbrGn/jQ9vt3KbpJQ10xxPSiHMpykmtxKVSy+Gp4bg09S55BFtPnvakWEp5u11T4V1nz5rgpvDRRVwzU1FBMQf8uGpKCWKLJZ1KQCmt6fb3C7ODk5cYoH2eieqVkTn6itZGQdjK+UqMc7JsIMsY7qr/3jD1Niw== 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)(39860400002)(346002)(136003)(396003)(376002)(451199021)(36840700001)(46966006)(40470700004)(81166007)(70586007)(478600001)(2906002)(40460700003)(316002)(6636002)(82310400005)(70206006)(4326008)(7696005)(6666004)(36756003)(82740400003)(34020700004)(40480700001)(356005)(41300700001)(26005)(1076003)(2616005)(110136005)(86362001)(47076005)(36860700001)(8936002)(336012)(426003)(186003)(8676002)(44832011)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7833 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: bd420cba-d61b-4939-64f4-08db4d444bc4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gOGwbyJEM9Vylku4FWY8Bj9BT7b8ivg5iA5EYspyV8D7zNIkRpvR2dxSqjZtOinbqFaeWDRTwqevqSY7zl+NunCZympE9MvERD8OKSvb4iZUvL65VX/XSSnqcYwxAJCYgzwz3vCdKEh6E0Jaoz9z4gI8fanOR3jqKSKmc+v9EEINzNrDT7wUxSQXt6DrVS9Xw9ZLy9QVVVqxLs1SeQ0u9oYlTXQhrbvzJqaqA3PIWOU4lRntTFGh5sHIkGge+Hips8PLllvF+ozBgm2juZ1ORz1YjBrEegwCB2W0WLi+/57RkcBwz+qaWRO/rDIjhs9VeFZswbG4wnPpfruIWozytXVxYQQTk4ZdlPF5ifWETatJkvE7akmRkMoiyK6DaLTGBiHkKnPlHk/8qbJgkx0ee0M5mfhSfDIQsIMKAdSVVq8iSr3Dcupp5dB9zIf8UKvCuFqIUmZUma5hTFuRFr1FdOemrcx1GLcv5sI1tgumXhPo0s3iqUaO4WxBMZEuFOpxQWWre66+1FiHg3rpfH9L8ufM8t3hqNTF+BpEEa+1DhZwEMcIueV4nU79/yOLzQsbHzWRbKxfapaRv1hYspWwaYsUahu1mJijiquBK1iac02HL5JSWuFskNXF3B6+enwK7a6lCEBONSJMb8V5lHY6G1Rw8ppIcQCaHQtjnWJHZT0aO3abcEnw1nAeH522ExSuZnqQRbXoAzxCXp03ZQBO34Yu3E+/3Yj634bB5DFh2e0= 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)(396003)(346002)(39860400002)(376002)(136003)(451199021)(36840700001)(40470700004)(46966006)(426003)(478600001)(110136005)(1076003)(186003)(2616005)(336012)(26005)(6666004)(36860700001)(47076005)(7696005)(6636002)(70206006)(41300700001)(4326008)(70586007)(316002)(34020700004)(8936002)(5660300002)(8676002)(82740400003)(2906002)(40460700003)(44832011)(81166007)(40480700001)(86362001)(36756003)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 08:40:02.8543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 382e61c3-101e-4f14-1b1e-08db4d4451cf 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: DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7445 X-Spam-Status: No, score=-12.4 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765043122573899879?= X-GMAIL-MSGID: =?utf-8?q?1765043122573899879?= This patch adds the binary_lshift shape description. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_lshift): New. * config/arm/arm-mve-builtins-shapes.h (binary_lshift): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 57 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 58 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 28a2d66ddd1..e5093c3f29d 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -519,6 +519,63 @@ struct binary_round_lshift_def : public overloaded_base<0> }; SHAPE (binary_round_lshift) +/* _t vfoo[_t0](_t, _t) + _t vfoo_n[_t0](_t, const int) + + i.e. the standard shape for left shift operations that operate on + vector types. + + For the MODE_n versions, check that 'imm' is in the [0..#bits-1] range. + + Example: vshlq. + int8x16_t [__arm_]vshlq[_s8](int8x16_t a, int8x16_t b) + int8x16_t [__arm_]vshlq_m[_s8](int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p) + int8x16_t [__arm_]vshlq_x[_s8](int8x16_t a, int8x16_t b, mve_pred16_t p) + int8x16_t [__arm_]vshlq_n[_s8](int8x16_t a, const int imm) + int8x16_t [__arm_]vshlq_m_n[_s8](int8x16_t inactive, int8x16_t a, const int imm, mve_pred16_t p) + int8x16_t [__arm_]vshlq_x_n[_s8](int8x16_t a, const int imm, mve_pred16_t p) */ +struct binary_lshift_def : public overloaded_base<0> +{ + bool + explicit_mode_suffix_p (enum predication_index, enum mode_suffix_index) const override + { + return true; + } + + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + b.add_overloaded_functions (group, MODE_none, preserve_user_namespace); + b.add_overloaded_functions (group, MODE_n, preserve_user_namespace); + build_all (b, "v0,v0,vs0", group, MODE_none, preserve_user_namespace); + build_all (b, "v0,v0,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 (0)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + return r.finish_opt_n_resolution (i, 0, type, TYPE_signed); + } + + bool + check (function_checker &c) const override + { + if (c.mode_suffix_id != MODE_n) + return true; + + unsigned int bits = c.type_suffix (0).element_bits; + return c.require_immediate_range (1, 0, bits - 1); + } +}; +SHAPE (binary_lshift) + /* 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 cef081aa8ec..e472862ceef 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -35,6 +35,7 @@ namespace arm_mve { extern const function_shape *const binary; + extern const function_shape *const binary_lshift; extern const function_shape *const binary_opt_n; extern const function_shape *const binary_orrq; extern const function_shape *const binary_round_lshift;