Commit 8ab30b97 by Bill Schmidt Committed by William Schmidt

emmintrin.h (_mm_cvtpd_epi32): Use __vector rather than vector.

[gcc]

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

	* config/rs6000/emmintrin.h (_mm_cvtpd_epi32): Use __vector rather
	than vector.
	(_mm_cvtpd_ps): Likewise.
	(_mm_cvttpd_epi32): Likewise.
	* config/rs6000/mmintrin.h (_mm_unpacklo_pi8): Likewise.
	* config/rs6000/xmmintrin.h: For strict-ANSI C++ or C11, undefine
	vector, pixel, and bool following altivec.h include.

[gcc/testsuite]

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

	* gcc.target/powerpc/powerpc.exp: Add .C suffix for main loop.
	* gcc.target/powerpc/undef-bool-1.C: New file.
	* gcc.target/powerpc/undef-bool-2.c: New file.

From-SVN: r259050
parent e52c093a
2018-04-03 Bill Schmidt <wschmidt@linux.ibm.com>
* config/rs6000/emmintrin.h (_mm_cvtpd_epi32): Use __vector rather
than vector.
(_mm_cvtpd_ps): Likewise.
(_mm_cvttpd_epi32): Likewise.
* config/rs6000/mmintrin.h (_mm_unpacklo_pi8): Likewise.
* config/rs6000/xmmintrin.h: For strict-ANSI C++ or C11, undefine
vector, pixel, and bool following altivec.h include.
2018-04-03 Martin Sebor <msebor@redhat.com> 2018-04-03 Martin Sebor <msebor@redhat.com>
* doc/extend.texi (Common Function Attributes): Clarify. * doc/extend.texi (Common Function Attributes): Clarify.
......
...@@ -885,7 +885,7 @@ _mm_cvtpd_epi32 (__m128d __A) ...@@ -885,7 +885,7 @@ _mm_cvtpd_epi32 (__m128d __A)
#ifdef _ARCH_PWR8 #ifdef _ARCH_PWR8
temp = vec_mergeo (temp, temp); temp = vec_mergeo (temp, temp);
result = (__v4si)vec_vpkudum ((vector long)temp, (vector long)vzero); result = (__v4si)vec_vpkudum ((__vector long)temp, (__vector long)vzero);
#else #else
{ {
const __v16qu pkperm = {0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0a, 0x0b, const __v16qu pkperm = {0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0a, 0x0b,
...@@ -919,7 +919,7 @@ _mm_cvtpd_ps (__m128d __A) ...@@ -919,7 +919,7 @@ _mm_cvtpd_ps (__m128d __A)
#ifdef _ARCH_PWR8 #ifdef _ARCH_PWR8
temp = vec_mergeo (temp, temp); temp = vec_mergeo (temp, temp);
result = (__v4sf)vec_vpkudum ((vector long)temp, (vector long)vzero); result = (__v4sf)vec_vpkudum ((__vector long)temp, (__vector long)vzero);
#else #else
{ {
const __v16qu pkperm = {0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0a, 0x0b, const __v16qu pkperm = {0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0a, 0x0b,
...@@ -947,7 +947,7 @@ _mm_cvttpd_epi32 (__m128d __A) ...@@ -947,7 +947,7 @@ _mm_cvttpd_epi32 (__m128d __A)
#ifdef _ARCH_PWR8 #ifdef _ARCH_PWR8
temp = vec_mergeo (temp, temp); temp = vec_mergeo (temp, temp);
result = (__v4si)vec_vpkudum ((vector long)temp, (vector long)vzero); result = (__v4si)vec_vpkudum ((__vector long)temp, (__vector long)vzero);
#else #else
{ {
const __v16qu pkperm = {0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0a, 0x0b, const __v16qu pkperm = {0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0a, 0x0b,
......
...@@ -317,7 +317,7 @@ _mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) ...@@ -317,7 +317,7 @@ _mm_unpacklo_pi8 (__m64 __m1, __m64 __m2)
a = (__vector unsigned char)vec_splats (__m1); a = (__vector unsigned char)vec_splats (__m1);
b = (__vector unsigned char)vec_splats (__m2); b = (__vector unsigned char)vec_splats (__m2);
c = vec_mergel (a, b); c = vec_mergel (a, b);
return (__builtin_unpack_vector_int128 ((vector __int128_t)c, 1)); return (__builtin_unpack_vector_int128 ((__vector __int128_t)c, 1));
#else #else
__m64_union m1, m2, res; __m64_union m1, m2, res;
......
...@@ -58,6 +58,18 @@ ...@@ -58,6 +58,18 @@
#define _XMMINTRIN_H_INCLUDED #define _XMMINTRIN_H_INCLUDED
#include <altivec.h> #include <altivec.h>
/* Avoid collisions between altivec.h and strict adherence to C++ and
C11 standards. This should eventually be done inside altivec.h itself,
but only after testing a full distro build. */
#if defined(__STRICT_ANSI__) && (defined(__cplusplus) || \
(defined(__STDC_VERSION__) && \
__STDC_VERSION__ >= 201112L))
#undef vector
#undef pixel
#undef bool
#endif
#include <assert.h> #include <assert.h>
/* We need type definitions from the MMX header file. */ /* We need type definitions from the MMX header file. */
......
2018-04-03 Bill Schmidt <wschmidt@linux.ibm.com>
* gcc.target/powerpc/powerpc.exp: Add .C suffix for main loop.
* gcc.target/powerpc/undef-bool-1.C: New file.
* gcc.target/powerpc/undef-bool-2.c: New file.
2018-04-03 Paolo Carlini <paolo.carlini@oracle.com> 2018-04-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84768 PR c++/84768
......
...@@ -35,7 +35,7 @@ if ![info exists DEFAULT_CFLAGS] then { ...@@ -35,7 +35,7 @@ if ![info exists DEFAULT_CFLAGS] then {
dg-init dg-init
# Main loop. # Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
"" $DEFAULT_CFLAGS "" $DEFAULT_CFLAGS
set SAVRES_TEST_OPTS [list -Os -O2 {-Os -mno-multiple} {-O2 -mno-multiple}] set SAVRES_TEST_OPTS [list -Os -O2 {-Os -mno-multiple} {-O2 -mno-multiple}]
......
/* { dg-do compile } */
/* { dg-options "-O2 -std=c++11 -DNO_WARN_X86_INTRINSICS" } */
/* Test to ensure that "bool" gets undef'd in xmmintrin.h when
we require strict ANSI. */
#include <xmmintrin.h>
bool foo (int x)
{
return x == 2;
}
/* { dg-do compile } */
/* { dg-options "-O2 -std=c11 -DNO_WARN_X86_INTRINSICS" } */
/* Test to ensure that "bool" gets undef'd in xmmintrin.h when
we require strict ANSI. Subsequent use of bool needs stdbool.h.
altivec.h should eventually avoid defining bool, vector, and
pixel, following distro testing. */
#include <xmmintrin.h>
bool foo (int x) /* { dg-error "unknown type name 'bool'; did you mean '_Bool'?" } */
{
return x == 2;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment