From patchwork Tue Nov 16 10:14:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murray Steele X-Patchwork-Id: 47756 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 084F93858004 for ; Tue, 16 Nov 2021 10:16:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 084F93858004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637057801; bh=vZO+oETPOaOanQMW+ox0McoWD8vknTGVAaq+px7RkSk=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ovd24aCFILOhlW4PF0Ambi0B+STHkctslQnCDgM+JMf7ykjuRxRJ3WF1jECPTsyXM FOYEFcBgX0+eAV8/7fznd6y5yWIabLxOuuCD+gSWfouPQPSB6TiNCStBTow4kx9wOb TurUuocRzFytjmw1XfvIr12+1ZBKvGm0z2h5JIY4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140082.outbound.protection.outlook.com [40.107.14.82]) by sourceware.org (Postfix) with ESMTPS id D5ECA385741B for ; Tue, 16 Nov 2021 10:15:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D5ECA385741B Received: from AS9PR06CA0340.eurprd06.prod.outlook.com (2603:10a6:20b:466::35) by DBBPR08MB4728.eurprd08.prod.outlook.com (2603:10a6:10:d6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.18; Tue, 16 Nov 2021 10:15:07 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:466:cafe::76) by AS9PR06CA0340.outlook.office365.com (2603:10a6:20b:466::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Tue, 16 Nov 2021 10:15:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.20 via Frontend Transport; Tue, 16 Nov 2021 10:15:07 +0000 Received: ("Tessian outbound 1cd1a01725a6:v110"); Tue, 16 Nov 2021 10:15:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d964245ba7f1f977 X-CR-MTA-TID: 64aa7808 Received: from aa8a71ff0f6c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AFC10307-D5E6-424E-801B-B0D0FBAFCC0D.1; Tue, 16 Nov 2021 10:14:58 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id aa8a71ff0f6c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 16 Nov 2021 10:14:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WyZUl6v9P6LKVRYOUA7c6KGYKW3JvMYYlsQX1oRzwf31tCIGwruMBMsp+0gQ0cDHDeMISfCyv4NtlYfWqpCC4movAclPe2AluVu+kXY+eSpnvsf+LkcZmDLOP/ls5/ph0MY3Ls57j3JBHxvBDwWgBmVDjHHXrmVLTSDuU04l0y3p7uluHOTZVundVNXHDGwzjFQsW1suFMaTfgMdB9y0oppkMM2FhXDDbmRuq20IHZT8wPRRik8lHQhKWQJuyGIET4lvmCl/isFZNaUMC2uUnDLltMcCCpxdl+ygX+aE9m2kfE+fN55HzMj0nO9KSCRECXQFFjO0wtXsZIMrHQLplA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vZO+oETPOaOanQMW+ox0McoWD8vknTGVAaq+px7RkSk=; b=fqr62ISO32VvPzGDnToScq0SVUgO+NnMs7WQSVL7sYZqPRWoRTmb048aCGk9Y1UT72ooxZaHRN4OcZluN7MDUnV8wjo29KzcPbn5XvBFwq2KJ2sflw3MmylLuS7pdno6X3x1Vp98PGdTE0k2N4tCs7vlbDwJ/3dMwb+zbsd9iEcPvuR7Rma4q/ob+5LrPvwI6VezcwVod11+aEAG/QXuF4Rhsa2/ssnQa5qUWgkGe5urv9Y/5SmZcOyNyzmPw7pME5zIkymaHRArw9nHs7hkgI7e2YA1ngpJePdOTL5plDvaSisrdJ9PBg79zm5K45Vo1XDY63H/5IuP5RavPYlt8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB5175.eurprd08.prod.outlook.com (2603:10a6:20b:ef::11) by AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.25; Tue, 16 Nov 2021 10:14:55 +0000 Received: from AM6PR08MB5175.eurprd08.prod.outlook.com ([fe80::8d8f:5a4a:c1f8:c305]) by AM6PR08MB5175.eurprd08.prod.outlook.com ([fe80::8d8f:5a4a:c1f8:c305%6]) with mapi id 15.20.4713.019; Tue, 16 Nov 2021 10:14:55 +0000 Subject: [PATCH 1/2][GCC] arm: Move arm_simd_info array declaration into header To: gcc-patches@gcc.gnu.org Message-ID: Date: Tue, 16 Nov 2021 10:14:53 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Content-Language: en-US X-ClientProxiedBy: LO2P265CA0125.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::17) To AM6PR08MB5175.eurprd08.prod.outlook.com (2603:10a6:20b:ef::11) MIME-Version: 1.0 Received: from [10.32.99.44] (217.140.106.32) by LO2P265CA0125.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Tue, 16 Nov 2021 10:14:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f972b6a-f896-4e14-d52b-08d9a8e9f6cc X-MS-TrafficTypeDiagnostic: AM6PR08MB3047:|DBBPR08MB4728: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: QOrM+j1gXZG+escJar1AcCn/dDxnAEFH7HIleVBMqRzBYnwuAWmK2JE8x53esymQPU4h7WIaI0Sv2vSS9QgJW7YeBFWcsRpctkbwwchZBW9VsTcTsP2qWDupCF8+eSn1KtYqTkdnVHRMe8tk4vn9JB/S6apCGBH/BNCGtIdJR1eDlXWaKH9/DOrJEPJoKv/00JWlMQ7w3kvobmw7KSqLKxJNu2kIMRsE5ndJMnhdfqfCEfcZ9oqOS0pK+6MhQHYGzUxrL7+Rx/X9jNrPxWpBV0liANMX7VtXN9DWhDnzl+42lXCpsyPoHFhz/0wOJbIMphv8AyWROUVv4cIynCD5u16T47NmrHo/1Qc8I9e5Uhp3EYHpEuv/4bXEPZlxaJACg+88/5z/pVDSqct7aFpNHVnSr4gjbABiOy3DItL/r8PG7vJb/rpR7YrNtBf3/foXqaXMLTlNpOBMyoE6oYysfFJb6yhzUtsv3PEw2qvi0CmWkruBXgwWXSSqtnvkCMn/QSD10wN5luQnFSiqP9sFcv56ObbYirCaOa599hSGM+HszxrgkJ+zL4t0FOOijBM44O95jDfOmDD89vh0y7bC+XQkXZGGgBsmi/HjeuiQJirD0gR46epXKXvW21I+JBkiDdboRu9sYS66fRA/JRxyBc3jcvfEfgBqHODEIkekMRJytOv46tTXox4NbE3oGEn6Pv2/q6y/U57tD0Op7fRfEUkJUZOXfiynMxumHeqeg/s= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB5175.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(16576012)(5660300002)(86362001)(31696002)(508600001)(83380400001)(316002)(26005)(38100700002)(31686004)(6486002)(2906002)(66556008)(186003)(2616005)(8936002)(6916009)(956004)(36756003)(66946007)(21480400003)(33964004)(66476007)(8676002)(235185007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3047 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: dc51eed6-398c-4b68-336b-08d9a8e9efd1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: epM+TW/o9Mlbg3y9PCMagVsEZQXKX1WW3FFS022qbR9ULrvJk0qOTzyKVSO1hLgt08Fm54caQjwlTV49GiWnAPLbBY6n3H3zLqU9dewm0eRu+vkkkjQgRpwiCaG2k2S07QQr5XuMcouOMttY/vseqB3stNxYMRWx0E8s6COHoVEOqjIO7ZjS83EP5awFAj5+RZGtYwrYVZJ71BWGvdJuCXS0JdszvBzkY0Z+n5n+8nCCDAjgN4DYQ2e8xGnJD6W4OC5XHCR2k7eWqPZAikGq+rKqamhrqwl+cQJ1EaW+AnBocDohbiLBvXN4Kr4BdiP9q4PxMKwqD2tgS0gf8SLx+ktBSw/0X8jdeQeC+awpQR7ZW2GzRozapai4dO4vqPXKbqzKoSnPwo1F26D1XYtRUSUHOJFjmBnIWhs5ZJMYqSw2BN9tP7pjA1f2CYJs9PbHKhEMOJA3a6jB5/0uQ0Nv0LbeDcboiLUP+oq8cxqlCKQMBXBuc/0+IveJvOTw8SsvLLNX0NAwB+DpUxT7ttH/fJmQbScNN/aLdlgHFLdONoyqaSInB0h0QQyvHDFwSrW50WxPZfsYCcT97AnVEP24atYoVDzxFXxoGvuOaJTKh+ZbQHWwTUCUimeKVTn5FawjXVemffLEIPiLCimUL34xQAzIJ5i8dyO6tF434q7/2JJVLB5D+QItdaBPA81Ud5KVr4D6fyt645QNi8SThJAxTDGOUT2DEcYMWU4v358ZGOU= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(31696002)(956004)(16576012)(2616005)(508600001)(186003)(21480400003)(6486002)(26005)(36756003)(70586007)(356005)(70206006)(8676002)(31686004)(82310400003)(81166007)(8936002)(336012)(47076005)(316002)(33964004)(36860700001)(235185007)(83380400001)(2906002)(86362001)(5660300002)(6916009)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2021 10:15:07.0321 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f972b6a-f896-4e14-d52b-08d9a8e9f6cc X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4728 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Murray Steele via Gcc-patches From: Murray Steele Reply-To: Murray Steele Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi all, This patch moves the arm_simd_type and arm_type_qualifiers enums, and arm_simd_info struct from arm-builtins.c into arm-builtins.h header. This is a first step towards internalising the type definitions for MVE predicate, vector, and tuple types. By moving arm_simd_types into a header, we allow future patches to use these type trees externally to arm-builtins.c, which is a crucial step towards developing an MVE intrinsics framework similar to the current SVE implementation. Thanks, Murray gcc/ChangeLog: * config/arm/arm-builtins.c (enum arm_type_qualifiers): Move to arm_builtins.h (enum arm_simd_type): Move to arm-builtins.h (struct arm_simd_type_info): Move to arm-builtins.h * config/arm/arm-builtins.h (enum arm_simd_type): Move from arm-builtins.c (enum arm_type_qualifiers): Move from arm-builtins.c (struct arm_simd_type_info): Move from arm-builtins.c diff --git a/gcc/config/arm/arm-builtins.h b/gcc/config/arm/arm-builtins.h index bee9f9bb83758820ca7faedf80b7e138026c1ca0..a40fa8950707314d3cc1372fb5c47a8891a18516 100644 --- a/gcc/config/arm/arm-builtins.h +++ b/gcc/config/arm/arm-builtins.h @@ -32,4 +32,91 @@ enum resolver_ident { enum resolver_ident arm_describe_resolver (tree); unsigned arm_cde_end_args (tree); +#define ENTRY(E, M, Q, S, T, G) E, +enum arm_simd_type +{ +#include "arm-simd-builtin-types.def" + __TYPE_FINAL +}; +#undef ENTRY + +enum arm_type_qualifiers +{ + /* T foo. */ + qualifier_none = 0x0, + /* unsigned T foo. */ + qualifier_unsigned = 0x1, /* 1 << 0 */ + /* const T foo. */ + qualifier_const = 0x2, /* 1 << 1 */ + /* T *foo. */ + qualifier_pointer = 0x4, /* 1 << 2 */ + /* const T * foo. */ + qualifier_const_pointer = 0x6, + /* Used when expanding arguments if an operand could + be an immediate. */ + qualifier_immediate = 0x8, /* 1 << 3 */ + qualifier_unsigned_immediate = 0x9, + qualifier_maybe_immediate = 0x10, /* 1 << 4 */ + /* void foo (...). */ + qualifier_void = 0x20, /* 1 << 5 */ + /* Some patterns may have internal operands, this qualifier is an + instruction to the initialisation code to skip this operand. */ + qualifier_internal = 0x40, /* 1 << 6 */ + /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum + rather than using the type of the operand. */ + qualifier_map_mode = 0x80, /* 1 << 7 */ + /* qualifier_pointer | qualifier_map_mode */ + qualifier_pointer_map_mode = 0x84, + /* qualifier_const_pointer | qualifier_map_mode */ + qualifier_const_pointer_map_mode = 0x86, + /* Polynomial types. */ + qualifier_poly = 0x100, + /* Lane indices - must be within range of previous argument = a vector. */ + qualifier_lane_index = 0x200, + /* Lane indices for single lane structure loads and stores. */ + qualifier_struct_load_store_lane_index = 0x400, + /* A void pointer. */ + qualifier_void_pointer = 0x800, + /* A const void pointer. */ + qualifier_const_void_pointer = 0x802, + /* Lane indices selected in pairs - must be within range of previous + argument = a vector. */ + qualifier_lane_pair_index = 0x1000, + /* Lane indices selected in quadtuplets - must be within range of previous + argument = a vector. */ + qualifier_lane_quadtup_index = 0x2000 +}; + +struct arm_simd_type_info +{ + enum arm_simd_type type; + + /* Internal type name. */ + const char *name; + + /* Internal type name(mangled). The mangled names conform to the + AAPCS (see "Procedure Call Standard for the ARM Architecture", + Appendix A). To qualify for emission with the mangled names defined in + that document, a vector type must not only be of the correct mode but also + be of the correct internal Neon vector type (e.g. __simd64_int8_t); + these types are registered by arm_init_simd_builtin_types (). In other + words, vector types defined in other ways e.g. via vector_size attribute + will get default mangled names. */ + const char *mangle; + + /* Internal type. */ + tree itype; + + /* Element type. */ + tree eltype; + + /* Machine mode the internal type maps to. */ + machine_mode mode; + + /* Qualifiers. */ + enum arm_type_qualifiers q; +}; + +extern struct arm_simd_type_info arm_simd_types[]; + #endif /* GCC_ARM_BUILTINS_H */ diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c index 3a9ff8f26b8e222c52cb70f7509b714c3e475758..b6bf31349d8f0e996a6c169b061ebe05a2cf9acb 100644 --- a/gcc/config/arm/arm-builtins.c +++ b/gcc/config/arm/arm-builtins.c @@ -48,53 +48,6 @@ #define SIMD_MAX_BUILTIN_ARGS 7 -enum arm_type_qualifiers -{ - /* T foo. */ - qualifier_none = 0x0, - /* unsigned T foo. */ - qualifier_unsigned = 0x1, /* 1 << 0 */ - /* const T foo. */ - qualifier_const = 0x2, /* 1 << 1 */ - /* T *foo. */ - qualifier_pointer = 0x4, /* 1 << 2 */ - /* const T * foo. */ - qualifier_const_pointer = 0x6, - /* Used when expanding arguments if an operand could - be an immediate. */ - qualifier_immediate = 0x8, /* 1 << 3 */ - qualifier_unsigned_immediate = 0x9, - qualifier_maybe_immediate = 0x10, /* 1 << 4 */ - /* void foo (...). */ - qualifier_void = 0x20, /* 1 << 5 */ - /* Some patterns may have internal operands, this qualifier is an - instruction to the initialisation code to skip this operand. */ - qualifier_internal = 0x40, /* 1 << 6 */ - /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum - rather than using the type of the operand. */ - qualifier_map_mode = 0x80, /* 1 << 7 */ - /* qualifier_pointer | qualifier_map_mode */ - qualifier_pointer_map_mode = 0x84, - /* qualifier_const_pointer | qualifier_map_mode */ - qualifier_const_pointer_map_mode = 0x86, - /* Polynomial types. */ - qualifier_poly = 0x100, - /* Lane indices - must be within range of previous argument = a vector. */ - qualifier_lane_index = 0x200, - /* Lane indices for single lane structure loads and stores. */ - qualifier_struct_load_store_lane_index = 0x400, - /* A void pointer. */ - qualifier_void_pointer = 0x800, - /* A const void pointer. */ - qualifier_const_void_pointer = 0x802, - /* Lane indices selected in pairs - must be within range of previous - argument = a vector. */ - qualifier_lane_pair_index = 0x1000, - /* Lane indices selected in quadtuplets - must be within range of previous - argument = a vector. */ - qualifier_lane_quadtup_index = 0x2000 -}; - /* The qualifier_internal allows generation of a unary builtin from a pattern with a third pseudo-operand such as a match_scratch. T (T). */ @@ -1377,50 +1330,12 @@ const char *arm_scalar_builtin_types[] = { NULL }; -#define ENTRY(E, M, Q, S, T, G) E, -enum arm_simd_type -{ -#include "arm-simd-builtin-types.def" - __TYPE_FINAL -}; -#undef ENTRY - -struct arm_simd_type_info -{ - enum arm_simd_type type; - - /* Internal type name. */ - const char *name; - - /* Internal type name(mangled). The mangled names conform to the - AAPCS (see "Procedure Call Standard for the ARM Architecture", - Appendix A). To qualify for emission with the mangled names defined in - that document, a vector type must not only be of the correct mode but also - be of the correct internal Neon vector type (e.g. __simd64_int8_t); - these types are registered by arm_init_simd_builtin_types (). In other - words, vector types defined in other ways e.g. via vector_size attribute - will get default mangled names. */ - const char *mangle; - - /* Internal type. */ - tree itype; - - /* Element type. */ - tree eltype; - - /* Machine mode the internal type maps to. */ - machine_mode mode; - - /* Qualifiers. */ - enum arm_type_qualifiers q; -}; - #define ENTRY(E, M, Q, S, T, G) \ {E, \ "__simd" #S "_" #T "_t", \ #G "__simd" #S "_" #T "_t", \ NULL_TREE, NULL_TREE, M##mode, qualifier_##Q}, -static struct arm_simd_type_info arm_simd_types [] = { +struct arm_simd_type_info arm_simd_types [] = { #include "arm-simd-builtin-types.def" }; #undef ENTRY From patchwork Tue Nov 16 10:15:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murray Steele X-Patchwork-Id: 47757 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 152A33857C5D for ; Tue, 16 Nov 2021 10:17:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 152A33857C5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637057861; bh=tU607Bn9V9TkmA+PT15e36A4vfKhvtXB3ufuk2NOhQc=; h=Subject:To:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dYTKod0VG4nG5yZEs6x0zpks3/u9fQEygfoImEs8hwseJgWs0rrVgQ1Z5BWQFtC9J smidfk+QBxY2S7dz0wffJ2xlPxkJJAI4ekqZZgqPbD3bQBdNieEfee1KlSPjRskevv q/YQxZngwq6xx6q5CVqJnVy8Y9eyb/w6n7IAf7Os= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062.outbound.protection.outlook.com [40.107.20.62]) by sourceware.org (Postfix) with ESMTPS id 955B33857828 for ; Tue, 16 Nov 2021 10:15:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 955B33857828 Received: from DB9PR05CA0022.eurprd05.prod.outlook.com (2603:10a6:10:1da::27) by DB6PR0802MB2166.eurprd08.prod.outlook.com (2603:10a6:4:85::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.26; Tue, 16 Nov 2021 10:15:17 +0000 Received: from DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1da:cafe::2f) by DB9PR05CA0022.outlook.office365.com (2603:10a6:10:1da::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Tue, 16 Nov 2021 10:15:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT022.mail.protection.outlook.com (10.152.20.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.19 via Frontend Transport; Tue, 16 Nov 2021 10:15:17 +0000 Received: ("Tessian outbound de6049708a0a:v110"); Tue, 16 Nov 2021 10:15:17 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3e4bba1b7a181558 X-CR-MTA-TID: 64aa7808 Received: from 42fa11a6ee2b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9ED0B35F-3EB6-4D94-BF8D-7AB90A7BDAF4.1; Tue, 16 Nov 2021 10:15:08 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 42fa11a6ee2b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 16 Nov 2021 10:15:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X3Ja631xXNDC0EFLB/WKPovxqo3QrnWPhAW1MtdthcA04AYbedH4W0GuIheEgOhGSWLoeHdIU44+BnVhUm28NENTYNSCACgNG/Ye03fHbdGZyBZmkpBNr0daiDqgN80NuS/N4ZxgOaElE8ljmpGx1F6uy2UsCt3OflMOk50P8N1+myVLkDBk7VlZGfoQkhq95fcivpUAlN6Ou1RX10Drsifb6LfYEeshWP8yJPzfaPqz0ylFxZc8DkTwnj8XZ6bpv+Wc4dFjUGeaHBtizI10V5SmGBaCBOAZOMAFIjAJ1IY8pP6sEodRCQGOoyXbaMnn/HLzoShdpny0hO87viZvrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tU607Bn9V9TkmA+PT15e36A4vfKhvtXB3ufuk2NOhQc=; b=hBSRcD8RPaYedjgppEDLTV2ep91k09h5a/cTf4S/xGSk9AjInAejwa/OnV520UPs2nj4+es6cRXynCOhuQOL/8ACteB8gZR542Gu+aLx2x5BBDj7UK2i7rueSOEYjwpCdyBWS0dElaUS/P1yQi1Es7Xsho6tQ0RopfN7lQ+f5Oofk2vszt7IwkSy5EJNWi4GTch2zb1kd0+1q+/qbaMnVLlmR0v2Fn6VWLcxgl8Wd1gXLqBLNHaGlOKB9WhO73IhEEQeO+zbIGOi3cM3t5J3A+NVIVoY9mAcekPpfCsJpfOCY3tYWGQ+t1MyIGfQIDgrEdjiq06m3GVYQEfx4sN6Tg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB5175.eurprd08.prod.outlook.com (2603:10a6:20b:ef::11) by AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.25; Tue, 16 Nov 2021 10:15:05 +0000 Received: from AM6PR08MB5175.eurprd08.prod.outlook.com ([fe80::8d8f:5a4a:c1f8:c305]) by AM6PR08MB5175.eurprd08.prod.outlook.com ([fe80::8d8f:5a4a:c1f8:c305%6]) with mapi id 15.20.4713.019; Tue, 16 Nov 2021 10:15:05 +0000 Subject: [PATCH 2/2][GCC] arm: Declare MVE types internally via pragma To: gcc-patches@gcc.gnu.org Message-ID: <55ba6a8c-4dda-c023-0e93-a052e4830d06@arm.com> Date: Tue, 16 Nov 2021 10:15:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Content-Language: en-US X-ClientProxiedBy: LO2P265CA0141.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::33) To AM6PR08MB5175.eurprd08.prod.outlook.com (2603:10a6:20b:ef::11) MIME-Version: 1.0 Received: from [10.32.99.44] (217.140.106.32) by LO2P265CA0141.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Tue, 16 Nov 2021 10:15:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ac7abb2-c3d8-44c0-66eb-08d9a8e9fcd7 X-MS-TrafficTypeDiagnostic: AM6PR08MB3047:|DB6PR0802MB2166: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: WJzP1mvXv8Yi3T3xutxX9/hA6W1f+OpxgRhbR3OqiURBD9E2IyBNjA79JAYHcbWMv5vIIaAea3x6Ro1yhOBP6/1vCi4pgdwyNthsuoWSA/gONNWek5ExxuBE3KiAXkoZoUBe4Nv14qwAqIhq2kuZQUWhGL5DRyLb2JRUbH/pgdVKfsnlIZHyDQ44NNqcW2IHxSALEpXJm89qmg2tRfgrde4rwHu3a8WnTwe+0tr4alOV9NaRaOl0OIZqy3aaq5WwB3UuXgaFtVKv/fLgk/0ch8MLbxO6PGmAOCjMbKDNvQp9xFfR5lcOx9wQXYHipuctpakT8klYzd2eZ8kxu2nA8geEOe7EXpN3no8vGLRx5vT4uS4+dHwdPEJX1GK0R60MN+2klQsJOj3tZM4KoTysWAnlRLqc+wG817b/RntC4jEGh0d0OPu/7MAvDyfls+1+//jisZIVwE2CU4bKCcgMErm8exdOZBAfk67FMkyrU/csPzsgXKJUNrLDewRrxMtlxBxd0CK2hpbl9BTVxxJzgnypZyNyx4TR2h7729mVlIKwT/rOHtfKpm4wxN03vwPDrrx77ic0GZuX4H+ZVg2Q1TABnxJytVdIRj7WnLibD5nGAzwylvpzCBD3VB2cihZQ3At/YEXrxFDI0bNESm+58hhSMwTvKwwDjtu2YXQT3gkMEHkxin5slehLeZKaZsStDO5j/fcZRMK93EOjFraehWroSFOWuEAPT73IEtzntR9xyNYh3ISHbmcAZQbtlTiJNwKizJl+OkbMK8UlI77ILIiANbU2r0R4rPHBBn3bmG6j3yjekfG6DIm8xn2l/reWrE58OaqGT0AcG1VICrh3CJv6BbVhH2U6zK3KVMj1KNk= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB5175.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(16576012)(5660300002)(86362001)(31696002)(508600001)(316002)(26005)(38100700002)(31686004)(6486002)(2906002)(66556008)(186003)(2616005)(8936002)(6916009)(956004)(36756003)(66946007)(21480400003)(33964004)(66476007)(8676002)(235185007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3047 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 341d9e19-69af-4258-3667-08d9a8e9f5ad X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tMn3ypoVF1lAYfj+DvetzOzJ2pDJ23/QAxVcBawJqWC5MBMD27AETxS59oxF4o9Q9WcO/KeVJeOio0JqPwHtI5IXbjz0FYKLG45pAOAmIw7Yo1+VYFsM3TfgbLcRJDpb7jV+n3TZrO7Xy/bNKhiCbnl3y1Z+PdLffDbKTLyMuF7zexBlertDiun/zADdO8eaf05Bh4g+AUMPuq7w5CKGuIlBC+jlOdePnMkX6rGZFNcmb/OwfYL9yKSvh2ilfS9ZvNIwZg2yVmtKITtmDHsX0E+JQSP4CSDfY8As0sH7OkjaQrSG03ws6peW7uYSbOHNQgEVJLUFTOPwT7qf8+2OplFHXewyiNcdNPMDLadRWoppLsHfFl4RKPA91WY6gqayt1aVqTk510/dOerHSrP8yWL94skbeAYIimDCPIh6s089gQ3bDaQtsBsuO8DpshmKNMkMZtQ431M+1x+tnQ5JUuJdpEmrjr05hrP5HGsDz6YZTFyWkVGShiSGvWd5zJTh+cLdFHi5KnrdKKM8lEGereOvWghCfz3p9gAr4tkr0C3ruh2+MFaLiaNz1JR3SdSxSyrqSvu3OmPY9LlW1DaM6a/PRGVAYQ8Ou3bEKDPQgdWlmuB4QYZ+OusIkovHR2HGc61/FiN5mv5IlMNBQ1IfGnL0TWayEL0El2Br4xxoEpv7QA6IgWUezbKGZRG2HWfY41Scb73jxzDYrA0TOjM2XJCDSV/gc4bg+LzNqWM7fNr4jUYXAcmSPQbw9n8BlfNav6yspQ7BbOmWUAJgk+zd++1hPRcnHaxNX/aHNTsCB2ZgUBIijCJFuAPJN+QhT+TarwLwfiVzllaPTgIwA3NendCykt3+tg4ATUaCNayrlu4= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(31696002)(2906002)(31686004)(6916009)(2616005)(81166007)(26005)(21480400003)(356005)(36756003)(956004)(508600001)(33964004)(47076005)(8936002)(86362001)(186003)(36860700001)(8676002)(82310400003)(16576012)(316002)(336012)(6486002)(235185007)(5660300002)(70206006)(70586007)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2021 10:15:17.2377 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ac7abb2-c3d8-44c0-66eb-08d9a8e9fcd7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2166 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Murray Steele via Gcc-patches From: Murray Steele Reply-To: Murray Steele Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi all, This patch moves the implementation of MVE ACLE types from arm_mve_types.h to inside GCC via a new pragma, which replaces the prior type definitions. This allows for the types to be used internally for intrinsic function definitions. Bootstrapped and regression tested on arm-none-linux-gnuabihf, and regression tested on arm-eabi -- no issues. Thanks, Murray gcc/ChangeLog: * config.gcc: Add arm-mve-builtins.o to extra_objs for arm-*-*-* targets. * config/arm/arm-c.c (arm_pragma_arm): Handle new pragma. (arm_register_target_pragmas): Register new pragma. * config/arm/arm-protos.h: Add arm_mve namespace and declare arm_handle_mve_types_h. * config/arm/arm_mve_types.h: Replace MVE type definitions with new pragma. * config/arm/t-arm: Add arm-mve-builtins.o target. * config/arm/arm-mve-builtins.cc: New file. * config/arm/arm-mve-builtins.def: New file. * config/arm/arm-mve-builtins.h: New file. gcc/testsuite/ChangeLog: * gcc.target/arm/mve/mve.exp: Add new subdirectories. * gcc.target/arm/mve/general-c/type_redef_1.c: New test. * gcc.target/arm/mve/general-c/type_redef_10.c: New test. * gcc.target/arm/mve/general-c/type_redef_11.c: New test. * gcc.target/arm/mve/general-c/type_redef_12.c: New test. * gcc.target/arm/mve/general-c/type_redef_13.c: New test. * gcc.target/arm/mve/general-c/type_redef_14.c: New test. * gcc.target/arm/mve/general-c/type_redef_15.c: New test. * gcc.target/arm/mve/general-c/type_redef_16.c: New test. * gcc.target/arm/mve/general-c/type_redef_17.c: New test. * gcc.target/arm/mve/general-c/type_redef_18.c: New test. * gcc.target/arm/mve/general-c/type_redef_19.c: New test. * gcc.target/arm/mve/general-c/type_redef_2.c: New test. * gcc.target/arm/mve/general-c/type_redef_20.c: New test. * gcc.target/arm/mve/general-c/type_redef_21.c: New test. * gcc.target/arm/mve/general-c/type_redef_22.c: New test. * gcc.target/arm/mve/general-c/type_redef_23.c: New test. * gcc.target/arm/mve/general-c/type_redef_24.c: New test. * gcc.target/arm/mve/general-c/type_redef_25.c: New test. * gcc.target/arm/mve/general-c/type_redef_26.c: New test. * gcc.target/arm/mve/general-c/type_redef_27.c: New test. * gcc.target/arm/mve/general-c/type_redef_28.c: New test. * gcc.target/arm/mve/general-c/type_redef_29.c: New test. * gcc.target/arm/mve/general-c/type_redef_3.c: New test. * gcc.target/arm/mve/general-c/type_redef_30.c: New test. * gcc.target/arm/mve/general-c/type_redef_31.c: New test. * gcc.target/arm/mve/general-c/type_redef_4.c: New test. * gcc.target/arm/mve/general-c/type_redef_5.c: New test. * gcc.target/arm/mve/general-c/type_redef_6.c: New test. * gcc.target/arm/mve/general-c/type_redef_7.c: New test. * gcc.target/arm/mve/general-c/type_redef_8.c: New test. * gcc.target/arm/mve/general-c/type_redef_9.c: New test. * gcc.target/arm/mve/general/double_pragmas_1.c: New test. * gcc.target/arm/mve/general/nomve_1.c: New test. diff --git a/gcc/config.gcc b/gcc/config.gcc index 3675e063a5365ff84854eb5c2c27921216494c69..50d3401e3aa94f077d7e0675ee443a94431dba1e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -352,7 +352,7 @@ arc*-*-*) ;; arm*-*-*) cpu_type=arm - extra_objs="arm-builtins.o aarch-common.o" + extra_objs="arm-builtins.o arm-mve-builtins.o aarch-common.o" extra_headers="mmintrin.h arm_neon.h arm_acle.h arm_fp16.h arm_cmse.h arm_bf16.h arm_mve_types.h arm_mve.h arm_cde.h" target_type_format_char='%' c_target_objs="arm-c.o" diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index cc7901bca8dc9c5c27ed6afc5bc26afd42689e6d..d1414f6e0e1c2bd0a7364b837c16adf493221376 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -28,6 +28,7 @@ #include "c-family/c-pragma.h" #include "stringpool.h" #include "arm-builtins.h" +#include "arm-protos.h" tree arm_resolve_cde_builtin (location_t loc, tree fndecl, void *arglist) @@ -129,6 +130,24 @@ arm_resolve_cde_builtin (location_t loc, tree fndecl, void *arglist) return call_expr; } +/* Implement "#pragma GCC arm". */ +static void +arm_pragma_arm (cpp_reader *) +{ + tree x; + if (pragma_lex (&x) != CPP_STRING) + { + error ("%<#pragma GCC arm%> requires a string parameter"); + return; + } + + const char *name = TREE_STRING_POINTER (x); + if (strcmp (name, "arm_mve_types.h") == 0) + arm_mve::handle_arm_mve_types_h (); + else + error ("unknown %<#pragma GCC arm%> option %qs", name); +} + /* Implement TARGET_RESOLVE_OVERLOADED_BUILTIN. This is currently only used for the MVE related builtins for the CDE extension. Here we ensure the type of arguments is such that the size is correct, and @@ -476,6 +495,8 @@ arm_register_target_pragmas (void) targetm.target_option.pragma_parse = arm_pragma_target_parse; targetm.resolve_overloaded_builtin = arm_resolve_overloaded_builtin; + c_register_pragma ("GCC", "arm", arm_pragma_arm); + #ifdef REGISTER_SUBTARGET_PRAGMAS REGISTER_SUBTARGET_PRAGMAS (); #endif diff --git a/gcc/config/arm/arm-mve-builtins.cc b/gcc/config/arm/arm-mve-builtins.cc new file mode 100644 index 0000000000000000000000000000000000000000..8030a4c0d0437bf98f00d06f9dcdbde81ae73074 --- /dev/null +++ b/gcc/config/arm/arm-mve-builtins.cc @@ -0,0 +1,192 @@ +/* ACLE support for Arm MVE + Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#define IN_TARGET_CODE 1 + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "fold-const.h" +#include "langhooks.h" +#include "stringpool.h" +#include "attribs.h" +#include "diagnostic.h" +#include "arm-protos.h" +#include "arm-builtins.h" +#include "arm-mve-builtins.h" + +namespace arm_mve { + +/* Static information about each single-predicate or single-vector + ACLE type. */ +struct vector_type_info +{ + /* The name of the type as declared by arm_mve.h. */ + const char *acle_name; + + /* Whether the type requires a floating point abi. */ + const bool requires_float; +}; + +/* Flag indicating whether the arm MVE types have been handled. */ +static bool handle_arm_mve_types_p = false; + +/* Information about each single-predicate or single-vector type. */ +static CONSTEXPR const vector_type_info vector_types[] = { +#define DEF_MVE_TYPE(ACLE_NAME, SCALAR_TYPE) \ + { #ACLE_NAME, REQUIRES_FLOAT }, +#include "arm-mve-builtins.def" +#undef DEF_MVE_TYPE +}; + +/* The scalar type associated with each vector type. */ +GTY(()) tree scalar_types[NUM_VECTOR_TYPES]; + +/* The single-predicate and single-vector types, with their built-in + "__simd128_..._t" name. Allow an index of NUM_VECTOR_TYPES, which always + yields a null tree. */ +static GTY(()) tree abi_vector_types[NUM_VECTOR_TYPES + 1]; + +/* Same, but with the arm_mve.h names. */ +GTY(()) tree acle_vector_types[3][NUM_VECTOR_TYPES + 1]; + +/* Return the MVE abi type with element of type TYPE. */ +static tree +arm_mve_type_for_scalar_type (tree eltype) +{ + for (unsigned int i = 0; i < __TYPE_FINAL; ++i) + if (arm_simd_types[i].eltype == eltype + && GET_MODE_SIZE (arm_simd_types[i].mode) == 16) + return arm_simd_types[i].itype; + + gcc_unreachable (); +} + +/* Register the built-in MVE ABI vector types, such as uint32x4_t. */ +static void +register_builtin_types () +{ +#define DEF_MVE_TYPE(ACLE_NAME, SCALAR_TYPE) \ + scalar_types[VECTOR_TYPE_ ## ACLE_NAME] = SCALAR_TYPE; +#include "arm-mve-builtins.def" +#undef DEF_MVE_TYPE + for (unsigned int i = 0; i < NUM_VECTOR_TYPES; ++i) + { + if (vector_types[i].requires_float && !TARGET_HAVE_MVE_FLOAT) + continue; + tree eltype = scalar_types[i]; + tree vectype; + if (eltype == boolean_type_node) + { + vectype = get_typenode_from_name (UINT16_TYPE); + gcc_assert (GET_MODE_SIZE (TYPE_MODE (vectype)) == 2); + } + else + { + vectype = arm_mve_type_for_scalar_type (eltype); + gcc_assert (VECTOR_MODE_P (TYPE_MODE (vectype)) + && GET_MODE_SIZE (TYPE_MODE (vectype)) == 16); + } + abi_vector_types[i] = vectype; + } +} + +/* Register vector type TYPE under its arm_mve.h name. */ +static void +register_vector_type (vector_type_index type) +{ + if (vector_types[type].requires_float && !TARGET_HAVE_MVE_FLOAT) + return; + tree vectype = abi_vector_types[type]; + tree id = get_identifier (vector_types[type].acle_name); + tree decl = build_decl (input_location, TYPE_DECL, id, vectype); + decl = lang_hooks.decls.pushdecl (decl); + + /* Record the new ACLE type if pushdecl succeeded without error. Use + the ABI type otherwise, so that the type we record at least has the + right form, even if it doesn't have the right name. This should give + better error recovery behavior than installing error_mark_node or + installing an incorrect type. */ + if (decl + && TREE_CODE (decl) == TYPE_DECL + && TREE_TYPE (decl) != error_mark_node + && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == vectype) + vectype = TREE_TYPE (decl); + acle_vector_types[0][type] = vectype; +} + +/* Register tuple type TYPE with NUM_VECTORS arity under its + arm_mve_types.h name. */ +static void +register_builtin_tuple_types (vector_type_index type) +{ + const vector_type_info* info = &vector_types[type]; + if (scalar_types[type] == boolean_type_node + || (info->requires_float && !TARGET_HAVE_MVE_FLOAT)) + return; + const char *vector_type_name = info->acle_name; + char buffer[sizeof ("float32x4x2_t")]; + for (unsigned int num_vectors = 2; num_vectors <= 4; num_vectors += 2) + { + snprintf (buffer, sizeof (buffer), "%.*sx%d_t", + (int) strlen (vector_type_name) - 2, vector_type_name, + num_vectors); + + tree vectype = acle_vector_types[0][type]; + tree arrtype = build_array_type_nelts (vectype, num_vectors); + gcc_assert (TYPE_MODE_RAW (arrtype) == TYPE_MODE (arrtype)); + tree field = build_decl (input_location, FIELD_DECL, + get_identifier ("val"), arrtype); + + tree t = lang_hooks.types.simulate_record_decl (input_location, buffer, + make_array_slice (&field, + 1)); + gcc_assert (TYPE_MODE_RAW (t) == TYPE_MODE (t)); + acle_vector_types[num_vectors >> 1][type] = TREE_TYPE (t); + } +} + +/* Implement #pragma GCC arm "arm_mve_types.h". */ +void +handle_arm_mve_types_h () +{ + if (handle_arm_mve_types_p) + { + error ("duplicate definition of %qs", "arm_mve_types.h"); + return; + } + handle_arm_mve_types_p = true; + if (!TARGET_HAVE_MVE) + { + error ("this definition requires the MVE ISA extension"); + return; + } + register_builtin_types (); + for (unsigned int type_i = 0; type_i < NUM_VECTOR_TYPES; ++type_i) + { + vector_type_index type = vector_type_index (type_i); + register_vector_type (type); + if (type_i != VECTOR_TYPE_mve_pred16_t) + register_builtin_tuple_types (type); + } +} + +} diff --git a/gcc/config/arm/arm-mve-builtins.def b/gcc/config/arm/arm-mve-builtins.def new file mode 100644 index 0000000000000000000000000000000000000000..02a46bec3e4cba6add9bce4021c732e15aa8b012 --- /dev/null +++ b/gcc/config/arm/arm-mve-builtins.def @@ -0,0 +1,41 @@ +/* Builtin lists for Arm MVE + Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef DEF_MVE_TYPE +#define DEF_MVE_TYPE(A, B) +#endif + +#define REQUIRES_FLOAT false +DEF_MVE_TYPE (mve_pred16_t, boolean_type_node) +DEF_MVE_TYPE (uint8x16_t, unsigned_intQI_type_node) +DEF_MVE_TYPE (uint16x8_t, unsigned_intHI_type_node) +DEF_MVE_TYPE (uint32x4_t, unsigned_intSI_type_node) +DEF_MVE_TYPE (uint64x2_t, unsigned_intDI_type_node) +DEF_MVE_TYPE (int8x16_t, intQI_type_node) +DEF_MVE_TYPE (int16x8_t, intHI_type_node) +DEF_MVE_TYPE (int32x4_t, intSI_type_node) +DEF_MVE_TYPE (int64x2_t, intDI_type_node) +#undef REQUIRES_FLOAT + +#define REQUIRES_FLOAT true +DEF_MVE_TYPE (float16x8_t, arm_fp16_type_node) +DEF_MVE_TYPE (float32x4_t, float_type_node) +#undef REQUIRES_FLOAT + +#undef DEF_MVE_TYPE diff --git a/gcc/config/arm/arm-mve-builtins.h b/gcc/config/arm/arm-mve-builtins.h new file mode 100644 index 0000000000000000000000000000000000000000..f64b81331c323fbde0aadb0107dfdc5f7a4c1e53 --- /dev/null +++ b/gcc/config/arm/arm-mve-builtins.h @@ -0,0 +1,34 @@ +/* ACLE support for Arm MVE + Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef GCC_ARM_MVE_BUILTINS_H +#define GCC_ARM_MVE_BUILTINS_H + +/* Enumerates the MVE predicate and (data) vector types, together called + "vector types" for brevity. */ +enum vector_type_index +{ +#define DEF_MVE_TYPE(ACLE_NAME, SCALAR_TYPE) \ + VECTOR_TYPE_ ## ACLE_NAME, +#include "arm-mve-builtins.def" + NUM_VECTOR_TYPES +}; +#undef DEF_MVE_TYPE + +#endif /* GCC_ARM_MVE_BUILTINS_H */ diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 9b1f61394ad7d778a6c0b84bc6c805f14709f598..c91cb5ad69b9d911c31e6018a2ca6bf2ac6239d3 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -204,6 +204,11 @@ extern int arm_apply_result_size (void); #endif /* RTX_CODE */ +/* MVE functions. */ +namespace arm_mve { + void handle_arm_mve_types_h (); +} + /* Thumb functions. */ extern void arm_init_expanders (void); extern const char *thumb1_unexpanded_epilogue (void); diff --git a/gcc/config/arm/arm_mve_types.h b/gcc/config/arm/arm_mve_types.h index 8958f4efdb9952602887bfcb186db6e8364d6351..7fbc89b5982ea73de973dfc25774a8f67ca8bf48 100644 --- a/gcc/config/arm/arm_mve_types.h +++ b/gcc/config/arm/arm_mve_types.h @@ -25,37 +25,9 @@ #if (__ARM_FEATURE_MVE & 2) /* MVE Floating point. */ typedef __fp16 float16_t; typedef float float32_t; -typedef __simd128_float16_t float16x8_t; -typedef __simd128_float32_t float32x4_t; - -typedef struct { float16x8_t val[2]; } float16x8x2_t; -typedef struct { float16x8_t val[4]; } float16x8x4_t; -typedef struct { float32x4_t val[2]; } float32x4x2_t; -typedef struct { float32x4_t val[4]; } float32x4x4_t; #endif -typedef uint16_t mve_pred16_t; -typedef __simd128_uint8_t uint8x16_t; -typedef __simd128_uint16_t uint16x8_t; -typedef __simd128_uint32_t uint32x4_t; -typedef __simd128_uint64_t uint64x2_t; -typedef __simd128_int8_t int8x16_t; -typedef __simd128_int16_t int16x8_t; -typedef __simd128_int32_t int32x4_t; -typedef __simd128_int64_t int64x2_t; - -typedef struct { int16x8_t val[2]; } int16x8x2_t; -typedef struct { int16x8_t val[4]; } int16x8x4_t; -typedef struct { int32x4_t val[2]; } int32x4x2_t; -typedef struct { int32x4_t val[4]; } int32x4x4_t; -typedef struct { int8x16_t val[2]; } int8x16x2_t; -typedef struct { int8x16_t val[4]; } int8x16x4_t; -typedef struct { uint16x8_t val[2]; } uint16x8x2_t; -typedef struct { uint16x8_t val[4]; } uint16x8x4_t; -typedef struct { uint32x4_t val[2]; } uint32x4x2_t; -typedef struct { uint32x4_t val[4]; } uint32x4x4_t; -typedef struct { uint8x16_t val[2]; } uint8x16x2_t; -typedef struct { uint8x16_t val[4]; } uint8x16x4_t; +#pragma GCC arm "arm_mve_types.h" __extension__ extern __inline int16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm index 5f69ee6451efb8709fe9b455a45c2e634e009170..f655f369724ca711f0a389abaf0e70adb3ab4b7c 100644 --- a/gcc/config/arm/t-arm +++ b/gcc/config/arm/t-arm @@ -153,6 +153,16 @@ arm-builtins.o: $(srcdir)/config/arm/arm-builtins.c $(CONFIG_H) \ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/arm/arm-builtins.c +arm-mve-builtins.o: $(srcdir)/config/arm/arm-mve-builtins.cc $(CONFIG_H) \ + $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + fold-const.h langhooks.h stringpool.h attribs.h diagnostic.h \ + $(srcdir)/config/arm/arm-protos.h \ + $(srcdir)/config/arm/arm-builtins.h \ + $(srcdir)/config/arm/arm-mve-builtins.h \ + $(srcdir)/config/arm/arm-mve-builtins.def + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/arm/arm-mve-builtins.cc + arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_1.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_1.c new file mode 100644 index 0000000000000000000000000000000000000000..0db2b91dc4fe064bffa63a8cf466cd1ec2662db6 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_1.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int mve_pred16_t; /* { dg-message "note: previous declaration of 'mve_pred16_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'mve_pred16_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_10.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_10.c new file mode 100644 index 0000000000000000000000000000000000000000..15393a000a23e6d22a03290996270e939610dbc5 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_10.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ + +int float16x8_t; /* { dg-message "note: previous declaration of 'float16x8_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'float16x8_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_11.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_11.c new file mode 100644 index 0000000000000000000000000000000000000000..dd0b2bbc0a828734d149f5b21891477ef7779462 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_11.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ + +int float32x4_t; /* { dg-message "note: previous declaration of 'float32x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'float32x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_12.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_12.c new file mode 100644 index 0000000000000000000000000000000000000000..ff9b06965a463d33d28b235c37d9c999bdc28872 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_12.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint8x16x2_t; /* { dg-message "note: previous declaration of 'uint8x16x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint8x16x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_13.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_13.c new file mode 100644 index 0000000000000000000000000000000000000000..1881555dab1d7c848becd344e84208fb8f876223 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_13.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint8x16x4_t; /* { dg-message "note: previous declaration of 'uint8x16x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint8x16x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_14.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_14.c new file mode 100644 index 0000000000000000000000000000000000000000..ea92afc5861c9cc67f4c99d48c50e2eae7d87fab --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_14.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint16x8x2_t; /* { dg-message "note: previous declaration of 'uint16x8x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint16x8x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_15.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_15.c new file mode 100644 index 0000000000000000000000000000000000000000..f62271c0b75c980dc53e9d831e4e15523f927874 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_15.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint16x8x4_t; /* { dg-message "note: previous declaration of 'uint16x8x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint16x8x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_16.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_16.c new file mode 100644 index 0000000000000000000000000000000000000000..dcd6465aad664b48cc70746c627fa54438cd41d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_16.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint32x4x2_t; /* { dg-message "note: previous declaration of 'uint32x4x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint32x4x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_17.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_17.c new file mode 100644 index 0000000000000000000000000000000000000000..fbbb839361741cf9ea1255e22e9d9a815bc66b7c --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_17.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint32x4x4_t; /* { dg-message "note: previous declaration of 'uint32x4x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint32x4x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_18.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_18.c new file mode 100644 index 0000000000000000000000000000000000000000..acaa48cd28d6c796de91a81251f3a034ea72d9ae --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_18.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint64x2x2_t; /* { dg-message "note: previous declaration of 'uint64x2x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint64x2x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_19.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_19.c new file mode 100644 index 0000000000000000000000000000000000000000..95bbc98b6dc99e465059c40ef19f2865ee1233b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_19.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint64x2x4_t; /* { dg-message "note: previous declaration of 'uint64x2x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint64x2x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_2.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_2.c new file mode 100644 index 0000000000000000000000000000000000000000..2ff563183b9126a1d1fd1b608c8e565956765f01 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_2.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint8x16_t; /* { dg-message "note: previous declaration of 'uint8x16_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint8x16_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_20.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_20.c new file mode 100644 index 0000000000000000000000000000000000000000..3f5efcff002c29d5024b1ee8da68b7785dab8968 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_20.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int8x16x2_t; /* { dg-message "note: previous declaration of 'int8x16x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int8x16x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_21.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_21.c new file mode 100644 index 0000000000000000000000000000000000000000..8d9df51c4b51494165b976ccd78067fc4a9386e5 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_21.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int8x16x4_t; /* { dg-message "note: previous declaration of 'int8x16x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int8x16x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_22.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_22.c new file mode 100644 index 0000000000000000000000000000000000000000..1a414f656021297a39586c0b4f28314ab163d8ad --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_22.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int16x8x2_t; /* { dg-message "note: previous declaration of 'int16x8x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int16x8x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_23.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_23.c new file mode 100644 index 0000000000000000000000000000000000000000..081ef66390f8c122694fe0bce589ed8c1884af03 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_23.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int16x8x4_t; /* { dg-message "note: previous declaration of 'int16x8x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int16x8x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_24.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_24.c new file mode 100644 index 0000000000000000000000000000000000000000..96d385689dcc49ccbaba57aa73af01df2c60dd57 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_24.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int32x4x2_t; /* { dg-message "note: previous declaration of 'int32x4x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int32x4x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_25.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_25.c new file mode 100644 index 0000000000000000000000000000000000000000..21731f46ef31503fb17ddc3494064514afd532b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_25.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int32x4x4_t; /* { dg-message "note: previous declaration of 'int32x4x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int32x4x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_26.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_26.c new file mode 100644 index 0000000000000000000000000000000000000000..6ad078c5812c0c938890aa4cc0ad30304b670b42 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_26.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int64x2x2_t; /* { dg-message "note: previous declaration of 'int64x2x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int64x2x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_27.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_27.c new file mode 100644 index 0000000000000000000000000000000000000000..017a265c56298504adac75d71a8984d5f2b6564f --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_27.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int64x2x4_t; /* { dg-message "note: previous declaration of 'int64x2x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int64x2x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_28.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_28.c new file mode 100644 index 0000000000000000000000000000000000000000..7543c84434e124a6c153d39931e4c5930bcec1a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_28.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ + +int float16x8x2_t; /* { dg-message "note: previous declaration of 'float16x8x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'float16x8x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_29.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_29.c new file mode 100644 index 0000000000000000000000000000000000000000..aefd329ad44288e3c63fce60e9f477bd29cb25f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_29.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ + +int float16x8x4_t; /* { dg-message "note: previous declaration of 'float16x8x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'float16x8x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_3.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_3.c new file mode 100644 index 0000000000000000000000000000000000000000..cef5a04a04a65d8537ccd1bf6162b3c837d347ee --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_3.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint16x8_t; /* { dg-message "note: previous declaration of 'uint16x8_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint16x8_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_30.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_30.c new file mode 100644 index 0000000000000000000000000000000000000000..04ab03c55bd8ebf642b1e66d3018f71d576c1252 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_30.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ + +int float32x4x2_t; /* { dg-message "note: previous declaration of 'float32x4x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'float32x4x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_31.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_31.c new file mode 100644 index 0000000000000000000000000000000000000000..10bfcc99f3c448e7c1aab8a5bd6d2bd8b8947fd7 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_31.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ + +int float32x4x4_t; /* { dg-message "note: previous declaration of 'float32x4x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'float32x4x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_4.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_4.c new file mode 100644 index 0000000000000000000000000000000000000000..0fb15bd42b7e0ead037236de24562cf41a1a82e6 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_4.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint32x4_t; /* { dg-message "note: previous declaration of 'uint32x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint32x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_5.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_5.c new file mode 100644 index 0000000000000000000000000000000000000000..0b2b3aafa0c53b032a06e8ed9e36d9ed437348ba --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_5.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int uint64x2_t; /* { dg-message "note: previous declaration of 'uint64x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'uint64x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_6.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_6.c new file mode 100644 index 0000000000000000000000000000000000000000..afcc8c06b6fcc87c2bdfb91af7a0550171afd5d6 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_6.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int8x16_t; /* { dg-message "note: previous declaration of 'int8x16_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int8x16_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_7.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_7.c new file mode 100644 index 0000000000000000000000000000000000000000..d8c45ebc5490ac2747edc1418c569aaa86faf169 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_7.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int16x8_t; /* { dg-message "note: previous declaration of 'int16x8_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int16x8_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_8.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_8.c new file mode 100644 index 0000000000000000000000000000000000000000..1b8ed4c81df007e841a02536fe12665cfbfe2863 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_8.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int32x4_t; /* { dg-message "note: previous declaration of 'int32x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int32x4_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_9.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_9.c new file mode 100644 index 0000000000000000000000000000000000000000..03543c89ba58a5cdcb6ef359727e32f0b68cd1b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_9.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +int int64x2_t; /* { dg-message "note: previous declaration of 'int64x2_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'int64x2_t' redeclared} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general/double_pragmas_1.c b/gcc/testsuite/gcc.target/arm/mve/general/double_pragmas_1.c new file mode 100644 index 0000000000000000000000000000000000000000..58466db6940d3f272ca6f90ea697a4b35440bbe6 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general/double_pragmas_1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +/* It doesn't really matter if this produces errors about redefinitions, + but it mustn't trigger an ICE. */ +#pragma GCC arm "arm_mve_types.h" +#pragma GCC arm "arm_mve_types.h" /* { dg-error "duplicate definition of 'arm_mve_types.h'" } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general/nomve_1.c b/gcc/testsuite/gcc.target/arm/mve/general/nomve_1.c new file mode 100644 index 0000000000000000000000000000000000000000..cdfb974b7a23c70b2beb9138a75ea88cc39eca5d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general/nomve_1.c @@ -0,0 +1,3 @@ +/* { dg-options "-mfloat-abi=soft" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {this definition requires the MVE ISA extension} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/mve.exp b/gcc/testsuite/gcc.target/arm/mve/mve.exp index a858e52d9208b6e2bbd3c2175ed45724871598e2..7cea03d6befc9a7080acb58b0245af576a19e61c 100644 --- a/gcc/testsuite/gcc.target/arm/mve/mve.exp +++ b/gcc/testsuite/gcc.target/arm/mve/mve.exp @@ -44,6 +44,12 @@ dg-init dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/intrinsics/*.\[cCS\]]] \ "" $DEFAULT_CFLAGS +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/general/*.\[cCS\]]] \ + "" $DEFAULT_CFLAGS + +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/general-c/*.\[cCS\]]] \ + "" $DEFAULT_CFLAGS + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ "" $DEFAULT_CFLAGS