aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/s390
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2025-01-20 10:01:08 +0100
committerStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>2025-01-20 10:01:08 +0100
commit13efa59ce66516937fd5e0608d2aa3aab46c5d76 (patch)
tree05d7a0a08c960124af8c46e6cba93861cf398767 /gcc/config/s390
parenta8192b59175e2cfcf665573d8168a8be09bdfa51 (diff)
downloadgcc-13efa59ce66516937fd5e0608d2aa3aab46c5d76.zip
gcc-13efa59ce66516937fd5e0608d2aa3aab46c5d76.tar.gz
gcc-13efa59ce66516937fd5e0608d2aa3aab46c5d76.tar.bz2
s390: Bump __VEC__ and add 128-bit integer zvector types
Bump __VEC__ version to 10305 and add 128-bit integer vector types like `vector __int128` et al. to the zvector extension. gcc/ChangeLog: * config/s390/s390-c.cc (rid_int128): New helper function. (s390_macro_to_expand): Deal with `vector __int128`. (s390_cpu_cpp_builtins_internal): Bump __VEC__. * config/s390/s390.cc (s390_handle_vectorbool_attribute): Add 128-bit bool zvector.
Diffstat (limited to 'gcc/config/s390')
-rw-r--r--gcc/config/s390/s390-c.cc21
-rw-r--r--gcc/config/s390/s390.cc3
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/config/s390/s390-c.cc b/gcc/config/s390/s390-c.cc
index bcb55d4..27e18f0 100644
--- a/gcc/config/s390/s390-c.cc
+++ b/gcc/config/s390/s390-c.cc
@@ -174,6 +174,22 @@ s390_categorize_keyword (const cpp_token *tok)
}
+/* Helper function to find out which RID_INT_N_* code is the one for
+ __int128, if any. Returns RID_MAX+1 if none apply, which is safe
+ (for our purposes, since we always expect to have __int128) to
+ compare against. */
+static inline int
+rid_int128 (void)
+{
+ for (int i = 0; i < NUM_INT_N_ENTS; ++i)
+ if (int_n_enabled_p[i]
+ && int_n_data[i].bitsize == 128)
+ return RID_INT_N_0 + i;
+
+ return RID_MAX + 1;
+}
+
+
/* Called to decide whether a conditional macro should be expanded.
Since we have exactly one such macro (i.e, 'vector'), we do not
need to examine the 'tok' parameter. */
@@ -262,7 +278,8 @@ s390_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
|| rid_code == RID_SHORT || rid_code == RID_SIGNED
|| rid_code == RID_INT || rid_code == RID_CHAR
|| (rid_code == RID_FLOAT && TARGET_VXE)
- || rid_code == RID_DOUBLE)
+ || rid_code == RID_DOUBLE
+ || rid_code == rid_int128 ())
{
expand_this = C_CPP_HASHNODE (__vector_keyword);
/* If the next keyword is bool, it will need to be expanded as
@@ -341,7 +358,7 @@ s390_cpu_cpp_builtins_internal (cpp_reader *pfile,
s390_def_or_undef_macro (pfile, target_flag_set_p (MASK_OPT_VX), old_opts,
opts, "__VX__", "__VX__");
s390_def_or_undef_macro (pfile, target_flag_set_p (MASK_ZVECTOR), old_opts,
- opts, "__VEC__=10304", "__VEC__");
+ opts, "__VEC__=10305", "__VEC__");
s390_def_or_undef_macro (pfile, target_flag_set_p (MASK_ZVECTOR), old_opts,
opts, "__vector=__attribute__((vector_size(16)))",
"__vector__");
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 327e44c..f505378 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -1199,6 +1199,9 @@ s390_handle_vectorbool_attribute (tree *node, tree name ATTRIBUTE_UNUSED,
mode = TYPE_MODE (type);
switch (mode)
{
+ case E_TImode: case E_V1TImode:
+ result = s390_builtin_types[BT_BV1TI];
+ break;
case E_DImode: case E_V2DImode:
result = s390_builtin_types[BT_BV2DI];
break;