From patchwork Fri May 5 08:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 90349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp243432vqo; Fri, 5 May 2023 01:42:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5AAOog9u7TsPKPB1iJzYI0wJj3Fg6khVz0TQB3QEhfksH6UPxSnPt9lp5KkTX20caD0ihS X-Received: by 2002:a17:907:36cb:b0:961:272d:bdb9 with SMTP id bj11-20020a17090736cb00b00961272dbdb9mr503220ejc.43.1683276124861; Fri, 05 May 2023 01:42:04 -0700 (PDT) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id qw34-20020a1709066a2200b00965e9a1b724si565287ejc.475.2023.05.05.01.42.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 01:42:04 -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=AUXKNi6k; 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 BB605385380E for ; Fri, 5 May 2023 08:41:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB605385380E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683276064; bh=4wYMWUlLj2tYrIZBW7ziU6uZ3rvLsvnEYhYEUqRTr98=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=AUXKNi6knCH6LhzwhGjpaXGK/XDw4CBwQhN/xyEGx60iJORUnDLrPpM431qLrpvbX l5DYQFobtG6B1aI0H0aL2yLRT58M7xi+LBVT/iYsZF8dGHo38w7hpvUyX7OPQ3GNJE E0djkT7dx+KqR3/Lv6f3s6es6Hwd8uAxg39brPNs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2087.outbound.protection.outlook.com [40.107.21.87]) by sourceware.org (Postfix) with ESMTPS id 325483858D35 for ; Fri, 5 May 2023 08:40:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 325483858D35 Received: from AM6PR10CA0049.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::26) by DB4PR08MB8079.eurprd08.prod.outlook.com (2603:10a6:10:385::5) 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 08:39:59 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:80:cafe::26) 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 08:39:59 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) 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:59 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Fri, 05 May 2023 08:39:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f7e59cfc3080eafb X-CR-MTA-TID: 64aa7808 Received: from 966e4080c061.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 961135F8-2E09-4EEE-9F99-AEE3D1803894.1; Fri, 05 May 2023 08:39:51 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 966e4080c061.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 May 2023 08:39:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gIoc1Wwc52UkVgB21809qYYMEZyTSqkWdl6x9P4vX2LtX7O2CHzJeU3iATfAEkcSY4AtNV9ZUnTsmhcVuxyKOmMOUTOoUos2dTMVPBibMJIHbb9bxjN+Enq33oRdrlFP/R9IIHtv/RUz4Oq/im90Nr107qC09zuxkmJFUlA6Ei2wDdXtBuJentUpzcku2iUx/7fKsC7M0yoIwuMXGmZ47cdVDEunxWkSi53lstueAPWqT20mKHmSpVQOgDAeUhR35X201xM34ycCtiUapb/xKBHkoVAZo/llKn4hkyyA5Gu0t3CaI2/5hnpKxV63ROfuN1g3DrQ7Imhvx10sYXQ5Dw== 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=4wYMWUlLj2tYrIZBW7ziU6uZ3rvLsvnEYhYEUqRTr98=; b=NfOTy9lJiTKBUDtBPwdji55HvbB8NASUV2AldXuyPC0oplYXzOhY7mz9xRL7Wz5naJ1rrJe0TQhMGR8W/ukikShkjmOy233pbozlfqsJ855reivVyPHk9v+r8oRQ/n4Bk5epWu7JlVN0E6B9gW/7D6u2CD6ycUbCFxSpDIVA4YkDjUi8WR5vYfYh0WVJia9W4WxoG40Ux4llQ4hBEElTwvWjVF+Su8kAA6WoOO4f7xsq9l4ySK0c5s3s/fxQOzhQffPwgk/BXNqTVGh7w/4/7RmFlvhd+nRAnW9SFbRFFAStuABbuJj2GyxebdALrh0QNVefWETCEORg6OwgqGNKGg== 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 AS9PR06CA0513.eurprd06.prod.outlook.com (2603:10a6:20b:49d::8) by DB8PR08MB5387.eurprd08.prod.outlook.com (2603:10a6:10:115::9) 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 08:39:48 +0000 Received: from AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49d:cafe::8) by AS9PR06CA0513.outlook.office365.com (2603:10a6:20b:49d::8) 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:48 +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:47 +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:46 +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:45 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 01/23] arm: [MVE intrinsics] add binary_round_lshift shape Date: Fri, 5 May 2023 10:39:08 +0200 Message-ID: <20230505083930.101210-1-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT020:EE_|DB8PR08MB5387:EE_|AM7EUR03FT013:EE_|DB4PR08MB8079:EE_ X-MS-Office365-Filtering-Correlation-Id: ebf59605-b7ae-42e4-e31c-08db4d444f92 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: NyL8ruzxfO0faj/+UxmIde/wRo3EHTrcNhqJS7YT0T081wpA7nro+c4eSa2567NrE2AFGatU3G59Kee5JtnsSImQpob5btNBtHfVwqCmIhO61cdpv43zv/Gch4kA0U8Ei+i+LAaUpcwgWi0mGOeITv17YS2mSzoCKY3AkJRk9x4kWr5YeFKBX39uXRwi0bhWGQRjnoEr84cIg/U0hybMrOuJ0ShG4A6qMP7wVUTijvqS0Ok9V5I5yrAAJ00xaYa7qpvM0RcEmyVmP2ZympQ1Kn2auAv/lmSW34FqDYZQXQ5Kgd4eFRKysq2bSOdcziqSh8yZPKjhJOh2CIrkYNAv4HiCi23BUcMp8uqYxBP/ogPWF27fFpINy9Fvz/iysFHN6igGSf74ywQrTrArKIlWtyQKT222Ij3v6bdXUo9ozPhKHPOCddAya/FY5Bmjix2sk/qQjnK8FJPkSamVNfT+iaijPDTN4Zf+dJUopf4tvnVhsvg8T7MisyiO+zgC8boayzSJhsEfdi/0uiwcQuy4tijHdIPYFLtBV16YZtD0Je54ztHEZUJu4B1rS9eUd8nN6CJqBW7yzujbK8MkJb5ZUL/zceBtWiAUyz1NrKKUAkdf0s1w9Ybgv7Gh+bsVwFLM1nqoAZR1BU0FzpkiDla8TTtFVOTk1KSj4IsCfUnc94L+K0BLIw5BKqbXfu4Djtu/scEOqCrXuoJVSlBz0MCVs92A8OZPOPGecBzJ+vUZd5qxrkCzCYzyCRN2zMKBjxJ8WvoYhtJgwWPPuPodBbVksA== 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)(396003)(346002)(376002)(39860400002)(136003)(451199021)(40470700004)(36840700001)(46966006)(40460700003)(7696005)(478600001)(6636002)(4326008)(70206006)(70586007)(316002)(110136005)(86362001)(6666004)(36756003)(426003)(336012)(47076005)(2616005)(36860700001)(1076003)(26005)(8936002)(5660300002)(8676002)(44832011)(41300700001)(82310400005)(40480700001)(2906002)(82740400003)(186003)(356005)(81166007)(34020700004)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5387 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9478d6b5-c495-4423-d6fb-08db4d444899 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uGRRMeq7afcbmWGAHnPJk2eWHMelI1eQlbxKLPUU2z87Zxl0p0uJNTexoB1vQVV1i3ZuVaRcmtLla8kSxV7U0z4gNdicz8L8NybwAO7nHSF0ZTdLMqcTmzkUppkrtkikbB4JqV1URLiRQYiDJ8dgArtcLxxjtbth7d9Iyro7r4VkhtAWaNs9USnJEip66itWAsJgbXzZYvA2/EiWdF9B1eASpvx9Kd1VSv9QbXnOoc7VCw0dpWKHQa/Sgz8BZc4mCuEEFBpbtB+4gzc1bBjo2uZcY6yVOTCMbarhcjWiOX0Fg0gWCLuyR7dAlCVVSOm3j5RW5SAm8/oJohSiXjK3o8N/BEv9kf5gq3IrB/WresyrHC+ixPzCc6NJvHK/pgT+uGZOEP7rGenpJPh9aT5n77GZH3t+IGJV2cro/FPrHKWhVPxrzzsMMf2R1mSygauJepl0ae5rA/pGZwKWqjnNf57iR2VPa/do7hq5UmudH1RV4xW5LEdsiRrhi7F3aGJLWx0/9RD+dUeX3MxmRVjuTCMPDe1KYGJZr/VidBAET2jsVb3KbX7ZrC3TYy5guEprFHhnA41BL4xAgslrnqgMv4oIXIbSXe14zScJQ+t6kCAQtayMpjuu1PE3vvMpLGVYt9mcQqjyBoBmhI1QUkRO/gn+KMZlTk1ehmqZJGi32YKW9OG0y2HosyBMH4pGs3rwNk3UpUxrXp+ZaxLhYTvqE1belUVTEvYOKz0MOOSljCA= 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)(136003)(39850400004)(346002)(376002)(396003)(451199021)(36840700001)(40470700004)(46966006)(4326008)(6636002)(44832011)(70206006)(70586007)(41300700001)(5660300002)(8936002)(8676002)(26005)(1076003)(110136005)(478600001)(316002)(7696005)(6666004)(2906002)(2616005)(47076005)(426003)(336012)(40460700003)(186003)(36860700001)(81166007)(82740400003)(40480700001)(34020700004)(82310400005)(86362001)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 08:39:59.0573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebf59605-b7ae-42e4-e31c-08db4d444f92 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: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB8079 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?1765042946028923719?= X-GMAIL-MSGID: =?utf-8?q?1765042946028923719?= This patch adds the binary_round_lshift shape description. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_round_lshift): New. * config/arm/arm-mve-builtins-shapes.h (binary_round_lshift): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 61 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 62 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 5e6681c784a..28a2d66ddd1 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -458,6 +458,67 @@ struct binary_orrq_def : public overloaded_base<0> }; SHAPE (binary_orrq) +/* _t vfoo[t0](_t, _t) + _t vfoo[_n_t0](_t, int32_t) + + Shape for rounding shift left operations. + + Example: vrshlq. + int8x16_t [__arm_]vrshlq[_n_s8](int8x16_t a, int32_t b) + int8x16_t [__arm_]vrshlq_m_n[_s8](int8x16_t a, int32_t b, mve_pred16_t p) + int8x16_t [__arm_]vrshlq[_s8](int8x16_t a, int8x16_t b) + int8x16_t [__arm_]vrshlq_m[_s8](int8x16_t inactive, int8x16_t a, int8x16_t b, mve_pred16_t p) + int8x16_t [__arm_]vrshlq_x[_s8](int8x16_t a, int8x16_t b, mve_pred16_t p) */ +struct binary_round_lshift_def : public overloaded_base<0> +{ + bool + explicit_mode_suffix_p (enum predication_index pred, enum mode_suffix_index mode) const override + { + return ((mode == MODE_n) + && (pred == PRED_m)); + } + + bool + skip_overload_p (enum predication_index pred, enum mode_suffix_index mode) const override + { + switch (mode) + { + case MODE_none: + return false; + + /* For MODE_n, share the overloaded instance with MODE_none, except for PRED_m. */ + case MODE_n: + return pred != PRED_m; + + default: + gcc_unreachable (); + } + } + + 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, false, preds_m_or_none); + } + + 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); + } +}; +SHAPE (binary_round_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 3305d12877a..cef081aa8ec 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -37,6 +37,7 @@ namespace arm_mve extern const function_shape *const binary; extern const function_shape *const binary_opt_n; extern const function_shape *const binary_orrq; + extern const function_shape *const binary_round_lshift; extern const function_shape *const create; extern const function_shape *const inherent; extern const function_shape *const unary_convert;