aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-10-31 19:52:06 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2024-10-31 19:52:06 +0000
commite1b17a0cfd3dfb80303d466cc28684e74db6634a (patch)
treed4229bea201af47770132db0439314e4149d4f71 /gcc
parent94b9ffbdd9a3a2d3c71afb67e0fd6b7ce1d51391 (diff)
downloadgcc-e1b17a0cfd3dfb80303d466cc28684e74db6634a.zip
gcc-e1b17a0cfd3dfb80303d466cc28684e74db6634a.tar.gz
gcc-e1b17a0cfd3dfb80303d466cc28684e74db6634a.tar.bz2
aarch64: Move ENTRY_VHSDF to aarch64-simd-pragma-builtins.def
It's more convenient for later patches if we only define ENTRY_VHSDF once, in the .def file. Then the only macro that needs to be defined before including the file is ENTRY itself. The patch also moves the architecture requirements out of the individual ENTRY invocations into a block-level definition of REQUIRED_EXTENSIONS. This reduces cut-&-paste a little and makes things more consistent with aarch64-sve-builtins*.def. gcc/ * config/aarch64/aarch64-builtins.cc (ENTRY): Remove the features argument and get the features from REQUIRED_EXTENSIONS instead. (ENTRY_VHSDF): Move definition to... * config/aarch64/aarch64-simd-pragma-builtins.def: ...here. Move the architecture requirements to REQUIRED_EXTENSIONS.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/aarch64/aarch64-builtins.cc22
-rw-r--r--gcc/config/aarch64/aarch64-simd-pragma-builtins.def14
2 files changed, 15 insertions, 21 deletions
diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc
index 86d96e4..480ac22 100644
--- a/gcc/config/aarch64/aarch64-builtins.cc
+++ b/gcc/config/aarch64/aarch64-builtins.cc
@@ -780,17 +780,9 @@ typedef struct
AARCH64_SIMD_BUILTIN_##T##_##N##A,
#undef ENTRY
-#define ENTRY(N, S, M, U, F) \
+#define ENTRY(N, S, M, U) \
AARCH64_##N,
-#undef ENTRY_VHSDF
-#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC, EXTENSIONS) \
- AARCH64_##NAME##_f16, \
- AARCH64_##NAME##q_f16, \
- AARCH64_##NAME##_f32, \
- AARCH64_##NAME##q_f32, \
- AARCH64_##NAME##q_f64,
-
enum aarch64_builtins
{
AARCH64_BUILTIN_MIN,
@@ -1602,16 +1594,8 @@ enum class aarch64_builtin_signatures
};
#undef ENTRY
-#define ENTRY(N, S, M, U, F) \
- {#N, aarch64_builtin_signatures::S, E_##M##mode, U, F},
-
-#undef ENTRY_VHSDF
-#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC, EXTENSIONS) \
- ENTRY (NAME##_f16, SIGNATURE, V4HF, UNSPEC, EXTENSIONS) \
- ENTRY (NAME##q_f16, SIGNATURE, V8HF, UNSPEC, EXTENSIONS) \
- ENTRY (NAME##_f32, SIGNATURE, V2SF, UNSPEC, EXTENSIONS) \
- ENTRY (NAME##q_f32, SIGNATURE, V4SF, UNSPEC, EXTENSIONS) \
- ENTRY (NAME##q_f64, SIGNATURE, V2DF, UNSPEC, EXTENSIONS)
+#define ENTRY(N, S, M, U) \
+ {#N, aarch64_builtin_signatures::S, E_##M##mode, U, REQUIRED_EXTENSIONS},
/* Initialize pragma builtins. */
diff --git a/gcc/config/aarch64/aarch64-simd-pragma-builtins.def b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def
index f432185..9d530fc 100644
--- a/gcc/config/aarch64/aarch64-simd-pragma-builtins.def
+++ b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def
@@ -18,6 +18,16 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#undef ENTRY_VHSDF
+#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC) \
+ ENTRY (NAME##_f16, SIGNATURE, V4HF, UNSPEC) \
+ ENTRY (NAME##q_f16, SIGNATURE, V8HF, UNSPEC) \
+ ENTRY (NAME##_f32, SIGNATURE, V2SF, UNSPEC) \
+ ENTRY (NAME##q_f32, SIGNATURE, V4SF, UNSPEC) \
+ ENTRY (NAME##q_f64, SIGNATURE, V2DF, UNSPEC)
+
// faminmax
-ENTRY_VHSDF (vamax, binary, UNSPEC_FAMAX, AARCH64_FL_FAMINMAX)
-ENTRY_VHSDF (vamin, binary, UNSPEC_FAMIN, AARCH64_FL_FAMINMAX)
+#define REQUIRED_EXTENSIONS AARCH64_FL_FAMINMAX
+ENTRY_VHSDF (vamax, binary, UNSPEC_FAMAX)
+ENTRY_VHSDF (vamin, binary, UNSPEC_FAMIN)
+#undef REQUIRED_EXTENSIONS