| 1 |
/* Builtins' description for AArch64 SIMD architecture. |
| 2 |
Copyright (C) 2023-2025 Free Software Foundation, Inc. |
| 3 |
This file is part of GCC. |
| 4 |
|
| 5 |
GCC is free software; you can redistribute it and/or modify it |
| 6 |
under the terms of the GNU General Public License as published by |
| 7 |
the Free Software Foundation; either version 3, or (at your option) |
| 8 |
any later version. |
| 9 |
|
| 10 |
GCC is distributed in the hope that it will be useful, but |
| 11 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public License |
| 16 |
along with GCC; see the file COPYING3. If not see |
| 17 |
<http://www.gnu.org/licenses/>. */ |
| 18 |
#ifndef GCC_AARCH64_BUILTINS_H |
| 19 |
#define GCC_AARCH64_BUILTINS_H |
| 20 |
|
| 21 |
enum aarch64_type_qualifiers |
| 22 |
{ |
| 23 |
/* T foo. */ |
| 24 |
qualifier_none = 0x0, |
| 25 |
/* unsigned T foo. */ |
| 26 |
qualifier_unsigned = 0x1, /* 1 << 0 */ |
| 27 |
/* const T foo. */ |
| 28 |
qualifier_const = 0x2, /* 1 << 1 */ |
| 29 |
/* T *foo. */ |
| 30 |
qualifier_pointer = 0x4, /* 1 << 2 */ |
| 31 |
/* const T *foo. */ |
| 32 |
qualifier_const_pointer = 0x6, |
| 33 |
/* Used when expanding arguments if an operand could |
| 34 |
be an immediate. */ |
| 35 |
qualifier_immediate = 0x8, /* 1 << 3 */ |
| 36 |
qualifier_maybe_immediate = 0x10, /* 1 << 4 */ |
| 37 |
/* void foo (...). */ |
| 38 |
qualifier_void = 0x20, /* 1 << 5 */ |
| 39 |
/* 1 << 6 is now unused */ |
| 40 |
/* Some builtins should use the T_*mode* encoded in a simd_builtin_datum |
| 41 |
rather than using the type of the operand. */ |
| 42 |
qualifier_map_mode = 0x80, /* 1 << 7 */ |
| 43 |
/* qualifier_pointer | qualifier_map_mode */ |
| 44 |
qualifier_pointer_map_mode = 0x84, |
| 45 |
/* qualifier_const | qualifier_pointer | qualifier_map_mode */ |
| 46 |
qualifier_const_pointer_map_mode = 0x86, |
| 47 |
/* Polynomial types. */ |
| 48 |
qualifier_poly = 0x100, |
| 49 |
/* Lane indices - must be in range, and flipped for bigendian. */ |
| 50 |
qualifier_lane_index = 0x200, |
| 51 |
/* Lane indices for single lane structure loads and stores. */ |
| 52 |
qualifier_struct_load_store_lane_index = 0x400, |
| 53 |
/* Lane indices selected in pairs. - must be in range, and flipped for |
| 54 |
bigendian. */ |
| 55 |
qualifier_lane_pair_index = 0x800, |
| 56 |
/* Lane indices selected in quadtuplets. - must be in range, and flipped for |
| 57 |
bigendian. */ |
| 58 |
qualifier_lane_quadtup_index = 0x1000, |
| 59 |
/* Modal FP types. */ |
| 60 |
qualifier_modal_float = 0x2000, |
| 61 |
}; |
| 62 |
|
| 63 |
#define ENTRY(E, M, Q, G) E, |
| 64 |
enum aarch64_simd_type |
| 65 |
{ |
| 66 |
#include "aarch64-simd-builtin-types.def" |
| 67 |
ARM_NEON_H_TYPES_LAST |
| 68 |
}; |
| 69 |
#undef ENTRY |
| 70 |
|
| 71 |
struct aarch64_simd_type_info |
| 72 |
{ |
| 73 |
enum aarch64_simd_type type; |
| 74 |
|
| 75 |
/* Internal type name. */ |
| 76 |
const char *name; |
| 77 |
|
| 78 |
/* Internal type name(mangled). The mangled names conform to the |
| 79 |
AAPCS64 (see "Procedure Call Standard for the ARM 64-bit Architecture", |
| 80 |
Appendix A). To qualify for emission with the mangled names defined in |
| 81 |
that document, a vector type must not only be of the correct mode but also |
| 82 |
be of the correct internal AdvSIMD vector type (e.g. __Int8x8_t); these |
| 83 |
types are registered by aarch64_init_simd_builtin_types (). In other |
| 84 |
words, vector types defined in other ways e.g. via vector_size attribute |
| 85 |
will get default mangled names. */ |
| 86 |
const char *mangle; |
| 87 |
|
| 88 |
/* Machine mode the internal type maps to. */ |
| 89 |
enum machine_mode mode; |
| 90 |
|
| 91 |
/* Qualifiers. */ |
| 92 |
enum aarch64_type_qualifiers q; |
| 93 |
}; |
| 94 |
|
| 95 |
/* This is in a different structure than aarch64_simd_type_info because we do |
| 96 |
not want to reset the static members of aarch64_simd_type_info to their |
| 97 |
default value. We only want the tree types to be GC-ed. |
| 98 |
This is necessary for libgccjit which can run multiple times in the same |
| 99 |
process. If the static values were GC-ed, the second run would ICE/segfault |
| 100 |
because of their invalid value. |
| 101 |
*/ |
| 102 |
struct GTY(()) aarch64_simd_type_info_trees |
| 103 |
{ |
| 104 |
/* Internal type. */ |
| 105 |
tree itype; |
| 106 |
|
| 107 |
/* Element type. */ |
| 108 |
tree eltype; |
| 109 |
}; |
| 110 |
|
| 111 |
extern const aarch64_simd_type_info aarch64_simd_types[]; |
| 112 |
extern aarch64_simd_type_info_trees aarch64_simd_types_trees[]; |
| 113 |
|
| 114 |
#endif |