| 1 |
/* Declarations for determining resolver for a given builtin. |
| 2 |
Copyright (C) 2020-2025 Free Software Foundation, Inc. |
| 3 |
|
| 4 |
This file is part of GCC. |
| 5 |
|
| 6 |
GCC is free software; you can redistribute it and/or modify it |
| 7 |
under the terms of the GNU General Public License as published |
| 8 |
by the Free Software Foundation; either version 3, or (at your |
| 9 |
option) any later version. |
| 10 |
|
| 11 |
GCC is distributed in the hope that it will be useful, but WITHOUT |
| 12 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 13 |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public |
| 14 |
License for more details. |
| 15 |
|
| 16 |
Under Section 7 of GPL version 3, you are granted additional |
| 17 |
permissions described in the GCC Runtime Library Exception, version |
| 18 |
3.1, as published by the Free Software Foundation. |
| 19 |
|
| 20 |
You should have received a copy of the GNU General Public License and |
| 21 |
a copy of the GCC Runtime Library Exception along with this program; |
| 22 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 23 |
<http://www.gnu.org/licenses/>. */ |
| 24 |
|
| 25 |
#ifndef GCC_ARM_BUILTINS_H |
| 26 |
#define GCC_ARM_BUILTINS_H |
| 27 |
|
| 28 |
enum resolver_ident { |
| 29 |
arm_cde_resolver, |
| 30 |
arm_mve_resolver, |
| 31 |
arm_no_resolver |
| 32 |
}; |
| 33 |
enum resolver_ident arm_describe_resolver (tree); |
| 34 |
unsigned arm_cde_end_args (tree); |
| 35 |
gimple *arm_general_gimple_fold_builtin (unsigned int, gcall *); |
| 36 |
|
| 37 |
#define ENTRY(E, M, Q, S, T, G) E, |
| 38 |
enum arm_simd_type |
| 39 |
{ |
| 40 |
#include "arm-simd-builtin-types.def" |
| 41 |
__TYPE_FINAL |
| 42 |
}; |
| 43 |
#undef ENTRY |
| 44 |
|
| 45 |
enum arm_type_qualifiers |
| 46 |
{ |
| 47 |
/* T foo. */ |
| 48 |
qualifier_none = 0x0, |
| 49 |
/* unsigned T foo. */ |
| 50 |
qualifier_unsigned = 0x1, /* 1 << 0 */ |
| 51 |
/* const T foo. */ |
| 52 |
qualifier_const = 0x2, /* 1 << 1 */ |
| 53 |
/* T *foo. */ |
| 54 |
qualifier_pointer = 0x4, /* 1 << 2 */ |
| 55 |
/* const T * foo. */ |
| 56 |
qualifier_const_pointer = 0x6, |
| 57 |
/* Used when expanding arguments if an operand could |
| 58 |
be an immediate. */ |
| 59 |
qualifier_immediate = 0x8, /* 1 << 3 */ |
| 60 |
qualifier_unsigned_immediate = 0x9, |
| 61 |
qualifier_maybe_immediate = 0x10, /* 1 << 4 */ |
| 62 |
/* void foo (...). */ |
| 63 |
qualifier_void = 0x20, /* 1 << 5 */ |
| 64 |
/* Some patterns may have internal operands, this qualifier is an |
| 65 |
instruction to the initialisation code to skip this operand. */ |
| 66 |
qualifier_internal = 0x40, /* 1 << 6 */ |
| 67 |
/* Some builtins should use the T_*mode* encoded in a simd_builtin_datum |
| 68 |
rather than using the type of the operand. */ |
| 69 |
qualifier_map_mode = 0x80, /* 1 << 7 */ |
| 70 |
/* qualifier_pointer | qualifier_map_mode */ |
| 71 |
qualifier_pointer_map_mode = 0x84, |
| 72 |
/* qualifier_const_pointer | qualifier_map_mode */ |
| 73 |
qualifier_const_pointer_map_mode = 0x86, |
| 74 |
/* Polynomial types. */ |
| 75 |
qualifier_poly = 0x100, |
| 76 |
/* Lane indices - must be within range of previous argument = a vector. */ |
| 77 |
qualifier_lane_index = 0x200, |
| 78 |
/* Lane indices for single lane structure loads and stores. */ |
| 79 |
qualifier_struct_load_store_lane_index = 0x400, |
| 80 |
/* A void pointer. */ |
| 81 |
qualifier_void_pointer = 0x800, |
| 82 |
/* A const void pointer. */ |
| 83 |
qualifier_const_void_pointer = 0x802, |
| 84 |
/* Lane indices selected in pairs - must be within range of previous |
| 85 |
argument = a vector. */ |
| 86 |
qualifier_lane_pair_index = 0x1000, |
| 87 |
/* Lane indices selected in quadtuplets - must be within range of previous |
| 88 |
argument = a vector. */ |
| 89 |
qualifier_lane_quadtup_index = 0x2000, |
| 90 |
/* MVE vector predicates. */ |
| 91 |
qualifier_predicate = 0x4000 |
| 92 |
}; |
| 93 |
|
| 94 |
struct arm_simd_type_info |
| 95 |
{ |
| 96 |
enum arm_simd_type type; |
| 97 |
|
| 98 |
/* Internal type name. */ |
| 99 |
const char *name; |
| 100 |
|
| 101 |
/* Internal type name(mangled). The mangled names conform to the |
| 102 |
AAPCS (see "Procedure Call Standard for the ARM Architecture", |
| 103 |
Appendix A). To qualify for emission with the mangled names defined in |
| 104 |
that document, a vector type must not only be of the correct mode but also |
| 105 |
be of the correct internal Neon vector type (e.g. __simd64_int8_t); |
| 106 |
these types are registered by arm_init_simd_builtin_types (). In other |
| 107 |
words, vector types defined in other ways e.g. via vector_size attribute |
| 108 |
will get default mangled names. */ |
| 109 |
const char *mangle; |
| 110 |
|
| 111 |
/* Internal type. */ |
| 112 |
tree itype; |
| 113 |
|
| 114 |
/* Element type. */ |
| 115 |
tree eltype; |
| 116 |
|
| 117 |
/* Machine mode the internal type maps to. */ |
| 118 |
machine_mode mode; |
| 119 |
|
| 120 |
/* Qualifiers. */ |
| 121 |
enum arm_type_qualifiers q; |
| 122 |
}; |
| 123 |
|
| 124 |
extern struct arm_simd_type_info arm_simd_types[]; |
| 125 |
|
| 126 |
#endif /* GCC_ARM_BUILTINS_H */ |