From patchwork Mon Sep 15 13:16:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Meakin X-Patchwork-Id: 120284 X-Patchwork-Delegate: alex.coplan@arm.com 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 AC2EF3857C6E for ; Mon, 15 Sep 2025 13:41:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC2EF3857C6E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=la8cWfN3; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=la8cWfN3 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::1]) by sourceware.org (Postfix) with ESMTPS id 93E833857C67 for ; Mon, 15 Sep 2025 13:17:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93E833857C67 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 93E833857C67 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c201::1 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1757942226; cv=pass; b=xVh1KTrQ21LkA1SxR/61LbEMFM5/Cqexty4JLYRuSysOWNHbeSu0bcD9VOCNT1nrnKfDG/C4t42tbE5uLKRVZxgIP8+Gj8rXa6rluHq2y4qzYVSYH3dRodWRXMzP6JR+c9yLJaKFwqzMNPmADuu+9NhCSnNpdAxtTEyav6syF3k= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1757942226; c=relaxed/simple; bh=9zSVaS1exudvyG+mcTC7N04BqEU4XcW1Ysbq8f2DJzg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=Odq412STxiZPhgw2X1C2C6biMS4n2upUdHNcgu2bMXiieiQ5zHpXApVjehc0u5Y0hvw0HkmEcBTKpn08EzBKWW/S4uqJUlpI04/rfisYYdtjjfZ8B+1RGvoCWO7bCeanoBZiwkLegnXbER/V51Ac6R/SOfQGRZA37P5/O2LAMDo= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93E833857C67 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=oOn4F2N5IIuPVSe7TVKOCXBZ7LUfsj414sPqxuuPkThMrgrYDpceuqvfR0xjRfc3rr6P1DJOFmadkfXeRXbyA6xCS1ofFpB5hXf6tmtmdOLKFxTnpl1wYocgkZqLitJn9ljZyxrHQOC8MW6FQ8YwaC74EQkvXYLtx97HDuyCYMUPOu38xpBHcOLoZxUpO/5Na8hqWe+o5G8G5OOqtCbsEUERxJHBTJXL0CxS/9SLZKRt6zqPOVkCDl8mMXpD0edIMvqWl4H0cYdLEZzJIdyFyhX3kLA+kgRNrEI8NFOAHbxuyGFHg4HEFTvir4WsoYekMYLBBWspM4acP6fCLdCDoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nBiSJ90wD45dQLt13xt7hNXTR1hVRPyQI4hmGT1f4Ew=; b=OYvSlS6uwuPMbzngEumwf1nFtrglFa13BsJDxj+t+pNhu/joCAKVQTWNeDMZsKv4OrA31xODbqzDZbG517OI4JqDrvOLDZt5MJMO+30N5TvuXOAQNnTchOlqGHkZZHgJtkIAx2oUaoRj62r+5aSzI2X/IogiaGun0zrDgzCvxdJIOPwId2xadCqIxjKP6DVQ0pHKWjG2aBOGdXKHLERkxYha6PgFT73+gP6M6k7xgBst/45q+cKOB+pVtBV5JA6jzg1iadIGsqkLVYt526dCqX7wWOBCTyOwlD7pciWXwd9yw4xNFYwfmOmDpjhGlgQDV/ALrncI55uRlyCje9F9DA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nBiSJ90wD45dQLt13xt7hNXTR1hVRPyQI4hmGT1f4Ew=; b=la8cWfN3D86VS5A8OpLUZn4B8dy2uSYDRfGMP2jB6g3AGpq0J2+FNKgZMK3IKWmmST770noMXbbUlJW9+yk4NXPiG/nfKOpDz91vSqa46rZJOo9pGtVmZ/8cRZ57rKEUWvusCZ71qS8l53A7WlLPTiwS09rruvD66q77u/A52Bo= Received: from DB8P191CA0004.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::14) by DU0PR08MB7785.eurprd08.prod.outlook.com (2603:10a6:10:3ba::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.19; Mon, 15 Sep 2025 13:16:59 +0000 Received: from DB3PEPF00008860.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::6e) by DB8P191CA0004.outlook.office365.com (2603:10a6:10:130::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.20 via Frontend Transport; Mon, 15 Sep 2025 13:16:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DB3PEPF00008860.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9137.12 via Frontend Transport; Mon, 15 Sep 2025 13:16:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ehWZ3wqtBO4MkCO17Yerj9xrd+x13ThMGU2GJ7Ffz6uYeoaAd3QjMEfIiJ3Uvq6+C35xzyMuseQvqorg1VwW7P/Db7tWbcHdHZWq/WMwJc3jOntNNxo5vv/a+rhQNk7lBIZ9tUjCB9iLxBFdBqKpL7WNPkNSF6Jb7A9F2CmU6Yzvim1b8x59acWTyPQG/Rnlf/h9wnqVQayWpY9DmW0lZzkaIqlYd91SC6f/GnjqN1rupK2DRUgZ3wDUdXEzJYfua3eJwz4HoEYyJghXY6l4IYRgbMdoC6doProaC4eFw6d+5GBCVUZUSBheYCI/F/hS584dZ11ezcSY9PQFWceoxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nBiSJ90wD45dQLt13xt7hNXTR1hVRPyQI4hmGT1f4Ew=; b=gAypdPfEyirQoCotr/Noj12iLFiqE3BqUAN/OHHwkly9A/SBoDJ/qW5vjz4YqhJalNgc7X7fPhIqdktr0jZRKk1AiECicgSrkdQELWhODyEH11I4x2b8+fT5gvCKXQ4HHhlaT7jWKVCywbbEoXp+sXvmajE9rPfBDqAtLb2VVfODuhFbGqNqGN32Uude8w/xjjlIZkmc35wl4zId2yja26j8f0ZJMG6D4vtZeuDy3qElO9bw/XNZsKAKGBldNeunT0YaLcCzFioTIZlDWx2hPzGAmK0oZ+x2vjrtcR+RxVfjmjLOguDcSP3pXHKeltUmlVgWW+8VxRu36Ym8VqyK6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=armh.onmicrosoft.com 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 (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nBiSJ90wD45dQLt13xt7hNXTR1hVRPyQI4hmGT1f4Ew=; b=la8cWfN3D86VS5A8OpLUZn4B8dy2uSYDRfGMP2jB6g3AGpq0J2+FNKgZMK3IKWmmST770noMXbbUlJW9+yk4NXPiG/nfKOpDz91vSqa46rZJOo9pGtVmZ/8cRZ57rKEUWvusCZ71qS8l53A7WlLPTiwS09rruvD66q77u/A52Bo= Received: from DU7PR01CA0026.eurprd01.prod.exchangelabs.com (2603:10a6:10:50e::22) by AM9PR08MB6692.eurprd08.prod.outlook.com (2603:10a6:20b:30c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.19; Mon, 15 Sep 2025 13:16:24 +0000 Received: from DU6PEPF00009523.eurprd02.prod.outlook.com (2603:10a6:10:50e:cafe::5) by DU7PR01CA0026.outlook.office365.com (2603:10a6:10:50e::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.22 via Frontend Transport; Mon, 15 Sep 2025 13:16:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) 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 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by DU6PEPF00009523.mail.protection.outlook.com (10.167.8.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9115.13 via Frontend Transport; Mon, 15 Sep 2025 13:16:24 +0000 Received: from AZ-NEU-EXJ02.Arm.com (10.240.25.139) by AZ-NEU-EX06.Arm.com (10.240.25.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 15 Sep 2025 13:16:19 +0000 Received: from AZ-NEU-EX06.Arm.com (10.240.25.134) by AZ-NEU-EXJ02.Arm.com (10.240.25.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.27; Mon, 15 Sep 2025 13:16:18 +0000 Received: from foobar (10.248.139.178) by mail.arm.com (10.240.25.134) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Mon, 15 Sep 2025 13:16:18 +0000 From: Karl Meakin To: CC: Subject: [PATCH v4 2/2] AArch64: Add SME LUTv2 intrinsics Date: Mon, 15 Sep 2025 13:16:16 +0000 Message-ID: <20250915131616.243139-3-karl.meakin@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250915131616.243139-1-karl.meakin@arm.com> References: <20250904141347.18606-1-karl.meakin@arm.com> <20250915131616.243139-1-karl.meakin@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU6PEPF00009523:EE_|AM9PR08MB6692:EE_|DB3PEPF00008860:EE_|DU0PR08MB7785:EE_ X-MS-Office365-Filtering-Correlation-Id: de62dcc9-3fd6-45a5-4920-08ddf45a2713 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info-Original: u8L9fqkkCm/bQ8rxiQX4CgWgn0RL12+zdyqjak0WLISV2VVCGAnLI6CUZq992rXX+C1LTy1Ey1ihfnyLVSyEQx8VR1/A7VIsEGTDAoFQ0WwVzTLk/jDKlnRSYpeXnoVtQE9K/kpo8CEyffKsG6OpH/zWhh3HCYn4+ITyC10yI62alzw8BgV7VT2fel4t20eSTl9JyhZp3zauovuHYHAFLBaYAWIPntDqm7yVPi31RhRmhjSePDX9KkV/ngSf1osmDsloR7sk19L5JEwcFrRA2STjg/s5npgfwPayeqs8xwihmlTo/98RpD2/14ivuGwnvcRL+cc4ymGJz4wA5TNlRyNAosDLEAivq5UkWPPgcY4fqazQTqHZ+YMLdGs72YiUU9CObtNFpGgo363RA7qwc09iivvIrfs7KotLyN5hVsv9gxmeVDTsdECjuuvXVgbpCQvg4lLIpNgMf4y2L8e5JHieVFwengj+vFO1vFOwkZMREN7bg7YCoVTHtCZ4uwvgYekn9pRIhlFWIuSMCvFuLT3F5ivuzrR2yKWa7vWG9pEXYn+da8eXj2N1C+eZaQZVmjNJxyxTF6BwgqHbI+ENVqngtuji8Z2CqNeLawpjIYV2SzEFbFMqpgiUF1fWagCVkElMWVAyvz54VcQqUwJ4FdjDHJKKtZZ0Fi4JCv06Hp+fSJ9Wv6Br9Ea/Ixm4OG9FEHVDf9FtOZhSCUw+rt57ec3TwR42yGm5FkPJBuVnHfnkG7MAbCBerzW7oLUieYZ1x6/o1+drGw0vqWG15vKIdjs4174FBa8ZU557FUK0e2Eni57ENTl89D7ToddGEiWC7EskJide2E1Z5VuaBgAXeMDpGz6uLrzt+UykEz0rpMdt9Le87RK4wh0oMw1qrvTpxdL7LQOc6lNjDqsKB//T2rClS7s6x9v8dwqC6nfAz/zAPqMBgfBvQo8/YxfueepvV1SThimjrODQzR45Y0BrJeIdIzid60ti5WKs2QDMmr2zu9IMb7VxYYnPMZWNMPnjucepcvHR4lZ3h26dJcMRZ9rQTVLHQfqvUWmC5HQ7RggET5BM9viUdpZHs38y/q7ZP7OmoMuCaUsaZpERTFgObpGKMD4sxskYPegFaYbVYJJPSrVZvcfLpjOzkGvHEbQb7yAvWApZbye7ELIarWiKl4UqFhnnWsASmOap61j7e9MB5e2SUqDb0jP330FRwMSXJAcgVJxpXFXHvtnLTGc0xUpRtVmiCdfjFvMMluGCdJJoIpzzgeaePwTqhxAd9Q/M0+JrBAmoKAGWuVyGTmN5N/W+Kt6ggxmcS5LPs394WatBBPGlVOa1VTqx5MnMmklgS2aOPn8QWvQUjlyXSa2NuYFwMbDuyTOVphEHxrHdAgnE/U4Oj+QMfG+oDMMeVFHpqjJPrfaA03TweMM2FelZ6PfGyNg0guZQqA9HgwwoMw48EDMAvVDGN5PtAQ7WuCia9EOY06iP1FiH7d87Kz1yKJwIZ/uv0aOO3IG7/DgXq3E= X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6692 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB3PEPF00008860.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2a422d41-ef19-472f-957f-08ddf45a11ed X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|35042699022|82310400026|14060799003; X-Microsoft-Antispam-Message-Info: WmZ8kMv4KW4piiIOFfkiOaEBXj3VtoXnYPdlwwYjlUKaPGpvdlAJp+xEgz3Qtjeh0Ys8JWNZrDhRueDiEU3fVMD2SrIoS3vpOjVYOkKLJIQJqI3IngMNNs+rlkHsLGfhZ3WoXDwSzriFESQilUeJsYucrENa4Y9sTUUlp8gLMFMwmFrfPmkQdPeN4w1M6r6JK3MIPds3Zd3mwT0QYJdPnUZpRkunKaIYDicpSJraiN7vc+ZUJty3XIOyUcxXHiNyaJw7R9MhJWLsuLUTXmcQv0aXE0CzA3pa/cbBl1iZzfndVXaWCLNAbofK7GzXM6UhqTivxP35gM0rmbdbOE59WO6Oqd0C7qg+7aqUfF13i+B8f38/WLSinWANIFzNvHHZhQVDgDYP/sfIO9FLJxM7qSwCmbVVbKb07+QdxGKqZxlG0mkSLOcHtaiKgIHd0xnp2MeJUIyfCj3I0nuDHfPQGcTySK5G+yhf1x5oQX8nKi1kEQTq99DHV656sLgyhPGY1Qza2zJh7VrR4gZ3KqTP/FgZXp2ZCouJ877rAZ5WO5R6Ui7BkpQIKO45q/9EVmvCD1NHYudpM3HPC91OXiAGypNvXNs0Nj2ApL24RKeRYp6CNFNGcpIRItRvG24AA0swyY1VmYpB2BBGTUPmxxYe2/gNhNTg6OxokcZNfwGSjUEybAnmvmu5ELddMzDOPTsYTrbvCeCR5vL+LAxE4FPBvlAD7hMeZV1+W/M2SZdfmEmDjQqnVJNg0FkVrYtf+euXVonjQu6y+Gjlgu6Co2RpVvlWsUkqss3cO95Lyty2TboLfPpkTdY1nNkWmm8LHiyZb+e2GejUk4YBbBxwpn3s30lF3XesGd96KeuE3x5m5o1A0GGk8TUUVD1UQ7baHhFZcnNPBZ1YkDfVzfESRaS2594HXjNyQdQEErq4Mdf0r6Ky9EGQtfu1TmlqTFSRHzepXvONXJ2KaRip0S+Aw75Xocse25q4T9FB/p5By8UM1nJTX6zUw3ZlGokVP6Y8CFnywsZP6O/eTmyV+xW+bZfxYtbSFY3OiDFHjmEttC207BVVAmG25cFupLNat/BvBuCodMO4uccw+DMmqWhckcUEe5kVtP916obTtITX4kun3nFDT/OX/NE6H0nGMrfwukI/ys0VpYl91U4Os8qdguho7bVTNNw89oM42P+7X7m5WZbZYcPAeSeOoepN7TGzTVY83oLxzzynZdLgodkyBdetc+/OIe5Z4+GdF1GkAKz7aPdnX84TWHyZnPSQ8U9kZ/9CsyAArwXa2UfKUGYpiAVRr2QTBmITkuafM5mNoxXVl9UzJwqCxJIRHYyZDuNEwEWR7xzSMTP3IiVEn4+J3n3s643i1tSLLO3XEXw0Pd1qZxz/KXdGi9pfiqPIqfnSgPY1pM14oNf25GsfPjICGjHPOsXD6rQ8p6RJdsmnSlXuL1h79kdThi2iIDH3hQFkqZ16SY+xYrF5B4RjZiY5LWpeYX5p+4RsKldVhfjyfXBqSY4= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(376014)(35042699022)(82310400026)(14060799003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2025 13:16:59.5832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de62dcc9-3fd6-45a5-4920-08ddf45a2713 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DB3PEPF00008860.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7785 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_ASCII_DIVIDERS, KAM_SHORT, SPF_HELO_PASS, SPF_NONE, TXREP 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Add intrinsic functions for the SME LUTv2 architecture extension (`svluti4_zt`, `svwrite_lane_zt` and `svwrite_zt`). gcc/ChangeLog: * config/aarch64/aarch64-sme.md (@aarch64_sme_write_zt): New insn. (aarch64_sme_lut_zt): Likewise. * config/aarch64/aarch64-sve-builtins-shapes.cc (parse_type): New type format "%T". (struct luti_lane_zt_base): New function shape. (SHAPE): Likewise. (struct write_zt_def): Likewise. (struct write_lane_zt_def): Likewise. * config/aarch64/aarch64-sve-builtins-shapes.h: New function shape. * config/aarch64/aarch64-sve-builtins-sme.cc (class svluti_zt_impl): New function expander. (class svwrite_zt_impl): Likewise. (class svwrite_lane_zt_impl): Likewise. (FUNCTION): Likewise * config/aarch64/aarch64-sve-builtins-sme.def (svwrite_zt): New function shape. (svwrite_lane_zt): Likewise. (svluti4_zt): Likewise. * config/aarch64/aarch64-sve-builtins-sme.h: New function base. * config/aarch64/aarch64-sve-builtins.h: Mention the arrays of function_group_info by name. gcc/testsuite/ChangeLog: * gcc.target/aarch64/sme2/acle-asm/svluti4_zt_1.c: New test. * gcc.target/aarch64/sme2/acle-asm/svwrite_lane_zt_1.c: New test. * gcc.target/aarch64/sme2/acle-asm/svwrite_zt_1.c: New test. * gcc.target/aarch64/sve/acle/general-c/svluti4_zt_1.c: New test. * gcc.target/aarch64/sve/acle/general-c/svwrite_lane_zt_1.c: New test. * gcc.target/aarch64/sve/acle/general-c/svwrite_zt_1.c: New test. --- gcc/config/aarch64/aarch64-sme.md | 35 ++ .../aarch64/aarch64-sve-builtins-shapes.cc | 104 ++++- .../aarch64/aarch64-sve-builtins-shapes.h | 3 + .../aarch64/aarch64-sve-builtins-sme.cc | 70 +++ .../aarch64/aarch64-sve-builtins-sme.def | 6 + gcc/config/aarch64/aarch64-sve-builtins-sme.h | 3 + gcc/config/aarch64/aarch64-sve-builtins.h | 7 +- .../aarch64/sme2/acle-asm/svluti4_zt_1.c | 30 ++ .../aarch64/sme2/acle-asm/svwrite_lane_zt_1.c | 204 +++++++++ .../aarch64/sme2/acle-asm/svwrite_zt_1.c | 96 +++++ .../aarch64/sve/acle/general-c/svluti4_zt_1.c | 86 ++++ .../sve/acle/general-c/svwrite_lane_zt_1.c | 406 ++++++++++++++++++ .../aarch64/sve/acle/general-c/svwrite_zt_1.c | 351 +++++++++++++++ 13 files changed, 1397 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svluti4_zt_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_lane_zt_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_zt_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svluti4_zt_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_lane_zt_1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_zt_1.c diff --git a/gcc/config/aarch64/aarch64-sme.md b/gcc/config/aarch64/aarch64-sme.md index 0123ea0e234..91366141d10 100644 --- a/gcc/config/aarch64/aarch64-sme.md +++ b/gcc/config/aarch64/aarch64-sme.md @@ -1040,6 +1040,24 @@ (define_insn "*aarch64_sme_write_plus" "mova\tza.d[%w0, %1, vgx], %2" ) +;; MOVT (vector to table) +;; Variants are also available for: +;; [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] +;; [_bf16], [_f16], [_f32], [_f64] +;; void svwrite_zt[_u8](uint64_t zt0, svuint8_t zt) +;; __arm_streaming __arm_out ("zt0"); +;; void svwrite_lane_zt[_u8](uint64_t zt0, svuint8_t zt, uint64_t idx) +;; __arm_streaming __arm_out ("zt0"); +(define_insn "@aarch64_sme_write_zt" + [(set (reg:V8DI ZT0_REGNUM) + (unspec_volatile:V8DI + [(match_operand:SVE_FULL 0 "register_operand" "w") + (match_operand:DI 1 "const_int_operand")] + UNSPEC_SME_WRITE))] + "TARGET_SME_LUTv2" + "movt\tzt0 [%1, mul vl], %0" +) + ;; ------------------------------------------------------------------------- ;; ---- Zeroing ;; ------------------------------------------------------------------------- @@ -2165,6 +2183,7 @@ (define_insn "@aarch64_sme_" (define_c_enum "unspec" [ UNSPEC_SME_LUTI + UNSPEC_SME_LUTI_ZT ]) (define_insn "@aarch64_sme_lut" @@ -2193,3 +2212,19 @@ (define_insn "@aarch64_sme_lut" && !( == 4 && == 4 && == 8)" "luti\t%0, zt0, %1[%2]" ) + +;; LUTI4 (four registers, 8-bit) +;; Variants are also available for: _u8 +;; svint8x4_t svluti4_zt_s8_x4 (uint64_t zt0, svuint8x2_t zn) +;; __arm_streaming __arm_in ("zt0"); */ +(define_insn "aarch64_sme_lut_zt" + [(set (match_operand:VNx64QI 0 "aligned_register_operand" "=Uw4") + (unspec:VNx64QI + [(reg:V8DI ZT0_REGNUM) + (reg:DI SME_STATE_REGNUM) + (match_operand:DI 1 "const0_operand") + (match_operand:VNx32QI 2 "register_operand" "w")] + UNSPEC_SME_LUTI_ZT))] + "TARGET_SME_LUTv2" + "luti4\t%0, zt0, {%Z2 - %T2}" +) diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc index af23a154d0e..74a3338e955 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc @@ -182,6 +182,7 @@ parse_element_type (const function_instance &instance, const char *&format) e - an enum with the given name s - a scalar type with the given element suffix t - a vector or tuple type with given element suffix [*1] + T - a vector or tuple type with given element suffix [*2] v - a vector with the given element suffix D - a 64 bit neon vector Q - a 128 bit neon vector @@ -189,7 +190,9 @@ parse_element_type (const function_instance &instance, const char *&format) where has the format described above parse_element_type [*1] the vectors_per_tuple function indicates whether the type should - be a tuple, and if so, how many vectors it should contain. */ + be a tuple, and if so, how many vectors it should contain. + [*2] same as for [*1], but the tuple contains half as many vectors. +*/ static tree parse_type (const function_instance &instance, const char *&format) { @@ -261,6 +264,13 @@ parse_type (const function_instance &instance, const char *&format) unsigned int num_vectors = instance.vectors_per_tuple (); return acle_vector_types[num_vectors - 1][vector_type]; } + if (ch == 'T') + { + type_suffix_index suffix = parse_element_type (instance, format); + vector_type_index vector_type = type_suffixes[suffix].vector_type; + unsigned int num_vectors = instance.vectors_per_tuple () / 2; + return acle_vector_types[num_vectors - 1][vector_type]; + } if (ch == 'v') { @@ -973,6 +983,24 @@ struct luti_lane_zt_base : public nonoverloaded_base } }; +/* LUTI4 (four registers, 8-bit) + Variants are also available for: _u8 + svint8x4_t svluti4_zt_s8_x4 (uint64_t zt0, svuint8x2_t zn) + __arm_streaming __arm_in ("zt0"); */ +template struct luti_zt_base : public nonoverloaded_base +{ + void build (function_builder &b, + const function_group_info &group) const override + { + build_all (b, "t0,su64,Tu0", group, MODE_none); + } + + bool check (function_checker &c) const override + { + return c.require_immediate_range (0, 0, 0); + } +}; + /* sv_t svfoo[_t0](sv_t, sv_t, sv_t) (for integer t0) sv_t svmmla[_t0](sv_t, sv_t, sv_t) (for floating-point t0) @@ -3207,6 +3235,9 @@ SHAPE (luti2_lane_zt) using luti4_lane_zt_def = luti_lane_zt_base<4>; SHAPE (luti4_lane_zt) +using luti4_zt_def = luti_zt_base<4>; +SHAPE (luti4_zt) + /* svbool_t svfoo(enum svpattern). */ struct pattern_pred_def : public nonoverloaded_base { @@ -5269,4 +5300,75 @@ struct write_za_slice_def : public overloaded_base<1> }; SHAPE (write_za_slice) +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_zt[_u8] (uint64_t zt0, svuint8_t zt, uint64_t idx) + __arm_streaming __arm_out ("zt0"); */ +struct write_zt_def : public overloaded_base<0> +{ + void build (function_builder &b, + const function_group_info &group) const override + { + b.add_overloaded_functions (group, MODE_none); + build_all (b, "_,su64,v0", group, MODE_none); + } + + tree resolve (function_resolver &r) const override + { + sve_type type; + + if (!r.check_num_arguments (2) + || !r.require_scalar_type (0, "uint64_t") + || !r.require_integer_immediate (0) + || !(type = r.infer_vector_type (1))) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } + + bool check (function_checker &c) const override + { + return c.require_immediate_range (0, 0, 0); + } +}; +SHAPE (write_zt); + +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_lane_zt[_u8] (uint64_t zt0, svuint8_t zt, uint64_t idx) + __arm_streaming __arm_out ("zt0"); */ +struct write_lane_zt_def : public overloaded_base<0> +{ + void build (function_builder &b, + const function_group_info &group) const override + { + b.add_overloaded_functions (group, MODE_none); + build_all (b, "_,su64,v0,su64", group, MODE_none); + } + + tree resolve (function_resolver &r) const override + { + sve_type type; + + if (!r.check_num_arguments (3) + || !r.require_scalar_type (0, "uint64_t") + || !r.require_integer_immediate (0) + || !(type = r.infer_vector_type (1)) + || !r.require_scalar_type (2, "uint64_t")) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } + + bool check (function_checker &c) const override + { + return c.require_immediate_range (0, 0, 0) + && c.require_immediate_range (2, 0, 3); + } +}; +SHAPE (write_lane_zt); } diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.h b/gcc/config/aarch64/aarch64-sve-builtins-shapes.h index 349eae6e34a..421cb1e8b85 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.h +++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.h @@ -168,6 +168,7 @@ namespace aarch64_sve extern const function_shape *const luti4; extern const function_shape *const luti2_lane_zt; extern const function_shape *const luti4_lane_zt; + extern const function_shape *const luti4_zt; extern const function_shape *const mmla; extern const function_shape *const pattern_pred; extern const function_shape *const pmov_from_vector; @@ -260,6 +261,8 @@ namespace aarch64_sve extern const function_shape *const write_za; extern const function_shape *const write_za_m; extern const function_shape *const write_za_slice; + extern const function_shape *const write_zt; + extern const function_shape *const write_lane_zt; } } diff --git a/gcc/config/aarch64/aarch64-sve-builtins-sme.cc b/gcc/config/aarch64/aarch64-sve-builtins-sme.cc index e0f0f660952..1bf75318e4e 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-sme.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-sme.cc @@ -352,6 +352,28 @@ public: unsigned int m_bits; }; +/* LUTI4 (four registers, 8-bit) + Variants are also available for: _u8 + svint8x4_t svluti4_zt_s8_x4 (uint64_t zt0, svuint8x2_t zn) + __arm_streaming __arm_in ("zt0"); */ +class svluti_zt_impl : public read_zt0 +{ +public: + CONSTEXPR svluti_zt_impl (unsigned int bits) : m_bits (bits) {} + + unsigned int call_properties (const function_instance &) const override + { + return CP_READ_ZT0; + } + + rtx expand (function_expander &e) const override + { + return e.use_exact_insn (CODE_FOR_aarch64_sme_lut_zt); + } + + unsigned int m_bits; +}; + template class svread_za_slice_base : public function_base { @@ -467,6 +489,51 @@ public: } }; +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_lane_zt[_u8] (uint64_t zt0, svuint8_t zt, uint64_t idx) + __arm_streaming __arm_out ("zt0"); */ +class svwrite_lane_zt_impl : public function_base +{ +public: + unsigned int call_properties (const function_instance &) const override + { + return CP_WRITE_ZT0; + } + + rtx expand (function_expander &e) const override + { + // Remove `zt0` argument, since it is ignored. + e.args.ordered_remove (0); + auto mode = e.args[0]->mode; + return e.use_exact_insn (code_for_aarch64_sme_write_zt (mode)); + } +}; + +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_zt[_u8] (uint64_t zt0, svuint8_t zt) + __arm_streaming __arm_out ("zt0"); */ +class svwrite_zt_impl : public function_base +{ +public: + unsigned int call_properties (const function_instance &) const override + { + return CP_WRITE_ZT0; + } + + rtx expand (function_expander &e) const override + { + // svwrite_zt (zt0, zt) == svwrite_lane_zt (zt0, zt, 0) + e.args.safe_push (const0_rtx); + return svwrite_lane_zt_impl ().expand (e); + } +}; + using svwrite_za_tile_impl = add_call_properties; @@ -569,6 +636,7 @@ FUNCTION (svldr_za, svldr_za_impl, ) FUNCTION (svldr_zt, svldr_zt_impl, ) FUNCTION (svluti2_lane_zt, svluti_lane_zt_impl, (2)) FUNCTION (svluti4_lane_zt, svluti_lane_zt_impl, (4)) +FUNCTION (svluti4_zt, svluti_zt_impl, (4)) FUNCTION (svmla_za, sme_2mode_function, (UNSPEC_SME_SMLA, UNSPEC_SME_UMLA, UNSPEC_SME_FMLA)) FUNCTION (svmla_lane_za, sme_2mode_lane_function, (UNSPEC_SME_SMLA, @@ -616,6 +684,8 @@ FUNCTION (svvdot_lane_za, sme_2mode_lane_function, (UNSPEC_SME_SVDOT, FUNCTION (svwrite_za, svwrite_za_impl,) FUNCTION (svwrite_hor_za, svwrite_za_tile_impl, (UNSPEC_SME_WRITE_HOR)) FUNCTION (svwrite_ver_za, svwrite_za_tile_impl, (UNSPEC_SME_WRITE_VER)) +FUNCTION (svwrite_zt, svwrite_zt_impl,) +FUNCTION (svwrite_lane_zt, svwrite_lane_zt_impl,) FUNCTION (svzero_mask_za, svzero_mask_za_impl, ) FUNCTION (svzero_za, svzero_za_impl, ) FUNCTION (svzero_zt, svzero_zt_impl, ) diff --git a/gcc/config/aarch64/aarch64-sve-builtins-sme.def b/gcc/config/aarch64/aarch64-sve-builtins-sme.def index 117b70ede74..978a74f438d 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-sme.def +++ b/gcc/config/aarch64/aarch64-sve-builtins-sme.def @@ -253,6 +253,12 @@ DEF_SME_ZA_FUNCTION_GS (svzero, inherent_za_slice, d_za, vg2, none) DEF_SME_ZA_FUNCTION_GS (svzero, inherent_za_slice, d_za, vg4, none) #undef REQUIRED_EXTENSIONS +#define REQUIRED_EXTENSIONS streaming_only (AARCH64_FL_SME_LUTv2) +DEF_SME_FUNCTION_GS (svwrite_zt, write_zt, all_data, none, none) +DEF_SME_FUNCTION_GS (svwrite_lane_zt, write_lane_zt, all_data, none, none) +DEF_SME_FUNCTION_GS (svluti4_zt, luti4_zt, b_integer, x4, none) +#undef REQUIRED_EXTENSIONS + #undef DEF_SME_ZA_FUNCTION #undef DEF_SME_ZA_FUNCTION_GS #undef DEF_SME_FUNCTION diff --git a/gcc/config/aarch64/aarch64-sve-builtins-sme.h b/gcc/config/aarch64/aarch64-sve-builtins-sme.h index 9ed8101d2f9..4968f65442b 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-sme.h +++ b/gcc/config/aarch64/aarch64-sve-builtins-sme.h @@ -44,6 +44,7 @@ namespace aarch64_sve extern const function_base *const svldr_zt; extern const function_base *const svluti2_lane_zt; extern const function_base *const svluti4_lane_zt; + extern const function_base *const svluti4_zt; extern const function_base *const svmla_za; extern const function_base *const svmla_lane_za; extern const function_base *const svmls_za; @@ -75,6 +76,8 @@ namespace aarch64_sve extern const function_base *const svwrite_za; extern const function_base *const svwrite_hor_za; extern const function_base *const svwrite_ver_za; + extern const function_base *const svwrite_zt; + extern const function_base *const svwrite_lane_zt; extern const function_base *const svundef_za; extern const function_base *const svvdot_lane_za; extern const function_base *const svzero_mask_za; diff --git a/gcc/config/aarch64/aarch64-sve-builtins.h b/gcc/config/aarch64/aarch64-sve-builtins.h index c145b8065ae..d6a58b450d6 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.h +++ b/gcc/config/aarch64/aarch64-sve-builtins.h @@ -57,9 +57,10 @@ function_shape describes how that instruction has been presented at the language level. - The static list of functions uses function_group to describe a group - of related functions. The function_builder class is responsible for - expanding this static description into a list of individual functions + The static arrays of function_group_info (function_groups, + neon_sve_function_groups, sme_function_groups) use function_group to describe + a group of related functions. The function_builder class is responsible for + expanding these static description into a list of individual functions and registering the associated built-in functions. function_instance describes one of these individual functions in terms of the properties described above. diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svluti4_zt_1.c b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svluti4_zt_1.c new file mode 100644 index 00000000000..d05c2e01a8e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svluti4_zt_1.c @@ -0,0 +1,30 @@ +/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ + +/* LUTI4 (four registers, 8-bit) + Variants are also available for: _u8 + svint8x4_t svluti4_zt_s8_x4 (uint64_t zt0, svuint8x2_t zn) + __arm_streaming __arm_in ("zt0"); */ + +#pragma GCC target "+sve2,+sme-lutv2" +#define SHARED_ZT0 +#include "test_sme2_acle.h" + +/* +** luti4_zt_u8_x4: +** luti4 {z0.b - z3.b}, zt0, {z0 - z1} +** ret +*/ +PROTO (luti4_zt_u8_x4, svuint8x4_t, (svuint8x2_t z0)) +{ + return svluti4_zt_u8_x4 (0, z0); +} + +/* +** luti4_zt_s8_x4: +** luti4 {z0.b - z3.b}, zt0, {z0 - z1} +** ret +*/ +PROTO (luti4_zt_s8_x4, svint8x4_t, (svuint8x2_t z0)) +{ + return svluti4_zt_s8_x4 (0, z0); +} diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_lane_zt_1.c b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_lane_zt_1.c new file mode 100644 index 00000000000..256e32b0f6a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_lane_zt_1.c @@ -0,0 +1,204 @@ +/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ + +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_lane_zt[_u8] (uint64_t zt0, svuint8_t zt, uint64_t idx) + __arm_streaming __arm_out ("zt0"); */ + +#pragma GCC target "+sve2,+sme-lutv2" +#define SHARED_ZT0 +#include "test_sme2_acle.h" + +/* +** write_lane_zt_u8: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_u8, void, (svuint8_t z0)) +{ + svwrite_lane_zt_u8 (0, z0, 0); + svwrite_lane_zt_u8 (0, z0, 1); + svwrite_lane_zt_u8 (0, z0, 2); + svwrite_lane_zt_u8 (0, z0, 3); +} + +/* +** write_lane_zt_s8: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_s8, void, (svint8_t z0)) +{ + svwrite_lane_zt_s8 (0, z0, 0); + svwrite_lane_zt_s8 (0, z0, 1); + svwrite_lane_zt_s8 (0, z0, 2); + svwrite_lane_zt_s8 (0, z0, 3); +} + +/* +** write_lane_zt_u16: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_u16, void, (svuint16_t z0)) +{ + svwrite_lane_zt_u16 (0, z0, 0); + svwrite_lane_zt_u16 (0, z0, 1); + svwrite_lane_zt_u16 (0, z0, 2); + svwrite_lane_zt_u16 (0, z0, 3); +} + +/* +** write_lane_zt_s16: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_s16, void, (svint16_t z0)) +{ + svwrite_lane_zt_s16 (0, z0, 0); + svwrite_lane_zt_s16 (0, z0, 1); + svwrite_lane_zt_s16 (0, z0, 2); + svwrite_lane_zt_s16 (0, z0, 3); +} + +/* +** write_lane_zt_u32: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_u32, void, (svuint32_t z0)) +{ + svwrite_lane_zt_u32 (0, z0, 0); + svwrite_lane_zt_u32 (0, z0, 1); + svwrite_lane_zt_u32 (0, z0, 2); + svwrite_lane_zt_u32 (0, z0, 3); +} + +/* +** write_lane_zt_s32: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_s32, void, (svint32_t z0)) +{ + svwrite_lane_zt_s32 (0, z0, 0); + svwrite_lane_zt_s32 (0, z0, 1); + svwrite_lane_zt_s32 (0, z0, 2); + svwrite_lane_zt_s32 (0, z0, 3); +} + +/* +** write_lane_zt_u64: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_u64, void, (svuint64_t z0)) +{ + svwrite_lane_zt_u64 (0, z0, 0); + svwrite_lane_zt_u64 (0, z0, 1); + svwrite_lane_zt_u64 (0, z0, 2); + svwrite_lane_zt_u64 (0, z0, 3); +} + +/* +** write_lane_zt_s64: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_s64, void, (svint64_t z0)) +{ + svwrite_lane_zt_s64 (0, z0, 0); + svwrite_lane_zt_s64 (0, z0, 1); + svwrite_lane_zt_s64 (0, z0, 2); + svwrite_lane_zt_s64 (0, z0, 3); +} + +/* +** write_lane_zt_bf16: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_bf16, void, (svbfloat16_t z0)) +{ + svwrite_lane_zt_bf16 (0, z0, 0); + svwrite_lane_zt_bf16 (0, z0, 1); + svwrite_lane_zt_bf16 (0, z0, 2); + svwrite_lane_zt_bf16 (0, z0, 3); +} + +/* +** write_lane_zt_f16: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_f16, void, (svfloat16_t z0)) +{ + svwrite_lane_zt_f16 (0, z0, 0); + svwrite_lane_zt_f16 (0, z0, 1); + svwrite_lane_zt_f16 (0, z0, 2); + svwrite_lane_zt_f16 (0, z0, 3); +} + +/* +** write_lane_zt_f32: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_f32, void, (svfloat32_t z0)) +{ + svwrite_lane_zt_f32 (0, z0, 0); + svwrite_lane_zt_f32 (0, z0, 1); + svwrite_lane_zt_f32 (0, z0, 2); + svwrite_lane_zt_f32 (0, z0, 3); +} + +/* +** write_lane_zt_f64: +** movt zt0 \[0, mul vl\], z0 +** movt zt0 \[1, mul vl\], z0 +** movt zt0 \[2, mul vl\], z0 +** movt zt0 \[3, mul vl\], z0 +** ret +*/ +PROTO (write_lane_zt_f64, void, (svfloat64_t z0)) +{ + svwrite_lane_zt_f64 (0, z0, 0); + svwrite_lane_zt_f64 (0, z0, 1); + svwrite_lane_zt_f64 (0, z0, 2); + svwrite_lane_zt_f64 (0, z0, 3); +} diff --git a/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_zt_1.c b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_zt_1.c new file mode 100644 index 00000000000..dfe3267e0cb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sme2/acle-asm/svwrite_zt_1.c @@ -0,0 +1,96 @@ +/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ + +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_zt[_u8] (uint64_t zt0, svuint8_t zt, uint64_t idx) + __arm_streaming __arm_out ("zt0"); */ + +#pragma GCC target "+sve2,+sme-lutv2" +#define SHARED_ZT0 +#include "test_sme2_acle.h" + +/* +** write_zt_u8: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_u8, void, (svuint8_t z0)) { svwrite_zt_u8 (0, z0); } + +/* +** write_zt_s8: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_s8, void, (svint8_t z0)) { svwrite_zt_s8 (0, z0); } + +/* +** write_zt_u16: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_u16, void, (svuint16_t z0)) { svwrite_zt_u16 (0, z0); } + +/* +** write_zt_s16: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_s16, void, (svint16_t z0)) { svwrite_zt_s16 (0, z0); } + +/* +** write_zt_u32: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_u32, void, (svuint32_t z0)) { svwrite_zt_u32 (0, z0); } + +/* +** write_zt_s32: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_s32, void, (svint32_t z0)) { svwrite_zt_s32 (0, z0); } + +/* +** write_zt_u64: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_u64, void, (svuint64_t z0)) { svwrite_zt_u64 (0, z0); } + +/* +** write_zt_s64: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_s64, void, (svint64_t z0)) { svwrite_zt_s64 (0, z0); } + +/* +** write_zt_bf16: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_bf16, void, (svbfloat16_t z0)) { svwrite_zt_bf16 (0, z0); } + +/* +** write_zt_f16: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_f16, void, (svfloat16_t z0)) { svwrite_zt_f16 (0, z0); } + +/* +** write_zt_f32: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_f32, void, (svfloat32_t z0)) { svwrite_zt_f32 (0, z0); } + +/* +** write_zt_f64: +** movt zt0 \[0, mul vl\], z0 +** ret +*/ +PROTO (write_zt_f64, void, (svfloat64_t z0)) { svwrite_zt_f64 (0, z0); } diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svluti4_zt_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svluti4_zt_1.c new file mode 100644 index 00000000000..05acb8c74ea --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svluti4_zt_1.c @@ -0,0 +1,86 @@ +/* { dg-options "-std=c23" } */ +/* { dg-do compile } */ + +#pragma GCC target "+sve2,+sme-lutv2" +static_assert (__ARM_FEATURE_SME_LUTv2 == 1); +#include + +/* LUTI4 (four registers, 8-bit) + Variants are also available for: _u8 + svint8x4_t svluti4_zt_s8_x4 (uint64_t zt0, svuint8x2_t zn) + __arm_streaming __arm_in ("zt0"); */ + +void +test_svluti4_zt_ok (svuint8x2_t zn_u8) __arm_streaming __arm_in ("zt0") +{ + svluti4_zt_s8_x4 (0, zn_u8); + svluti4_zt_u8_x4 (0, zn_u8); +} + +void +test_svluti4_zt_not_streaming (svuint8x2_t zn_u8) +{ + svluti4_zt_s8_x4 (0, zn_u8); /* { dg-error {ACLE function 'svluti4_zt_s8_x4' can only be called when SME streaming mode is enabled} } */ + svluti4_zt_u8_x4 (0, zn_u8); /* { dg-error {ACLE function 'svluti4_zt_u8_x4' can only be called when SME streaming mode is enabled} } */ +} + +void +test_svluti4_zt_streaming_compatible (svuint8x2_t zn_u8) __arm_streaming_compatible +{ + svluti4_zt_s8_x4 (0, zn_u8); /* { dg-error {ACLE function 'svluti4_zt_s8_x4' can only be called when SME streaming mode is enabled} } */ + svluti4_zt_u8_x4 (0, zn_u8); /* { dg-error {ACLE function 'svluti4_zt_u8_x4' can only be called when SME streaming mode is enabled} } */ +} + +void +test_svluti4_zt_arg_count_mismatch (svuint8x2_t zn_u8) __arm_streaming __arm_in ("zt0") +{ + svluti4_zt_s8_x4 (); /* { dg-error {too few arguments to function 'svluti4_zt_s8_x4'; expected 2, have 0} } */ + svluti4_zt_u8_x4 (); /* { dg-error {too few arguments to function 'svluti4_zt_u8_x4'; expected 2, have 0} } */ + + svluti4_zt_s8_x4 (0); /* { dg-error {too few arguments to function 'svluti4_zt_s8_x4'; expected 2, have 1} } */ + svluti4_zt_u8_x4 (0); /* { dg-error {too few arguments to function 'svluti4_zt_u8_x4'; expected 2, have 1} } */ + + svluti4_zt_s8_x4 (0, zn_u8, 0); /* { dg-error {too many arguments to function 'svluti4_zt_s8_x4'; expected 2, have 3} } */ + svluti4_zt_u8_x4 (0, zn_u8, 0); /* { dg-error {too many arguments to function 'svluti4_zt_u8_x4'; expected 2, have 3} } */ +} + +void +test_svluti4_zt_arg_type_mismatch (svuint8x2_t zn_u8) __arm_streaming __arm_in ("zt0") +{ + struct Foo { uint64_t val; } foo = {0}; + svluti4_zt_s8_x4 (foo, zn_u8); /* { dg-error {incompatible type for argument 1 of 'svluti4_zt_s8_x4'} } */ + svluti4_zt_u8_x4 (foo, zn_u8); /* { dg-error {incompatible type for argument 1 of 'svluti4_zt_u8_x4'} } */ +} + +void +test_svluti4_zt_ret_type_mismatch (svuint8x2_t zn_u8) __arm_streaming __arm_in ("zt0") +{ + int x0 = svluti4_zt_s8_x4 (0, zn_u8); /* { dg-error {incompatible types when initializing type 'int' using type 'svint8x4_t'} } */ + int x1 = svluti4_zt_u8_x4 (0, zn_u8); /* { dg-error {incompatible types when initializing type 'int' using type 'svuint8x4_t'} } */ +} + +void +test_svluti4_zt_zt0_not_immediate (uint64_t zt0, svuint8x2_t zn_u8) __arm_streaming __arm_in ("zt0") +{ + svluti4_zt_s8_x4 (zt0, zn_u8); /* { dg-error {argument 1 of 'svluti4_zt_s8_x4' must be an integer constant expression} } */ + svluti4_zt_u8_x4 (zt0, zn_u8); /* { dg-error {argument 1 of 'svluti4_zt_u8_x4' must be an integer constant expression} } */ +} + +void +test_svluti4_zt_zt0_not_in_range (uint64_t zt0, svuint8x2_t zn_u8)__arm_streaming __arm_in ("zt0") +{ + svluti4_zt_s8_x4 (1, zn_u8); /* { dg-error {passing 1 to argument 1 of 'svluti4_zt_s8_x4', which expects the value 0} } */ + svluti4_zt_u8_x4 (1, zn_u8); /* { dg-error {passing 1 to argument 1 of 'svluti4_zt_u8_x4', which expects the value 0} } */ + + svluti4_zt_s8_x4 (-1, zn_u8); /* { dg-error {passing -1 to argument 1 of 'svluti4_zt_s8_x4', which expects the value 0} } */ + svluti4_zt_u8_x4 (-1, zn_u8); /* { dg-error {passing -1 to argument 1 of 'svluti4_zt_u8_x4', which expects the value 0} } */ +} + +#pragma GCC reset_options +#pragma GCC target("+sve2,+sme2") +void +test_svluti4_zt_feature_not_enabled (svuint8x2_t zn_u8)__arm_streaming __arm_in ("zt0") +{ + // GCC only complains for the first such instance, so only one test here. + svluti4_zt_s8_x4 (0, zn_u8); /* { dg-error {ACLE function 'svluti4_zt_s8_x4' requires ISA extension 'sme-lutv2'} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_lane_zt_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_lane_zt_1.c new file mode 100644 index 00000000000..321c0bd46df --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_lane_zt_1.c @@ -0,0 +1,406 @@ +/* { dg-options "-std=c23" } */ +/* { dg-do compile } */ + +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_lane_zt[_u8] (uint64_t zt0, svuint8_t zt, uint64_t idx) + __arm_streaming __arm_out ("zt0"); */ + +#pragma GCC target "+sve2,+sme-lutv2" +static_assert (__ARM_FEATURE_SME_LUTv2 == 1); +#include + +void +test_svwrite_lane_zt_explicit_ok ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_inout ("zt0") +{ + svwrite_lane_zt_u8 (0, zt_u8, 0); + svwrite_lane_zt_s8 (0, zt_s8, 0); + svwrite_lane_zt_u16 (0, zt_u16, 0); + svwrite_lane_zt_s16 (0, zt_s16, 0); + svwrite_lane_zt_u32 (0, zt_u32, 0); + svwrite_lane_zt_s32 (0, zt_s32, 0); + svwrite_lane_zt_u64 (0, zt_u64, 0); + svwrite_lane_zt_s64 (0, zt_s64, 0); + svwrite_lane_zt_bf16 (0, zt_bf16, 0); + svwrite_lane_zt_f16 (0, zt_f16, 0); + svwrite_lane_zt_f32 (0, zt_f32, 0); + svwrite_lane_zt_f64 (0, zt_f64, 0); +} + +void +test_svwrite_lane_zt_inferred_ok ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_inout ("zt0") +{ + svwrite_lane_zt (0, zt_u8, 0); + svwrite_lane_zt (0, zt_s8, 0); + svwrite_lane_zt (0, zt_u16, 0); + svwrite_lane_zt (0, zt_s16, 0); + svwrite_lane_zt (0, zt_u32, 0); + svwrite_lane_zt (0, zt_s32, 0); + svwrite_lane_zt (0, zt_u64, 0); + svwrite_lane_zt (0, zt_s64, 0); + svwrite_lane_zt (0, zt_bf16, 0); + svwrite_lane_zt (0, zt_f16, 0); + svwrite_lane_zt (0, zt_f32, 0); + svwrite_lane_zt (0, zt_f64, 0); +} + +void +test_svwrite_lane_zt_explicit_error_not_streaming ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) +{ + svwrite_lane_zt_u8 (0, zt_u8, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u8' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_s8 (0, zt_s8, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s8' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_u16 (0, zt_u16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_s16 (0, zt_s16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_u32 (0, zt_u32, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u32' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_s32 (0, zt_s32, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s32' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_u64 (0, zt_u64, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u64' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_s64 (0, zt_s64, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s64' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_bf16 (0, zt_bf16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_bf16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_f16 (0, zt_f16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_f16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_f32 (0, zt_f32, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_f32' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt_f64 (0, zt_f64, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_f64' can only be called when SME streaming mode is enabled} } */ +} + +void +test_svwrite_lane_zt_inferred_error_not_streaming ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) +{ + svwrite_lane_zt (0, zt_u8, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u8' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_s8, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s8' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_u16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_s16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_u32, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u32' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_s32, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s32' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_u64, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u64' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_s64, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_s64' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_bf16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_bf16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_f16, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_f16' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_f32, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_f32' can only be called when SME streaming mode is enabled} } */ + svwrite_lane_zt (0, zt_f64, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_f64' can only be called when SME streaming mode is enabled} } */ +} + +void +test_svwrite_lane_zt_explicit_error_arg_count_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt_u8 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u8'; expected 3, have 0} } */ + svwrite_lane_zt_s8 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s8'; expected 3, have 0} } */ + svwrite_lane_zt_u16 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u16'; expected 3, have 0} } */ + svwrite_lane_zt_s16 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s16'; expected 3, have 0} } */ + svwrite_lane_zt_u32 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u32'; expected 3, have 0} } */ + svwrite_lane_zt_s32 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s32'; expected 3, have 0} } */ + svwrite_lane_zt_u64 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u64'; expected 3, have 0} } */ + svwrite_lane_zt_s64 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s64'; expected 3, have 0} } */ + svwrite_lane_zt_bf16 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_bf16'; expected 3, have 0} } */ + svwrite_lane_zt_f16 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f16'; expected 3, have 0} } */ + svwrite_lane_zt_f32 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f32'; expected 3, have 0} } */ + svwrite_lane_zt_f64 (); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f64'; expected 3, have 0} } */ + + svwrite_lane_zt_u8 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u8'; expected 3, have 1} } */ + svwrite_lane_zt_s8 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s8'; expected 3, have 1} } */ + svwrite_lane_zt_u16 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u16'; expected 3, have 1} } */ + svwrite_lane_zt_s16 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s16'; expected 3, have 1} } */ + svwrite_lane_zt_u32 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u32'; expected 3, have 1} } */ + svwrite_lane_zt_s32 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s32'; expected 3, have 1} } */ + svwrite_lane_zt_u64 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u64'; expected 3, have 1} } */ + svwrite_lane_zt_s64 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s64'; expected 3, have 1} } */ + svwrite_lane_zt_bf16 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_bf16'; expected 3, have 1} } */ + svwrite_lane_zt_f16 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f16'; expected 3, have 1} } */ + svwrite_lane_zt_f32 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f32'; expected 3, have 1} } */ + svwrite_lane_zt_f64 (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f64'; expected 3, have 1} } */ + + svwrite_lane_zt_u8 (0, zt_u8); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u8'; expected 3, have 2} } */ + svwrite_lane_zt_s8 (0, zt_s8); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s8'; expected 3, have 2} } */ + svwrite_lane_zt_u16 (0, zt_u16); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u16'; expected 3, have 2} } */ + svwrite_lane_zt_s16 (0, zt_s16); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s16'; expected 3, have 2} } */ + svwrite_lane_zt_u32 (0, zt_u32); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u32'; expected 3, have 2} } */ + svwrite_lane_zt_s32 (0, zt_s32); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s32'; expected 3, have 2} } */ + svwrite_lane_zt_u64 (0, zt_u64); /* { dg-error {too few arguments to function 'svwrite_lane_zt_u64'; expected 3, have 2} } */ + svwrite_lane_zt_s64 (0, zt_s64); /* { dg-error {too few arguments to function 'svwrite_lane_zt_s64'; expected 3, have 2} } */ + svwrite_lane_zt_bf16 (0, zt_bf16); /* { dg-error {too few arguments to function 'svwrite_lane_zt_bf16'; expected 3, have 2} } */ + svwrite_lane_zt_f16 (0, zt_f16); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f16'; expected 3, have 2} } */ + svwrite_lane_zt_f32 (0, zt_f32); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f32'; expected 3, have 2} } */ + svwrite_lane_zt_f64 (0, zt_f64); /* { dg-error {too few arguments to function 'svwrite_lane_zt_f64'; expected 3, have 2} } */ + + svwrite_lane_zt_u8 (0, zt_u8, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_u8'; expected 3, have 4} } */ + svwrite_lane_zt_s8 (0, zt_s8, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_s8'; expected 3, have 4} } */ + svwrite_lane_zt_u16 (0, zt_u16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_u16'; expected 3, have 4} } */ + svwrite_lane_zt_s16 (0, zt_s16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_s16'; expected 3, have 4} } */ + svwrite_lane_zt_u32 (0, zt_u32, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_u32'; expected 3, have 4} } */ + svwrite_lane_zt_s32 (0, zt_s32, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_s32'; expected 3, have 4} } */ + svwrite_lane_zt_u64 (0, zt_u64, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_u64'; expected 3, have 4} } */ + svwrite_lane_zt_s64 (0, zt_s64, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_s64'; expected 3, have 4} } */ + svwrite_lane_zt_bf16 (0, zt_bf16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_bf16'; expected 3, have 4} } */ + svwrite_lane_zt_f16 (0, zt_f16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_f16'; expected 3, have 4} } */ + svwrite_lane_zt_f32 (0, zt_f32, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_f32'; expected 3, have 4} } */ + svwrite_lane_zt_f64 (0, zt_f64, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt_f64'; expected 3, have 4} } */ +} + +void +test_svwrite_lane_zt_implicit_error_arg_count_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt (); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_u8); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s8); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_u16); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s16); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_u32); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s32); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_u64); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s64); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_bf16); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_f16); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_f32); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_f64); /* { dg-error {too few arguments to function 'svwrite_lane_zt'} } */ + + svwrite_lane_zt (0, zt_u8, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s8, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_u16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_u32, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s32, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_u64, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_s64, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_bf16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_f16, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_f32, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ + svwrite_lane_zt (0, zt_f64, 0, 0); /* { dg-error {too many arguments to function 'svwrite_lane_zt'} } */ +} + +void +test_svwrite_lane_zt_explicit_error_arg_type_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64, svuint8x2_t zt_u8x2, svint8x2_t zt_s8x2, + svuint16x2_t zt_u16x2, svint16x2_t zt_s16x2, svuint32x2_t zt_u32x2, + svint32x2_t zt_s32x2, svuint64x2_t zt_u64x2, svint64x2_t zt_s64x2, + svbfloat16x2_t zt_bf16x2, svfloat16x2_t zt_f16x2, svfloat32x2_t zt_f32x2, + svfloat64x2_t zt_f64x2) __arm_streaming __arm_out ("zt0") +{ + struct Foo { uint64_t val; } foo = {0}; + svwrite_lane_zt_u8 (foo, zt_u8, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_u8'} } */ + svwrite_lane_zt_s8 (foo, zt_s8, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_s8'} } */ + svwrite_lane_zt_u16 (foo, zt_u16, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_u16'} } */ + svwrite_lane_zt_s16 (foo, zt_s16, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_s16'} } */ + svwrite_lane_zt_u32 (foo, zt_u32, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_u32'} } */ + svwrite_lane_zt_s32 (foo, zt_s32, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_s32'} } */ + svwrite_lane_zt_u64 (foo, zt_u64, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_u64'} } */ + svwrite_lane_zt_s64 (foo, zt_s64, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_s64'} } */ + svwrite_lane_zt_bf16 (foo, zt_bf16, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_bf16'} } */ + svwrite_lane_zt_f16 (foo, zt_f16, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_f16'} } */ + svwrite_lane_zt_f32 (foo, zt_f32, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_f32'} } */ + svwrite_lane_zt_f64 (foo, zt_f64, 0); /* { dg-error {incompatible type for argument 1 of 'svwrite_lane_zt_f64'} } */ + + svwrite_lane_zt_u8 (0, zt_s8, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u8'} } */ + svwrite_lane_zt_s8 (0, zt_u8, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s8'} } */ + svwrite_lane_zt_u16 (0, zt_s16, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u16'} } */ + svwrite_lane_zt_s16 (0, zt_u16, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s16'} } */ + svwrite_lane_zt_u32 (0, zt_s32, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u32'} } */ + svwrite_lane_zt_s32 (0, zt_u32, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s32'} } */ + svwrite_lane_zt_u64 (0, zt_s64, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u64'} } */ + svwrite_lane_zt_s64 (0, zt_u64, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s64'} } */ + svwrite_lane_zt_bf16 (0, zt_f16, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_bf16'} } */ + svwrite_lane_zt_f16 (0, zt_bf16, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_f16'} } */ + svwrite_lane_zt_f32 (0, zt_f64, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_f32'} } */ + svwrite_lane_zt_f64 (0, zt_f32, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_f64'} } */ + + svwrite_lane_zt_u8 (0, zt_u8x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u8'} } */ + svwrite_lane_zt_s8 (0, zt_s8x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s8'} } */ + svwrite_lane_zt_u16 (0, zt_u16x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u16'} } */ + svwrite_lane_zt_s16 (0, zt_s16x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s16'} } */ + svwrite_lane_zt_u32 (0, zt_u32x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u32'} } */ + svwrite_lane_zt_s32 (0, zt_s32x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s32'} } */ + svwrite_lane_zt_u64 (0, zt_u64x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_u64'} } */ + svwrite_lane_zt_s64 (0, zt_s64x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_s64'} } */ + svwrite_lane_zt_bf16 (0, zt_bf16x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_bf16'} } */ + svwrite_lane_zt_f16 (0, zt_f16x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_f16'} } */ + svwrite_lane_zt_f32 (0, zt_f32x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_f32'} } */ + svwrite_lane_zt_f64 (0, zt_f64x2, 0); /* { dg-error {incompatible type for argument 2 of 'svwrite_lane_zt_f64'} } */ + + svwrite_lane_zt_u8 (0, zt_u8, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_u8'} } */ + svwrite_lane_zt_s8 (0, zt_s8, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_s8'} } */ + svwrite_lane_zt_u16 (0, zt_u16, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_u16'} } */ + svwrite_lane_zt_s16 (0, zt_s16, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_s16'} } */ + svwrite_lane_zt_u32 (0, zt_u32, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_u32'} } */ + svwrite_lane_zt_s32 (0, zt_s32, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_s32'} } */ + svwrite_lane_zt_u64 (0, zt_u64, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_u64'} } */ + svwrite_lane_zt_s64 (0, zt_s64, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_s64'} } */ + svwrite_lane_zt_bf16 (0, zt_bf16, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_bf16'} } */ + svwrite_lane_zt_f16 (0, zt_f16, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_f16'} } */ + svwrite_lane_zt_f32 (0, zt_f32, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_f32'} } */ + svwrite_lane_zt_f64 (0, zt_f64, foo); /* { dg-error {incompatible type for argument 3 of 'svwrite_lane_zt_f64'} } */ +} + +void +test_svwrite_zt_inferred_error_arg_type_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64, svuint8x2_t zt_u8x2) __arm_streaming __arm_out ("zt0") +{ + struct Foo { uint64_t val; } foo = {0}; + svwrite_lane_zt (foo, zt_u8, 0); /* { dg-error {passing 'struct Foo' to argument 1 of 'svwrite_lane_zt', which expects 'uint64_t'} } */ + svwrite_lane_zt (0, zt_u8x2, 0); /* { dg-error {passing 'svuint8x2_t' to argument 2 of 'svwrite_lane_zt', which expects a single SVE vector rather than a tuple} } */ + svwrite_lane_zt (0, zt_u8, foo); /* { dg-error {passing 'struct Foo' to argument 3 of 'svwrite_lane_zt', which expects 'uint64_t'} } */ +} + +void +test_svwrite_lane_zt_explicit_error_zt0_not_immediate ( + uint64_t zt0, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt_u8 (zt0, zt_u8, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_u8' must be an integer constant expression} } */ + svwrite_lane_zt_s8 (zt0, zt_s8, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_s8' must be an integer constant expression} } */ + svwrite_lane_zt_u16 (zt0, zt_u16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_u16' must be an integer constant expression} } */ + svwrite_lane_zt_s16 (zt0, zt_s16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_s16' must be an integer constant expression} } */ + svwrite_lane_zt_u32 (zt0, zt_u32, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_u32' must be an integer constant expression} } */ + svwrite_lane_zt_s32 (zt0, zt_s32, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_s32' must be an integer constant expression} } */ + svwrite_lane_zt_u64 (zt0, zt_u64, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_u64' must be an integer constant expression} } */ + svwrite_lane_zt_s64 (zt0, zt_s64, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_s64' must be an integer constant expression} } */ + svwrite_lane_zt_bf16 (zt0, zt_bf16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_bf16' must be an integer constant expression} } */ + svwrite_lane_zt_f16 (zt0, zt_f16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_f16' must be an integer constant expression} } */ + svwrite_lane_zt_f32 (zt0, zt_f32, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_f32' must be an integer constant expression} } */ + svwrite_lane_zt_f64 (zt0, zt_f64, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt_f64' must be an integer constant expression} } */ +} + +void +test_svwrite_lane_zt_inferred_error_zt0_not_immediate ( + uint64_t zt0, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt (zt0, zt_u8, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_s8, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_u16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_s16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_u32, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_s32, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_u64, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_s64, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_bf16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_f16, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_f32, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (zt0, zt_f64, 0); /* { dg-error {argument 1 of 'svwrite_lane_zt' must be an integer constant expression} } */ +} + +void +test_svwrite_lane_zt_explicit_error_idx_not_immediate ( + uint64_t idx, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt_u8 (0, zt_u8, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_u8' must be an integer constant expression} } */ + svwrite_lane_zt_s8 (0, zt_s8, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_s8' must be an integer constant expression} } */ + svwrite_lane_zt_u16 (0, zt_u16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_u16' must be an integer constant expression} } */ + svwrite_lane_zt_s16 (0, zt_s16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_s16' must be an integer constant expression} } */ + svwrite_lane_zt_u32 (0, zt_u32, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_u32' must be an integer constant expression} } */ + svwrite_lane_zt_s32 (0, zt_s32, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_s32' must be an integer constant expression} } */ + svwrite_lane_zt_u64 (0, zt_u64, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_u64' must be an integer constant expression} } */ + svwrite_lane_zt_s64 (0, zt_s64, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_s64' must be an integer constant expression} } */ + svwrite_lane_zt_bf16 (0, zt_bf16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_bf16' must be an integer constant expression} } */ + svwrite_lane_zt_f16 (0, zt_f16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_f16' must be an integer constant expression} } */ + svwrite_lane_zt_f32 (0, zt_f32, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_f32' must be an integer constant expression} } */ + svwrite_lane_zt_f64 (0, zt_f64, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt_f64' must be an integer constant expression} } */ +} + +void +test_svwrite_lane_zt_inferred_error_idx_not_immediate ( + uint64_t idx, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt (0, zt_u8, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_s8, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_u16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_s16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_u32, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_s32, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_u64, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_s64, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_bf16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_f16, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_f32, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ + svwrite_lane_zt (0, zt_f64, idx); /* { dg-error {argument 3 of 'svwrite_lane_zt' must be an integer constant expression} } */ +} + +void +test_svwrite_lane_zt_explicit_error_idx_not_in_range ( + uint64_t idx, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt_u8 (0, zt_u8, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_u8', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_s8 (0, zt_s8, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_s8', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_u16 (0, zt_u16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_u16', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_s16 (0, zt_s16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_s16', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_u32 (0, zt_u32, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_u32', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_s32 (0, zt_s32, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_s32', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_u64 (0, zt_u64, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_u64', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_s64 (0, zt_s64, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_s64', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_bf16 (0, zt_bf16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_bf16', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_f16 (0, zt_f16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_f16', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_f32 (0, zt_f32, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_f32', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt_f64 (0, zt_f64, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt_f64', which expects a value in the range \[0, 3\]} } */ +} + +void +test_svwrite_lane_zt_inferred_error_idx_not_in_range ( + uint64_t idx, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_lane_zt (0, zt_u8, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_s8, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_u16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_s16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_u32, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_s32, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_u64, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_s64, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_bf16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_f16, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_f32, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ + svwrite_lane_zt (0, zt_f64, 4); /* { dg-error {passing 4 to argument 3 of 'svwrite_lane_zt', which expects a value in the range \[0, 3\]} } */ +} + +#pragma GCC reset_options +#pragma GCC target("+sve2,+sme2") +void +test_svwrite_lane_zt_feature_not_enabled (svuint8_t zt_u8) __arm_streaming __arm_out ("zt0") +{ + // GCC only complains for the first such instance, so only one test here. + svwrite_lane_zt (0, zt_u8, 0); /* { dg-error {ACLE function 'svwrite_lane_zt_u8' requires ISA extension 'sme-lutv2'} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_zt_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_zt_1.c new file mode 100644 index 00000000000..6c839a429ae --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/svwrite_zt_1.c @@ -0,0 +1,351 @@ +/* { dg-options "-std=c23" } */ +/* { dg-do compile } */ + +/* MOVT (vector to table) + Variants are also available for: + [_s8], [_u16], [_s16], [_u32], [_s32], [_u64], [_s64] + [_bf16], [_f16], [_f32], [_f64] + void svwrite_zt[_u8] (uint64_t zt0, svuint8_t zt, uint64_t idx) + __arm_streaming __arm_out ("zt0"); */ + +#pragma GCC target "+sve2,+sme-lutv2" +static_assert (__ARM_FEATURE_SME_LUTv2 == 1); +#include + +void +test_svwrite_zt_explicit_ok ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt_u8 (0, zt_u8); + svwrite_zt_s8 (0, zt_s8); + svwrite_zt_u16 (0, zt_u16); + svwrite_zt_s16 (0, zt_s16); + svwrite_zt_u32 (0, zt_u32); + svwrite_zt_s32 (0, zt_s32); + svwrite_zt_u64 (0, zt_u64); + svwrite_zt_s64 (0, zt_s64); + svwrite_zt_bf16 (0, zt_bf16); + svwrite_zt_f16 (0, zt_f16); + svwrite_zt_f32 (0, zt_f32); + svwrite_zt_f64 (0, zt_f64); +} + +void +test_svwrite_zt_inferred_ok ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt (0, zt_u8); + svwrite_zt (0, zt_s8); + svwrite_zt (0, zt_u16); + svwrite_zt (0, zt_s16); + svwrite_zt (0, zt_u32); + svwrite_zt (0, zt_s32); + svwrite_zt (0, zt_u64); + svwrite_zt (0, zt_s64); + svwrite_zt (0, zt_bf16); + svwrite_zt (0, zt_f16); + svwrite_zt (0, zt_f32); + svwrite_zt (0, zt_f64); +} + +void +test_svwrite_zt_explicit_error_not_streaming ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) +{ + svwrite_zt_u8 (0, zt_u8); /* { dg-error {ACLE function 'svwrite_zt_u8' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_s8 (0, zt_s8); /* { dg-error {ACLE function 'svwrite_zt_s8' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_u16 (0, zt_u16); /* { dg-error {ACLE function 'svwrite_zt_u16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_s16 (0, zt_s16); /* { dg-error {ACLE function 'svwrite_zt_s16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_u32 (0, zt_u32); /* { dg-error {ACLE function 'svwrite_zt_u32' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_s32 (0, zt_s32); /* { dg-error {ACLE function 'svwrite_zt_s32' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_u64 (0, zt_u64); /* { dg-error {ACLE function 'svwrite_zt_u64' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_s64 (0, zt_s64); /* { dg-error {ACLE function 'svwrite_zt_s64' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_bf16 (0, zt_bf16); /* { dg-error {ACLE function 'svwrite_zt_bf16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_f16 (0, zt_f16); /* { dg-error {ACLE function 'svwrite_zt_f16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_f32 (0, zt_f32); /* { dg-error {ACLE function 'svwrite_zt_f32' can only be called when SME streaming mode is enabled} } */ + svwrite_zt_f64 (0, zt_f64); /* { dg-error {ACLE function 'svwrite_zt_f64' can only be called when SME streaming mode is enabled} } */ +} + +void +test_svwrite_zt_inferred_error_not_streaming ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) +{ + svwrite_zt (0, zt_u8); /* { dg-error {ACLE function 'svwrite_zt_u8' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_s8); /* { dg-error {ACLE function 'svwrite_zt_s8' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_u16); /* { dg-error {ACLE function 'svwrite_zt_u16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_s16); /* { dg-error {ACLE function 'svwrite_zt_s16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_u32); /* { dg-error {ACLE function 'svwrite_zt_u32' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_s32); /* { dg-error {ACLE function 'svwrite_zt_s32' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_u64); /* { dg-error {ACLE function 'svwrite_zt_u64' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_s64); /* { dg-error {ACLE function 'svwrite_zt_s64' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_bf16); /* { dg-error {ACLE function 'svwrite_zt_bf16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_f16); /* { dg-error {ACLE function 'svwrite_zt_f16' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_f32); /* { dg-error {ACLE function 'svwrite_zt_f32' can only be called when SME streaming mode is enabled} } */ + svwrite_zt (0, zt_f64); /* { dg-error {ACLE function 'svwrite_zt_f64' can only be called when SME streaming mode is enabled} } */ +} + +void +test_svwrite_zt_explicit_error_arg_count_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt_u8 (); /* { dg-error {too few arguments to function 'svwrite_zt_u8'; expected 2, have 0} } */ + svwrite_zt_s8 (); /* { dg-error {too few arguments to function 'svwrite_zt_s8'; expected 2, have 0} } */ + svwrite_zt_u16 (); /* { dg-error {too few arguments to function 'svwrite_zt_u16'; expected 2, have 0} } */ + svwrite_zt_s16 (); /* { dg-error {too few arguments to function 'svwrite_zt_s16'; expected 2, have 0} } */ + svwrite_zt_u32 (); /* { dg-error {too few arguments to function 'svwrite_zt_u32'; expected 2, have 0} } */ + svwrite_zt_s32 (); /* { dg-error {too few arguments to function 'svwrite_zt_s32'; expected 2, have 0} } */ + svwrite_zt_u64 (); /* { dg-error {too few arguments to function 'svwrite_zt_u64'; expected 2, have 0} } */ + svwrite_zt_s64 (); /* { dg-error {too few arguments to function 'svwrite_zt_s64'; expected 2, have 0} } */ + svwrite_zt_bf16 (); /* { dg-error {too few arguments to function 'svwrite_zt_bf16'; expected 2, have 0} } */ + svwrite_zt_f16 (); /* { dg-error {too few arguments to function 'svwrite_zt_f16'; expected 2, have 0} } */ + svwrite_zt_f32 (); /* { dg-error {too few arguments to function 'svwrite_zt_f32'; expected 2, have 0} } */ + svwrite_zt_f64 (); /* { dg-error {too few arguments to function 'svwrite_zt_f64'; expected 2, have 0} } */ + + svwrite_zt_u8 (0); /* { dg-error {too few arguments to function 'svwrite_zt_u8'; expected 2, have 1} } */ + svwrite_zt_s8 (0); /* { dg-error {too few arguments to function 'svwrite_zt_s8'; expected 2, have 1} } */ + svwrite_zt_u16 (0); /* { dg-error {too few arguments to function 'svwrite_zt_u16'; expected 2, have 1} } */ + svwrite_zt_s16 (0); /* { dg-error {too few arguments to function 'svwrite_zt_s16'; expected 2, have 1} } */ + svwrite_zt_u32 (0); /* { dg-error {too few arguments to function 'svwrite_zt_u32'; expected 2, have 1} } */ + svwrite_zt_s32 (0); /* { dg-error {too few arguments to function 'svwrite_zt_s32'; expected 2, have 1} } */ + svwrite_zt_u64 (0); /* { dg-error {too few arguments to function 'svwrite_zt_u64'; expected 2, have 1} } */ + svwrite_zt_s64 (0); /* { dg-error {too few arguments to function 'svwrite_zt_s64'; expected 2, have 1} } */ + svwrite_zt_bf16 (0); /* { dg-error {too few arguments to function 'svwrite_zt_bf16'; expected 2, have 1} } */ + svwrite_zt_f16 (0); /* { dg-error {too few arguments to function 'svwrite_zt_f16'; expected 2, have 1} } */ + svwrite_zt_f32 (0); /* { dg-error {too few arguments to function 'svwrite_zt_f32'; expected 2, have 1} } */ + svwrite_zt_f64 (0); /* { dg-error {too few arguments to function 'svwrite_zt_f64'; expected 2, have 1} } */ + + svwrite_zt_u8 (0, zt_u8, 0); /* { dg-error {too many arguments to function 'svwrite_zt_u8'; expected 2, have 3} } */ + svwrite_zt_s8 (0, zt_s8, 0); /* { dg-error {too many arguments to function 'svwrite_zt_s8'; expected 2, have 3} } */ + svwrite_zt_u16 (0, zt_u16, 0); /* { dg-error {too many arguments to function 'svwrite_zt_u16'; expected 2, have 3} } */ + svwrite_zt_s16 (0, zt_s16, 0); /* { dg-error {too many arguments to function 'svwrite_zt_s16'; expected 2, have 3} } */ + svwrite_zt_u32 (0, zt_u32, 0); /* { dg-error {too many arguments to function 'svwrite_zt_u32'; expected 2, have 3} } */ + svwrite_zt_s32 (0, zt_s32, 0); /* { dg-error {too many arguments to function 'svwrite_zt_s32'; expected 2, have 3} } */ + svwrite_zt_u64 (0, zt_u64, 0); /* { dg-error {too many arguments to function 'svwrite_zt_u64'; expected 2, have 3} } */ + svwrite_zt_s64 (0, zt_s64, 0); /* { dg-error {too many arguments to function 'svwrite_zt_s64'; expected 2, have 3} } */ + svwrite_zt_bf16 (0, zt_bf16, 0); /* { dg-error {too many arguments to function 'svwrite_zt_bf16'; expected 2, have 3} } */ + svwrite_zt_f16 (0, zt_f16, 0); /* { dg-error {too many arguments to function 'svwrite_zt_f16'; expected 2, have 3} } */ + svwrite_zt_f32 (0, zt_f32, 0); /* { dg-error {too many arguments to function 'svwrite_zt_f32'; expected 2, have 3} } */ + svwrite_zt_f64 (0, zt_f64, 0); /* { dg-error {too many arguments to function 'svwrite_zt_f64'; expected 2, have 3} } */ +} + +void +test_svwrite_zt_inferred_error_arg_count_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt (); /* { dg-error {too few arguments to function 'svwrite_zt'} } */ + svwrite_zt (0); /* { dg-error {too few arguments to function 'svwrite_zt'} } */ + + svwrite_zt (0, zt_u8, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_s8, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_u16, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_s16, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_u32, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_s32, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_u64, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_s64, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_bf16, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_f16, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_f32, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ + svwrite_zt (0, zt_f64, 0); /* { dg-error {too many arguments to function 'svwrite_zt'} } */ +} + +void +test_svwrite_zt_explicit_error_arg_type_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64, svuint8x2_t zt_u8x2, svint8x2_t zt_s8x2, + svuint16x2_t zt_u16x2, svint16x2_t zt_s16x2, svuint32x2_t zt_u32x2, + svint32x2_t zt_s32x2, svuint64x2_t zt_u64x2, svint64x2_t zt_s64x2, + svbfloat16x2_t zt_bf16x2, svfloat16x2_t zt_f16x2, svfloat32x2_t zt_f32x2, + svfloat64x2_t zt_f64x2) __arm_streaming __arm_out ("zt0") +{ + struct Foo { uint64_t val; } foo = {0}; + svwrite_zt_u8 (foo, zt_u8); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_u8'} } */ + svwrite_zt_s8 (foo, zt_s8); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_s8'} } */ + svwrite_zt_u16 (foo, zt_u16); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_u16'} } */ + svwrite_zt_s16 (foo, zt_s16); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_s16'} } */ + svwrite_zt_u32 (foo, zt_u32); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_u32'} } */ + svwrite_zt_s32 (foo, zt_s32); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_s32'} } */ + svwrite_zt_u64 (foo, zt_u64); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_u64'} } */ + svwrite_zt_s64 (foo, zt_s64); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_s64'} } */ + svwrite_zt_bf16 (foo, zt_bf16); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_bf16'} } */ + svwrite_zt_f16 (foo, zt_f16); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_f16'} } */ + svwrite_zt_f32 (foo, zt_f32); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_f32'} } */ + svwrite_zt_f64 (foo, zt_f64); /* { dg-error {incompatible type for argument 1 of 'svwrite_zt_f64'} } */ + + svwrite_zt_u8 (0, zt_s8); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u8'} } */ + svwrite_zt_s8 (0, zt_u8); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s8'} } */ + svwrite_zt_u16 (0, zt_s16); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u16'} } */ + svwrite_zt_s16 (0, zt_u16); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s16'} } */ + svwrite_zt_u32 (0, zt_s32); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u32'} } */ + svwrite_zt_s32 (0, zt_u32); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s32'} } */ + svwrite_zt_u64 (0, zt_s64); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u64'} } */ + svwrite_zt_s64 (0, zt_u64); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s64'} } */ + svwrite_zt_bf16 (0, zt_f16); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_bf16'} } */ + svwrite_zt_f16 (0, zt_bf16); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_f16'} } */ + svwrite_zt_f32 (0, zt_f64); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_f32'} } */ + svwrite_zt_f64 (0, zt_f32); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_f64'} } */ + + svwrite_zt_u8 (0, zt_u8x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u8'} } */ + svwrite_zt_s8 (0, zt_s8x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s8'} } */ + svwrite_zt_u16 (0, zt_u16x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u16'} } */ + svwrite_zt_s16 (0, zt_s16x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s16'} } */ + svwrite_zt_u32 (0, zt_u32x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u32'} } */ + svwrite_zt_s32 (0, zt_s32x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s32'} } */ + svwrite_zt_u64 (0, zt_u64x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_u64'} } */ + svwrite_zt_s64 (0, zt_s64x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_s64'} } */ + svwrite_zt_bf16 (0, zt_bf16x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_bf16'} } */ + svwrite_zt_f16 (0, zt_f16x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_f16'} } */ + svwrite_zt_f32 (0, zt_f32x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_f32'} } */ + svwrite_zt_f64 (0, zt_f64x2); /* { dg-error {incompatible type for argument 2 of 'svwrite_zt_f64'} } */ +} + +void +test_svwrite_zt_inferred_error_arg_type_mismatch ( + svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, svint16_t zt_s16, + svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, svint64_t zt_s64, + svbfloat16_t zt_bf16, svfloat16_t zt_f16, svfloat32_t zt_f32, + svfloat64_t zt_f64, svuint8x2_t zt_u8x2) __arm_streaming __arm_out ("zt0") +{ + struct Foo { uint64_t val; } foo = {0}; + svwrite_zt (foo, zt_u8); /* { dg-error {passing 'struct Foo' to argument 1 of 'svwrite_zt', which expects 'uint64_t'} } */ + svwrite_zt (0, zt_u8x2); /* { dg-error {passing 'svuint8x2_t' to argument 2 of 'svwrite_zt', which expects a single SVE vector rather than a tuple} } */ +} + +void +test_svwrite_zt_explicit_error_zt0_not_immediate ( + uint64_t zt0, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt_u8 (zt0, zt_u8); /* { dg-error {argument 1 of 'svwrite_zt_u8' must be an integer constant expression} } */ + svwrite_zt_s8 (zt0, zt_s8); /* { dg-error {argument 1 of 'svwrite_zt_s8' must be an integer constant expression} } */ + svwrite_zt_u16 (zt0, zt_u16); /* { dg-error {argument 1 of 'svwrite_zt_u16' must be an integer constant expression} } */ + svwrite_zt_s16 (zt0, zt_s16); /* { dg-error {argument 1 of 'svwrite_zt_s16' must be an integer constant expression} } */ + svwrite_zt_u32 (zt0, zt_u32); /* { dg-error {argument 1 of 'svwrite_zt_u32' must be an integer constant expression} } */ + svwrite_zt_s32 (zt0, zt_s32); /* { dg-error {argument 1 of 'svwrite_zt_s32' must be an integer constant expression} } */ + svwrite_zt_u64 (zt0, zt_u64); /* { dg-error {argument 1 of 'svwrite_zt_u64' must be an integer constant expression} } */ + svwrite_zt_s64 (zt0, zt_s64); /* { dg-error {argument 1 of 'svwrite_zt_s64' must be an integer constant expression} } */ + svwrite_zt_bf16 (zt0, zt_bf16); /* { dg-error {argument 1 of 'svwrite_zt_bf16' must be an integer constant expression} } */ + svwrite_zt_f16 (zt0, zt_f16); /* { dg-error {argument 1 of 'svwrite_zt_f16' must be an integer constant expression} } */ + svwrite_zt_f32 (zt0, zt_f32); /* { dg-error {argument 1 of 'svwrite_zt_f32' must be an integer constant expression} } */ + svwrite_zt_f64 (zt0, zt_f64); /* { dg-error {argument 1 of 'svwrite_zt_f64' must be an integer constant expression} } */ +} + +void +test_svwrite_zt_inferred_error_zt0_not_immediate ( + uint64_t zt0, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt (zt0, zt_u8); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_s8); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_u16); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_s16); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_u32); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_s32); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_u64); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_s64); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_bf16); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_f16); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_f32); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ + svwrite_zt (zt0, zt_f64); /* { dg-error {argument 1 of 'svwrite_zt' must be an integer constant expression} } */ +} + +void +test_svwrite_zt_explicit_error_zt0_not_in_range ( + uint64_t zt0, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt_u8 (1, zt_u8); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_u8', which expects the value 0} } */ + svwrite_zt_s8 (1, zt_s8); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_s8', which expects the value 0} } */ + svwrite_zt_u16 (1, zt_u16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_u16', which expects the value 0} } */ + svwrite_zt_s16 (1, zt_s16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_s16', which expects the value 0} } */ + svwrite_zt_u32 (1, zt_u32); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_u32', which expects the value 0} } */ + svwrite_zt_s32 (1, zt_s32); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_s32', which expects the value 0} } */ + svwrite_zt_u64 (1, zt_u64); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_u64', which expects the value 0} } */ + svwrite_zt_s64 (1, zt_s64); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_s64', which expects the value 0} } */ + svwrite_zt_bf16 (1, zt_bf16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_bf16', which expects the value 0} } */ + svwrite_zt_f16 (1, zt_f16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_f16', which expects the value 0} } */ + svwrite_zt_f32 (1, zt_f32); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_f32', which expects the value 0} } */ + svwrite_zt_f64 (1, zt_f64); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt_f64', which expects the value 0} } */ + + svwrite_zt_u8 (-1, zt_u8); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_u8', which expects the value 0} } */ + svwrite_zt_s8 (-1, zt_s8); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_s8', which expects the value 0} } */ + svwrite_zt_u16 (-1, zt_u16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_u16', which expects the value 0} } */ + svwrite_zt_s16 (-1, zt_s16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_s16', which expects the value 0} } */ + svwrite_zt_u32 (-1, zt_u32); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_u32', which expects the value 0} } */ + svwrite_zt_s32 (-1, zt_s32); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_s32', which expects the value 0} } */ + svwrite_zt_u64 (-1, zt_u64); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_u64', which expects the value 0} } */ + svwrite_zt_s64 (-1, zt_s64); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_s64', which expects the value 0} } */ + svwrite_zt_bf16 (-1, zt_bf16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_bf16', which expects the value 0} } */ + svwrite_zt_f16 (-1, zt_f16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_f16', which expects the value 0} } */ + svwrite_zt_f32 (-1, zt_f32); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_f32', which expects the value 0} } */ + svwrite_zt_f64 (-1, zt_f64); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt_f64', which expects the value 0} } */ +} + +void +test_svwrite_zt_inferred_error_zt0_not_in_range ( + uint64_t zt0, svuint8_t zt_u8, svint8_t zt_s8, svuint16_t zt_u16, + svint16_t zt_s16, svuint32_t zt_u32, svint32_t zt_s32, svuint64_t zt_u64, + svint64_t zt_s64, svbfloat16_t zt_bf16, svfloat16_t zt_f16, + svfloat32_t zt_f32, svfloat64_t zt_f64) __arm_streaming __arm_out ("zt0") +{ + svwrite_zt (1, zt_u8); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_s8); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_u16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_s16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_u32); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_s32); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_u64); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_s64); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_bf16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_f16); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_f32); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (1, zt_f64); /* { dg-error {passing 1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + + svwrite_zt (-1, zt_u8); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_s8); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_u16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_s16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_u32); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_s32); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_u64); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_s64); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_bf16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_f16); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_f32); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ + svwrite_zt (-1, zt_f64); /* { dg-error {passing -1 to argument 1 of 'svwrite_zt', which expects the value 0} } */ +} + +#pragma GCC reset_options +#pragma GCC target("+sve2,+sme2") +void +test_svwrite_zt_feature_not_enabled (svuint8_t zt_u8) __arm_streaming __arm_out ("zt0") +{ + // GCC only complains for the first such instance, so only one test here. + svwrite_zt_u8 (0, zt_u8); /* { dg-error {ACLE function 'svwrite_zt_u8' requires ISA extension 'sme-lutv2'} } */ +}