public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-858] IBM Z: Support vector _Bool language extension
@ 2021-05-18  6:56 Andreas Krebbel
  0 siblings, 0 replies; only message in thread
From: Andreas Krebbel @ 2021-05-18  6:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7e75d62442fc3707c96c53d22f6c185fdf893c72

commit r12-858-g7e75d62442fc3707c96c53d22f6c185fdf893c72
Author: Andreas Krebbel <krebbel@linux.ibm.com>
Date:   Tue May 18 08:51:08 2021 +0200

    IBM Z: Support vector _Bool language extension
    
    _Bool needs to be defined as macro in order to trigger the
    context-sensitive macro expansion mechanism.
    
    gcc/ChangeLog:
    
            * config/s390/s390-c.c (s390_cpu_cpp_builtins_internal): Define
            _Bool as macro expanding to _Bool.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/s390/zvector/vec-_Bool.c: New test.

Diff:
---
 gcc/config/s390/s390-c.c                          | 2 ++
 gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/gcc/config/s390/s390-c.c b/gcc/config/s390/s390-c.c
index 7dbd8bf5da3..4cce2619ce4 100644
--- a/gcc/config/s390/s390-c.c
+++ b/gcc/config/s390/s390-c.c
@@ -367,6 +367,8 @@ s390_cpu_cpp_builtins_internal (cpp_reader *pfile,
 			       old_opts, opts, "vector=vector", "vector");
       s390_def_or_undef_macro (pfile, target_flag_set_p (MASK_ZVECTOR),
 			       old_opts, opts, "bool=bool", "bool");
+      s390_def_or_undef_macro (pfile, target_flag_set_p (MASK_ZVECTOR),
+			       old_opts, opts, "_Bool=_Bool", "_Bool");
       if (TARGET_ZVECTOR_P (opts->x_target_flags) && __vector_keyword == NULL)
 	{
 	  __vector_keyword = get_identifier ("__vector");
diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c b/gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c
new file mode 100644
index 00000000000..525b950253c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/zvector/vec-_Bool.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-march=z13 -mzvector" } */
+
+vector _Bool char bc;
+vector _Bool short int bs;
+vector _Bool int bi;
+vector _Bool long long bll;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-18  6:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  6:56 [gcc r12-858] IBM Z: Support vector _Bool language extension Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).