diff mbox series

[rs6000] xmmintrin.h needs to use __vector __bool everywhere

Message ID 1f4fbc22-a8bf-7eb3-b02c-2d4ccbc6c8f4@linux.vnet.ibm.com
State New
Headers show
Series [rs6000] xmmintrin.h needs to use __vector __bool everywhere | expand

Commit Message

Bill Schmidt March 27, 2018, 9:10 p.m. UTC
Hi,

The xmmintrin.h compatibility header embeds altivec.h to use the Power
vector intrinsics.  However, it needs to be careful not to use the "bool"
keyword with vectors so the headers don't cause potential problems in C++ 
and C11 code when using strict-ANSI.  I noticed a few cases where this was
happening.  They haven't caused trouble yet, but it's just a matter of time.
This patch cleans those up.

Bootstrapped and tested on powerpc64le-unknown-linux-gnu.  Is this okay
for trunk?

Thanks,
Bill


2018-03-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	* config/rs6000/xmmintrin.h (_mm_max_pi16): Use __vector __bool
	instead of __vector bool.
	(_mm_max_pu8): Likewise.
	(_mm_min_pi16): Likewise.

Comments

Segher Boessenkool March 28, 2018, 12:14 a.m. UTC | #1
Hi Bill,

On Tue, Mar 27, 2018 at 04:10:00PM -0500, Bill Schmidt wrote:
> The xmmintrin.h compatibility header embeds altivec.h to use the Power
> vector intrinsics.  However, it needs to be careful not to use the "bool"
> keyword with vectors so the headers don't cause potential problems in C++ 
> and C11 code when using strict-ANSI.  I noticed a few cases where this was
> happening.  They haven't caused trouble yet, but it's just a matter of time.
> This patch cleans those up.
> 
> Bootstrapped and tested on powerpc64le-unknown-linux-gnu.  Is this okay
> for trunk?

Yes please.  Thanks!


Segher


> 2018-03-27  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
> 
> 	* config/rs6000/xmmintrin.h (_mm_max_pi16): Use __vector __bool
> 	instead of __vector bool.
> 	(_mm_max_pu8): Likewise.
> 	(_mm_min_pi16): Likewise.
diff mbox series

Patch

Index: gcc/config/rs6000/xmmintrin.h
===================================================================
--- gcc/config/rs6000/xmmintrin.h	(revision 258888)
+++ gcc/config/rs6000/xmmintrin.h	(working copy)
@@ -1398,11 +1398,11 @@  _mm_max_pi16 (__m64 __A, __m64 __B)
 {
 #if _ARCH_PWR8
   __vector signed short a, b, r;
-  __vector bool short c;
+  __vector __bool short c;
 
   a = (__vector signed short)vec_splats (__A);
   b = (__vector signed short)vec_splats (__B);
-  c = (__vector bool short)vec_cmpgt (a, b);
+  c = (__vector __bool short)vec_cmpgt (a, b);
   r = vec_sel (b, a, c);
   return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0));
 #else
@@ -1436,11 +1436,11 @@  _mm_max_pu8 (__m64 __A, __m64 __B)
 {
 #if _ARCH_PWR8
   __vector unsigned char a, b, r;
-  __vector bool char c;
+  __vector __bool char c;
 
   a = (__vector unsigned char)vec_splats (__A);
   b = (__vector unsigned char)vec_splats (__B);
-  c = (__vector bool char)vec_cmpgt (a, b);
+  c = (__vector __bool char)vec_cmpgt (a, b);
   r = vec_sel (b, a, c);
   return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0));
 #else
@@ -1472,11 +1472,11 @@  _mm_min_pi16 (__m64 __A, __m64 __B)
 {
 #if _ARCH_PWR8
   __vector signed short a, b, r;
-  __vector bool short c;
+  __vector __bool short c;
 
   a = (__vector signed short)vec_splats (__A);
   b = (__vector signed short)vec_splats (__B);
-  c = (__vector bool short)vec_cmplt (a, b);
+  c = (__vector __bool short)vec_cmplt (a, b);
   r = vec_sel (b, a, c);
   return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0));
 #else
@@ -1510,11 +1510,11 @@  _mm_min_pu8 (__m64 __A, __m64 __B)
 {
 #if _ARCH_PWR8
   __vector unsigned char a, b, r;
-  __vector bool char c;
+  __vector __bool char c;
 
   a = (__vector unsigned char)vec_splats (__A);
   b = (__vector unsigned char)vec_splats (__B);
-  c = (__vector bool char)vec_cmplt (a, b);
+  c = (__vector __bool char)vec_cmplt (a, b);
   r = vec_sel (b, a, c);
   return (__builtin_unpack_vector_int128 ((__vector __int128_t)r, 0));
 #else