From patchwork Tue May 9 12:19: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: 91574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2840514vqo; Tue, 9 May 2023 05:28:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hQgfaSRovOOL4j1VFys/4KsGpWygf1sl5tHqnrmO7bGkVWGvH5ijO71f/Rxdr7qr/UvfP X-Received: by 2002:a17:907:3183:b0:965:626a:26cc with SMTP id xe3-20020a170907318300b00965626a26ccmr11404872ejb.65.1683635287302; Tue, 09 May 2023 05:28:07 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ka7-20020a170907990700b0094f54c032dbsi2011114ejc.154.2023.05.09.05.28.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 05:28:07 -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=oqbGksZ+; 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 C9D3F382A2F6 for ; Tue, 9 May 2023 12:24:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9D3F382A2F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683635040; bh=Sf3+TfnkLlOoo5n3ABoC5uwCQF7j7aJ4EVTEiD4b0N4=; 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=oqbGksZ+B0ryivXQusFk35v9bGIyhs9LAee0ahcmfr3tSlQ9Yl+SxwYkk37nxqRQC 2d561x820+oiFx2/ptdKFR1zsoyWH1zxjunDvbvDGq+tvlmpIPC3HULCMWrN37RMl6 QAWfWW6FpVpRs1b5y3fCisfRZgkN7HgLIxEShYzA= 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-vi1eur02on2059.outbound.protection.outlook.com [40.107.241.59]) by sourceware.org (Postfix) with ESMTPS id E8B8C3858C2C for ; Tue, 9 May 2023 12:20:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E8B8C3858C2C Received: from DU2PR04CA0193.eurprd04.prod.outlook.com (2603:10a6:10:28d::18) by DBAPR08MB5685.eurprd08.prod.outlook.com (2603:10a6:10:1ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Tue, 9 May 2023 12:20:01 +0000 Received: from DBAEUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28d:cafe::30) by DU2PR04CA0193.outlook.office365.com (2603:10a6:10:28d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33 via Frontend Transport; Tue, 9 May 2023 12:20:01 +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 DBAEUR03FT038.mail.protection.outlook.com (100.127.143.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18 via Frontend Transport; Tue, 9 May 2023 12:20:01 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Tue, 09 May 2023 12:20:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 933091a9d2c67e0e X-CR-MTA-TID: 64aa7808 Received: from 1002828821a0.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 98D44430-0F53-48B2-A876-971D58F52E48.1; Tue, 09 May 2023 12:19:54 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1002828821a0.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 09 May 2023 12:19:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mpb5oJe1pk7KQnrH7X99cpnchsPnMjL1+8wIqY8xUc3KtijrgxHas8JBE6poS9HS1as00AV9WFCy98pUtugD9bXP5V7TPKSMyI7bDLOu7ihX7PIwUClkxOSilRT1FLPXjRtaxUckuRFbF8S1PZli+0IV0Xf8YF3i+j2WL+Uj9nsAaIbIEf0lXzpB9wKP35ksUcfdv2Kd69PjPIJmwWevyO9ZonUQiwfNsrcg89zXkhOChI0HHUviP8b3oEI2r5L/+4fJm1/tfxQiy0H+ZNHaJpmtjtzvXuxCnPQ07+F4F8P05x5GaSeADUzcybMckswI/MHh4D6AzaT4Ut+oEeNpiw== 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=Sf3+TfnkLlOoo5n3ABoC5uwCQF7j7aJ4EVTEiD4b0N4=; b=X5Ig04icLRInLJnIy+IUaXXvfSFZ4pf8N2ZnTY0cdqxnIpkQKkYFogXiIRFOtXQKcDEDy5oOdoT3XJY+ZX6OdFbbOYdunLpLvj6CGvk+rp2YSUGsg/9/GkB6pgXZwQxoBqWvVOCkTlOyqdluqIwqqm9r6NTR9lhVT6pd0uxh/0ieMN5soGmwkrj4npjdlCYLVHTa6inpO2e1qujXQUiX2OLg1vwoR0ok+aCHizEKjkmfiaKjOPxLYBCVZZZBzli6vhTfv9Nzug3eEg5cR1Kd86QxyNM1Oqj/mSxGEl+Lh2wdpqQvAFzEJAzjk0fjQn46dBeEkYePiDD/Cf5mqsqFnQ== 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 AM3PR04CA0127.eurprd04.prod.outlook.com (2603:10a6:207::11) by AM7PR08MB5415.eurprd08.prod.outlook.com (2603:10a6:20b:10d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Tue, 9 May 2023 12:19:52 +0000 Received: from AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:207:0:cafe::a5) by AM3PR04CA0127.outlook.office365.com (2603:10a6:207::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32 via Frontend Transport; Tue, 9 May 2023 12:19: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 AM7EUR03FT031.mail.protection.outlook.com (100.127.140.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.18 via Frontend Transport; Tue, 9 May 2023 12:19:52 +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; Tue, 9 May 2023 12:19:47 +0000 Received: from e129018.arm.com (10.57.21.174) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Tue, 9 May 2023 12:19:47 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 14/16] arm: [MVE intrinsics] add binary_maxamina shape Date: Tue, 9 May 2023 14:19:35 +0200 Message-ID: <20230509121937.206183-14-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230509121937.206183-1-christophe.lyon@arm.com> References: <20230509121937.206183-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT031:EE_|AM7PR08MB5415:EE_|DBAEUR03FT038:EE_|DBAPR08MB5685:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d413201-be4a-42e6-c286-08db5087b697 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: Sr5dVYOE8R1JkTsr2IRnDIV7SpExaAupMCVjpH8C+L7r6cwuRW+JwK8WR9HP05XwgzeSAAEIq9DqTcPC84ME2PFNK3VWvFBXB5rkzKADLkxj+Xtu/a9ll1tqV9W4LHwQ2fy76M+9J3o32+h8vtraXw76nT+B8Ik5YtgE8cpjtvBhQHU05+ddtAY/h7Uy9CF3MmoPmhCbEwcxGfHVdRjKQT445cvu3TmQFCGDN19EFTi4EmPJJnSRd7dYqm4HrLErZBli+37UNmxSVxHVJ5Y5yTMqsHu9VEbT+rLlsZAX9eH3V7Y4N2Ds/n+aTVdOaZuexwbZ9JXR7d+hoTN1TZNIFdA7fezJImGVSLLw4mPkvfr17JW2XQdRnnYQvPIUeXFQ4FLm6nLEMwZHOBcMjRO6GA9lTEBjuRfTPHqufH/SmRw2FUNfwxFt+/rrHQ39fT94L0Gy7HoIPnbWklFo1zENyCxctW4K03swCicBe6PNilk6qHSL8B1osaLtpmPArckTU0VuH7Y+9Npl8Wt90QlwRpCOU9wyzK22A0kTqJ9oVOja0paTD6CpuSO0GF3ZU/HpGcRxEhsVNdjXg0bv+22BLc3QxG1/ujcd7PU5qZkutcSOaa/4l3aSb6OqGQWMCWYutcpM/Eh5H9J5C4NJB+lagIvjpn6TK6zjNvc4Pgqpy+05NST4H3AxljYPxuztgu7TLXGhp2djRg9t3yJG8QTTFw== 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)(346002)(376002)(136003)(396003)(39850400004)(451199021)(46966006)(36840700001)(356005)(1076003)(81166007)(26005)(82740400003)(6666004)(7696005)(336012)(426003)(36860700001)(2616005)(47076005)(186003)(36756003)(44832011)(2906002)(86362001)(70206006)(40480700001)(70586007)(110136005)(5660300002)(478600001)(41300700001)(8936002)(8676002)(316002)(4326008)(6636002)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5415 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 074cd8a3-7cd9-4b1b-3456-08db5087b122 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MENZKy1vDHYwoH9OcAoWCK6/zxRQKMXb7mi/7C4AeyQXeICp91k0YXG6WefRGbWKz/+TjlI/179vh0QhWvfpvBLeBtMNH7t860oBjhUapuJXxMEU1X8Oimuz3nVZ9Zxw2a/3cqCY9RBwVjjq/1F9UgjFBjQndcmvATifACEBzPehJoV08wGNwasQk19c/pxlL/HH6t9FOzinioXX1CSoXd38rC0qNvHAcU8pdNViOKgAFOHLru6h4wql+0ickr/+VF71CqSqakAIs2VmPcsTXl2078qO4VyZpDXz5dtIXlHuaaekYP3cZI1iFCTCqhVXkqNPbgXHZJuBZ3645AUAxG2OXJJwiCo7n7WmuG/WttBUhdSyV0kKCKajsXRQmcCD8DhGpKN2V/x4TDEmM4IUYbmx+diccusruMiaWgoFPvmHFTjvHbcbO08gQu+5uAe2mJBCK+4kwcRsKM9psPih5FKl46JG41GwhmOtnkCycns3Q0vBl180VPCwOuqPWAmmik4mY0ifB+LC3dpuasOW4mXMdfaIXoolwLroZpBa3U5fL7N8rudC8wsGoUYxh33ADjlrKQkTGZ4E8EEcgArw+FsYW8qqSJxauBeQ+wEkI3xzjFg7OvhMeITH7iLlUPWBpk9QDK21o9/Qdmw3JJEbNJ++w0X4qr/GPLVxcJOM0e0E/8cxcgmC9kQw77RS7kwBmxzPHKcyCzJP1vY1i/R6FA== 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)(136003)(376002)(39850400004)(396003)(451199021)(46966006)(40470700004)(36840700001)(186003)(2906002)(40460700003)(1076003)(26005)(426003)(336012)(40480700001)(2616005)(36860700001)(36756003)(47076005)(81166007)(82740400003)(316002)(41300700001)(6666004)(70586007)(6636002)(4326008)(70206006)(7696005)(86362001)(110136005)(478600001)(82310400005)(5660300002)(8676002)(8936002)(44832011); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2023 12:20:01.7263 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d413201-be4a-42e6-c286-08db5087b697 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: DBAEUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5685 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765419554874770556?= X-GMAIL-MSGID: =?utf-8?q?1765419554874770556?= This patch adds the binary_maxamina shape description. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_maxamina): New. * config/arm/arm-mve-builtins-shapes.h (binary_maxamina): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 40 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 41 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 1324abd1c12..c9eac80d1e3 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -401,6 +401,46 @@ struct binary_rshift_def : public overloaded_base<0> }; SHAPE (binary_rshift) + +/* _t vfoo[_t0](_t, _t) + + i.e. binary operations that take a vector of unsigned elements as first argument and a + vector of signed elements as second argument, and produce a vector of unsigned elements. + + Example: vminaq. + uint8x16_t [__arm_]vminaq[_s8](uint8x16_t a, int8x16_t b) + uint8x16_t [__arm_]vminaq_m[_s8](uint8x16_t a, int8x16_t b, mve_pred16_t p) */ +struct binary_maxamina_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_none, preserve_user_namespace); + build_all (b, "vu0,vu0,vs0", group, MODE_none, 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)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + /* Check that the 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; + + return r.resolve_to (r.mode_suffix_id, type); + } +}; +SHAPE (binary_maxamina) + /* _t vfoo[_](_t, _t) Example: vmaxavq. diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index cf4c523ab1a..7f582d7375a 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_lshift; extern const function_shape *const binary_lshift_r; + extern const function_shape *const binary_maxamina; extern const function_shape *const binary_maxavminav; extern const function_shape *const binary_maxvminv; extern const function_shape *const binary_move_narrow;