Re: [PATCH] i386: Move Intel intrinsics head files to

2019-01-21 Thread Richard Biener
On Sun, 20 Jan 2019, Uros Bizjak wrote:

> On Sun, Jan 20, 2019 at 4:11 PM H.J. Lu  wrote:
> >
> > On Sun, Jan 20, 2019 at 4:03 AM Uros Bizjak  wrote:
> > >
> > > On 1/19/19, H.J. Lu  wrote:
> > > > According to Intel Intrinsics Guide:
> > > >
> > > > https://software.intel.com/sites/landingpage/IntrinsicsGuide/
> > > >
> > > > Intel intrinsics should be available by including .  This
> > > > patch moves remaining Intel intrinsics head files from  to
> > > > .
> > >
> > > I can't find the quoted requirement in the provided link.
> >
> > That is an interactive website.  If you type in "_xgetbv" and click on it,
> > you will get
> >
> > Synopsis
> >
> > unsigned __int64 _xgetbv (unsigned int a)
> > #include 
> > Instruction: xgetbv
> > CPUID Flags: XSAVE
> >
> > Description
> >
> > Copy up to 64-bits from the value of the extended control register
> > (XCR) specified by a into dst. Currently only XFEATURE_ENABLED_MASK
> > XCR is supported.
> >
> > Operation
> >
> > dst[63:0] := XCR[a]
> 
> Ah, thanks for the hint. LGTM, but still needs RM approval.

OK.

Richard.

> Thanks.
> Uros.
> 
> > > > OK for trunk?
> > >
> > > You will need a RM approval for a non-regression fix patch at this point.
> >
> > Richard, is this OK for GCC 9?
> >
> > > Uros.
> > >
> > > > H.J.
> > > > ---
> > > >   PR target/71659
> > > >   * config/i386/adxintrin.h: Just check _IMMINTRIN_H_INCLUDED.
> > > >   * config/i386/clflushoptintrin.h: Check _IMMINTRIN_H_INCLUDED
> > > >   instead of _X86INTRIN_H_INCLUDED.
> > > >   * onfig/i386/clwbintrin.h: Likewise.
> > > >   * config/i386/pkuintrin.h: Likewise.
> > > >   * config/i386/prfchwintrin.h: Likewise.
> > > >   * config/i386/rdseedintrin.h: Likewise.
> > > >   * config/i386/wbnoinvdintrin.h: Likewise.
> > > >   * config/i386/xsavecintrin.h: Likewise.
> > > >   * config/i386/xsavesintrin.h: Likewise.
> > > >   * config/i386/fxsrintrin.h: Enable _IMMINTRIN_H_INCLUDED check.
> > > >   * config/i386/xsaveintrin.h: Likewise.
> > > >   * config/i386/xsaveoptintrin.h: Likewise.
> > > >   * config/i386/x86intrin.h: Move "#include" ,
> > > >   , , ,
> > > >   , , ,
> > > >   , , ,
> > > >and  to ...
> > > >   * config/i386/immintrin.h: Here.
> > > > ---
> > > >  gcc/config/i386/adxintrin.h|  4 ++--
> > > >  gcc/config/i386/clflushoptintrin.h |  4 ++--
> > > >  gcc/config/i386/clwbintrin.h   |  4 ++--
> > > >  gcc/config/i386/fxsrintrin.h   |  6 +++---
> > > >  gcc/config/i386/immintrin.h| 24 
> > > >  gcc/config/i386/pkuintrin.h|  4 ++--
> > > >  gcc/config/i386/prfchwintrin.h |  4 ++--
> > > >  gcc/config/i386/rdseedintrin.h |  4 ++--
> > > >  gcc/config/i386/wbnoinvdintrin.h   |  4 ++--
> > > >  gcc/config/i386/x86intrin.h| 28 
> > > >  gcc/config/i386/xsavecintrin.h |  4 ++--
> > > >  gcc/config/i386/xsaveintrin.h  |  6 +++---
> > > >  gcc/config/i386/xsaveoptintrin.h   |  6 +++---
> > > >  gcc/config/i386/xsavesintrin.h |  4 ++--
> > > >  14 files changed, 51 insertions(+), 55 deletions(-)
> > > >
> > > > diff --git a/gcc/config/i386/adxintrin.h b/gcc/config/i386/adxintrin.h
> > > > index e01b77ddb4b..e8cb004390c 100644
> > > > --- a/gcc/config/i386/adxintrin.h
> > > > +++ b/gcc/config/i386/adxintrin.h
> > > > @@ -21,8 +21,8 @@
> > > > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, 
> > > > see
> > > > .  */
> > > >
> > > > -#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED
> > > > -# error "Never use  directly; include  
> > > > instead."
> > > > +#if !defined _IMMINTRIN_H_INCLUDED
> > > > +# error "Never use  directly; include  
> > > > instead."
> > > >  #endif
> > > >
> > > >  #ifndef _ADXINTRIN_H_INCLUDED
> > > > diff --git a/gcc/config/i386/clflushoptintrin.h
> > > > b/gcc/config/i386/clflushoptintrin.h
> > > > index 1e720c2515c..89aa0f68fc2 100644
> > > > --- a/gcc/config/i386/clflushoptintrin.h
> > > > +++ b/gcc/config/i386/clflushoptintrin.h
> > > > @@ -21,8 +21,8 @@
> > > > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, 
> > > > see
> > > > .  */
> > > >
> > > > -#if !defined _X86INTRIN_H_INCLUDED
> > > > -# error "Never use  directly; include 
> > > > instead."
> > > > +#if !defined _IMMINTRIN_H_INCLUDED
> > > > +# error "Never use  directly; include 
> > > > instead."
> > > >  #endif
> > > >
> > > >  #ifndef _CLFLUSHOPTINTRIN_H_INCLUDED
> > > > diff --git a/gcc/config/i386/clwbintrin.h b/gcc/config/i386/clwbintrin.h
> > > > index 217fb3babf2..68b20ea1635 100644
> > > > --- a/gcc/config/i386/clwbintrin.h
> > > > +++ b/gcc/config/i386/clwbintrin.h
> > > > @@ -21,8 +21,8 @@
> > > > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, 
> > > > see
> > > > .  */
> > > >
> > > > -#if !defined 

Re: [PATCH] i386: Move Intel intrinsics head files to

2019-01-20 Thread H.J. Lu
On Sun, Jan 20, 2019 at 10:12 AM Uros Bizjak  wrote:
>
> On Sun, Jan 20, 2019 at 7:09 PM Uros Bizjak  wrote:
> >
> > On Sun, Jan 20, 2019 at 4:11 PM H.J. Lu  wrote:
> > >
> > > On Sun, Jan 20, 2019 at 4:03 AM Uros Bizjak  wrote:
> > > >
> > > > On 1/19/19, H.J. Lu  wrote:
> > > > > According to Intel Intrinsics Guide:
> > > > >
> > > > > https://software.intel.com/sites/landingpage/IntrinsicsGuide/
> > > > >
> > > > > Intel intrinsics should be available by including .  This
> > > > > patch moves remaining Intel intrinsics head files from  
> > > > > to
> > > > > .
> > > >
> > > > I can't find the quoted requirement in the provided link.
> > >
> > > That is an interactive website.  If you type in "_xgetbv" and click on it,
> > > you will get
> > >
> > > Synopsis
> > >
> > > unsigned __int64 _xgetbv (unsigned int a)
> > > #include 
> > > Instruction: xgetbv
> > > CPUID Flags: XSAVE
> > >
> > > Description
> > >
> > > Copy up to 64-bits from the value of the extended control register
> > > (XCR) specified by a into dst. Currently only XFEATURE_ENABLED_MASK
> > > XCR is supported.
> > >
> > > Operation
> > >
> > > dst[63:0] := XCR[a]
> >
> > Ah, thanks for the hint. LGTM, but still needs RM approval.
>
> I wonder, what is/was the purpose of x86intrin.h, considering that
> everything can be included from immintrin.h?

Some intrinsics aren't covered by Intel Intrinsics Guide, like AMD
specific ones.

-- 
H.J.


Re: [PATCH] i386: Move Intel intrinsics head files to

2019-01-20 Thread Uros Bizjak
On Sun, Jan 20, 2019 at 7:09 PM Uros Bizjak  wrote:
>
> On Sun, Jan 20, 2019 at 4:11 PM H.J. Lu  wrote:
> >
> > On Sun, Jan 20, 2019 at 4:03 AM Uros Bizjak  wrote:
> > >
> > > On 1/19/19, H.J. Lu  wrote:
> > > > According to Intel Intrinsics Guide:
> > > >
> > > > https://software.intel.com/sites/landingpage/IntrinsicsGuide/
> > > >
> > > > Intel intrinsics should be available by including .  This
> > > > patch moves remaining Intel intrinsics head files from  to
> > > > .
> > >
> > > I can't find the quoted requirement in the provided link.
> >
> > That is an interactive website.  If you type in "_xgetbv" and click on it,
> > you will get
> >
> > Synopsis
> >
> > unsigned __int64 _xgetbv (unsigned int a)
> > #include 
> > Instruction: xgetbv
> > CPUID Flags: XSAVE
> >
> > Description
> >
> > Copy up to 64-bits from the value of the extended control register
> > (XCR) specified by a into dst. Currently only XFEATURE_ENABLED_MASK
> > XCR is supported.
> >
> > Operation
> >
> > dst[63:0] := XCR[a]
>
> Ah, thanks for the hint. LGTM, but still needs RM approval.

I wonder, what is/was the purpose of x86intrin.h, considering that
everything can be included from immintrin.h?

Uros.


Re: [PATCH] i386: Move Intel intrinsics head files to

2019-01-20 Thread Uros Bizjak
On Sun, Jan 20, 2019 at 4:11 PM H.J. Lu  wrote:
>
> On Sun, Jan 20, 2019 at 4:03 AM Uros Bizjak  wrote:
> >
> > On 1/19/19, H.J. Lu  wrote:
> > > According to Intel Intrinsics Guide:
> > >
> > > https://software.intel.com/sites/landingpage/IntrinsicsGuide/
> > >
> > > Intel intrinsics should be available by including .  This
> > > patch moves remaining Intel intrinsics head files from  to
> > > .
> >
> > I can't find the quoted requirement in the provided link.
>
> That is an interactive website.  If you type in "_xgetbv" and click on it,
> you will get
>
> Synopsis
>
> unsigned __int64 _xgetbv (unsigned int a)
> #include 
> Instruction: xgetbv
> CPUID Flags: XSAVE
>
> Description
>
> Copy up to 64-bits from the value of the extended control register
> (XCR) specified by a into dst. Currently only XFEATURE_ENABLED_MASK
> XCR is supported.
>
> Operation
>
> dst[63:0] := XCR[a]

Ah, thanks for the hint. LGTM, but still needs RM approval.

Thanks.
Uros.

> > > OK for trunk?
> >
> > You will need a RM approval for a non-regression fix patch at this point.
>
> Richard, is this OK for GCC 9?
>
> > Uros.
> >
> > > H.J.
> > > ---
> > >   PR target/71659
> > >   * config/i386/adxintrin.h: Just check _IMMINTRIN_H_INCLUDED.
> > >   * config/i386/clflushoptintrin.h: Check _IMMINTRIN_H_INCLUDED
> > >   instead of _X86INTRIN_H_INCLUDED.
> > >   * onfig/i386/clwbintrin.h: Likewise.
> > >   * config/i386/pkuintrin.h: Likewise.
> > >   * config/i386/prfchwintrin.h: Likewise.
> > >   * config/i386/rdseedintrin.h: Likewise.
> > >   * config/i386/wbnoinvdintrin.h: Likewise.
> > >   * config/i386/xsavecintrin.h: Likewise.
> > >   * config/i386/xsavesintrin.h: Likewise.
> > >   * config/i386/fxsrintrin.h: Enable _IMMINTRIN_H_INCLUDED check.
> > >   * config/i386/xsaveintrin.h: Likewise.
> > >   * config/i386/xsaveoptintrin.h: Likewise.
> > >   * config/i386/x86intrin.h: Move "#include" ,
> > >   , , ,
> > >   , , ,
> > >   , , ,
> > >and  to ...
> > >   * config/i386/immintrin.h: Here.
> > > ---
> > >  gcc/config/i386/adxintrin.h|  4 ++--
> > >  gcc/config/i386/clflushoptintrin.h |  4 ++--
> > >  gcc/config/i386/clwbintrin.h   |  4 ++--
> > >  gcc/config/i386/fxsrintrin.h   |  6 +++---
> > >  gcc/config/i386/immintrin.h| 24 
> > >  gcc/config/i386/pkuintrin.h|  4 ++--
> > >  gcc/config/i386/prfchwintrin.h |  4 ++--
> > >  gcc/config/i386/rdseedintrin.h |  4 ++--
> > >  gcc/config/i386/wbnoinvdintrin.h   |  4 ++--
> > >  gcc/config/i386/x86intrin.h| 28 
> > >  gcc/config/i386/xsavecintrin.h |  4 ++--
> > >  gcc/config/i386/xsaveintrin.h  |  6 +++---
> > >  gcc/config/i386/xsaveoptintrin.h   |  6 +++---
> > >  gcc/config/i386/xsavesintrin.h |  4 ++--
> > >  14 files changed, 51 insertions(+), 55 deletions(-)
> > >
> > > diff --git a/gcc/config/i386/adxintrin.h b/gcc/config/i386/adxintrin.h
> > > index e01b77ddb4b..e8cb004390c 100644
> > > --- a/gcc/config/i386/adxintrin.h
> > > +++ b/gcc/config/i386/adxintrin.h
> > > @@ -21,8 +21,8 @@
> > > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> > > .  */
> > >
> > > -#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED
> > > -# error "Never use  directly; include  
> > > instead."
> > > +#if !defined _IMMINTRIN_H_INCLUDED
> > > +# error "Never use  directly; include  
> > > instead."
> > >  #endif
> > >
> > >  #ifndef _ADXINTRIN_H_INCLUDED
> > > diff --git a/gcc/config/i386/clflushoptintrin.h
> > > b/gcc/config/i386/clflushoptintrin.h
> > > index 1e720c2515c..89aa0f68fc2 100644
> > > --- a/gcc/config/i386/clflushoptintrin.h
> > > +++ b/gcc/config/i386/clflushoptintrin.h
> > > @@ -21,8 +21,8 @@
> > > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> > > .  */
> > >
> > > -#if !defined _X86INTRIN_H_INCLUDED
> > > -# error "Never use  directly; include 
> > > instead."
> > > +#if !defined _IMMINTRIN_H_INCLUDED
> > > +# error "Never use  directly; include 
> > > instead."
> > >  #endif
> > >
> > >  #ifndef _CLFLUSHOPTINTRIN_H_INCLUDED
> > > diff --git a/gcc/config/i386/clwbintrin.h b/gcc/config/i386/clwbintrin.h
> > > index 217fb3babf2..68b20ea1635 100644
> > > --- a/gcc/config/i386/clwbintrin.h
> > > +++ b/gcc/config/i386/clwbintrin.h
> > > @@ -21,8 +21,8 @@
> > > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> > > .  */
> > >
> > > -#if !defined _X86INTRIN_H_INCLUDED
> > > -# error "Never use  directly; include 
> > > instead."
> > > +#if !defined _IMMINTRIN_H_INCLUDED
> > > +# error "Never use  directly; include 
> > > instead."
> > >  #endif
> > >
> > >  #ifndef _CLWBINTRIN_H_INCLUDED
> > > diff --git a/gcc/config/i386/fxsrintrin.h b/gcc/config/i386/fxsrintrin.h
> > > index 

Re: [PATCH] i386: Move Intel intrinsics head files to

2019-01-20 Thread H.J. Lu
On Sun, Jan 20, 2019 at 4:03 AM Uros Bizjak  wrote:
>
> On 1/19/19, H.J. Lu  wrote:
> > According to Intel Intrinsics Guide:
> >
> > https://software.intel.com/sites/landingpage/IntrinsicsGuide/
> >
> > Intel intrinsics should be available by including .  This
> > patch moves remaining Intel intrinsics head files from  to
> > .
>
> I can't find the quoted requirement in the provided link.

That is an interactive website.  If you type in "_xgetbv" and click on it,
you will get

Synopsis

unsigned __int64 _xgetbv (unsigned int a)
#include 
Instruction: xgetbv
CPUID Flags: XSAVE

Description

Copy up to 64-bits from the value of the extended control register
(XCR) specified by a into dst. Currently only XFEATURE_ENABLED_MASK
XCR is supported.

Operation

dst[63:0] := XCR[a]

> > OK for trunk?
>
> You will need a RM approval for a non-regression fix patch at this point.

Richard, is this OK for GCC 9?

> Uros.
>
> > H.J.
> > ---
> >   PR target/71659
> >   * config/i386/adxintrin.h: Just check _IMMINTRIN_H_INCLUDED.
> >   * config/i386/clflushoptintrin.h: Check _IMMINTRIN_H_INCLUDED
> >   instead of _X86INTRIN_H_INCLUDED.
> >   * onfig/i386/clwbintrin.h: Likewise.
> >   * config/i386/pkuintrin.h: Likewise.
> >   * config/i386/prfchwintrin.h: Likewise.
> >   * config/i386/rdseedintrin.h: Likewise.
> >   * config/i386/wbnoinvdintrin.h: Likewise.
> >   * config/i386/xsavecintrin.h: Likewise.
> >   * config/i386/xsavesintrin.h: Likewise.
> >   * config/i386/fxsrintrin.h: Enable _IMMINTRIN_H_INCLUDED check.
> >   * config/i386/xsaveintrin.h: Likewise.
> >   * config/i386/xsaveoptintrin.h: Likewise.
> >   * config/i386/x86intrin.h: Move "#include" ,
> >   , , ,
> >   , , ,
> >   , , ,
> >and  to ...
> >   * config/i386/immintrin.h: Here.
> > ---
> >  gcc/config/i386/adxintrin.h|  4 ++--
> >  gcc/config/i386/clflushoptintrin.h |  4 ++--
> >  gcc/config/i386/clwbintrin.h   |  4 ++--
> >  gcc/config/i386/fxsrintrin.h   |  6 +++---
> >  gcc/config/i386/immintrin.h| 24 
> >  gcc/config/i386/pkuintrin.h|  4 ++--
> >  gcc/config/i386/prfchwintrin.h |  4 ++--
> >  gcc/config/i386/rdseedintrin.h |  4 ++--
> >  gcc/config/i386/wbnoinvdintrin.h   |  4 ++--
> >  gcc/config/i386/x86intrin.h| 28 
> >  gcc/config/i386/xsavecintrin.h |  4 ++--
> >  gcc/config/i386/xsaveintrin.h  |  6 +++---
> >  gcc/config/i386/xsaveoptintrin.h   |  6 +++---
> >  gcc/config/i386/xsavesintrin.h |  4 ++--
> >  14 files changed, 51 insertions(+), 55 deletions(-)
> >
> > diff --git a/gcc/config/i386/adxintrin.h b/gcc/config/i386/adxintrin.h
> > index e01b77ddb4b..e8cb004390c 100644
> > --- a/gcc/config/i386/adxintrin.h
> > +++ b/gcc/config/i386/adxintrin.h
> > @@ -21,8 +21,8 @@
> > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> > .  */
> >
> > -#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED
> > -# error "Never use  directly; include  instead."
> > +#if !defined _IMMINTRIN_H_INCLUDED
> > +# error "Never use  directly; include  instead."
> >  #endif
> >
> >  #ifndef _ADXINTRIN_H_INCLUDED
> > diff --git a/gcc/config/i386/clflushoptintrin.h
> > b/gcc/config/i386/clflushoptintrin.h
> > index 1e720c2515c..89aa0f68fc2 100644
> > --- a/gcc/config/i386/clflushoptintrin.h
> > +++ b/gcc/config/i386/clflushoptintrin.h
> > @@ -21,8 +21,8 @@
> > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> > .  */
> >
> > -#if !defined _X86INTRIN_H_INCLUDED
> > -# error "Never use  directly; include 
> > instead."
> > +#if !defined _IMMINTRIN_H_INCLUDED
> > +# error "Never use  directly; include 
> > instead."
> >  #endif
> >
> >  #ifndef _CLFLUSHOPTINTRIN_H_INCLUDED
> > diff --git a/gcc/config/i386/clwbintrin.h b/gcc/config/i386/clwbintrin.h
> > index 217fb3babf2..68b20ea1635 100644
> > --- a/gcc/config/i386/clwbintrin.h
> > +++ b/gcc/config/i386/clwbintrin.h
> > @@ -21,8 +21,8 @@
> > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> > .  */
> >
> > -#if !defined _X86INTRIN_H_INCLUDED
> > -# error "Never use  directly; include 
> > instead."
> > +#if !defined _IMMINTRIN_H_INCLUDED
> > +# error "Never use  directly; include 
> > instead."
> >  #endif
> >
> >  #ifndef _CLWBINTRIN_H_INCLUDED
> > diff --git a/gcc/config/i386/fxsrintrin.h b/gcc/config/i386/fxsrintrin.h
> > index ff6c6f848eb..c4b12cf25f3 100644
> > --- a/gcc/config/i386/fxsrintrin.h
> > +++ b/gcc/config/i386/fxsrintrin.h
> > @@ -21,9 +21,9 @@
> > see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> > .  */
> >
> > -/* #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED */
> > -/* # error "Never use  directly; include 
> > instead." */
> > -/* #endif 

Re: [PATCH] i386: Move Intel intrinsics head files to

2019-01-20 Thread Uros Bizjak
On 1/19/19, H.J. Lu  wrote:
> According to Intel Intrinsics Guide:
>
> https://software.intel.com/sites/landingpage/IntrinsicsGuide/
>
> Intel intrinsics should be available by including .  This
> patch moves remaining Intel intrinsics head files from  to
> .

I can't find the quoted requirement in the provided link.

> OK for trunk?

You will need a RM approval for a non-regression fix patch at this point.

Uros.

> H.J.
> ---
>   PR target/71659
>   * config/i386/adxintrin.h: Just check _IMMINTRIN_H_INCLUDED.
>   * config/i386/clflushoptintrin.h: Check _IMMINTRIN_H_INCLUDED
>   instead of _X86INTRIN_H_INCLUDED.
>   * onfig/i386/clwbintrin.h: Likewise.
>   * config/i386/pkuintrin.h: Likewise.
>   * config/i386/prfchwintrin.h: Likewise.
>   * config/i386/rdseedintrin.h: Likewise.
>   * config/i386/wbnoinvdintrin.h: Likewise.
>   * config/i386/xsavecintrin.h: Likewise.
>   * config/i386/xsavesintrin.h: Likewise.
>   * config/i386/fxsrintrin.h: Enable _IMMINTRIN_H_INCLUDED check.
>   * config/i386/xsaveintrin.h: Likewise.
>   * config/i386/xsaveoptintrin.h: Likewise.
>   * config/i386/x86intrin.h: Move "#include" ,
>   , , ,
>   , , ,
>   , , ,
>and  to ...
>   * config/i386/immintrin.h: Here.
> ---
>  gcc/config/i386/adxintrin.h|  4 ++--
>  gcc/config/i386/clflushoptintrin.h |  4 ++--
>  gcc/config/i386/clwbintrin.h   |  4 ++--
>  gcc/config/i386/fxsrintrin.h   |  6 +++---
>  gcc/config/i386/immintrin.h| 24 
>  gcc/config/i386/pkuintrin.h|  4 ++--
>  gcc/config/i386/prfchwintrin.h |  4 ++--
>  gcc/config/i386/rdseedintrin.h |  4 ++--
>  gcc/config/i386/wbnoinvdintrin.h   |  4 ++--
>  gcc/config/i386/x86intrin.h| 28 
>  gcc/config/i386/xsavecintrin.h |  4 ++--
>  gcc/config/i386/xsaveintrin.h  |  6 +++---
>  gcc/config/i386/xsaveoptintrin.h   |  6 +++---
>  gcc/config/i386/xsavesintrin.h |  4 ++--
>  14 files changed, 51 insertions(+), 55 deletions(-)
>
> diff --git a/gcc/config/i386/adxintrin.h b/gcc/config/i386/adxintrin.h
> index e01b77ddb4b..e8cb004390c 100644
> --- a/gcc/config/i386/adxintrin.h
> +++ b/gcc/config/i386/adxintrin.h
> @@ -21,8 +21,8 @@
> see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> .  */
>
> -#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED
> -# error "Never use  directly; include  instead."
> +#if !defined _IMMINTRIN_H_INCLUDED
> +# error "Never use  directly; include  instead."
>  #endif
>
>  #ifndef _ADXINTRIN_H_INCLUDED
> diff --git a/gcc/config/i386/clflushoptintrin.h
> b/gcc/config/i386/clflushoptintrin.h
> index 1e720c2515c..89aa0f68fc2 100644
> --- a/gcc/config/i386/clflushoptintrin.h
> +++ b/gcc/config/i386/clflushoptintrin.h
> @@ -21,8 +21,8 @@
> see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> .  */
>
> -#if !defined _X86INTRIN_H_INCLUDED
> -# error "Never use  directly; include 
> instead."
> +#if !defined _IMMINTRIN_H_INCLUDED
> +# error "Never use  directly; include 
> instead."
>  #endif
>
>  #ifndef _CLFLUSHOPTINTRIN_H_INCLUDED
> diff --git a/gcc/config/i386/clwbintrin.h b/gcc/config/i386/clwbintrin.h
> index 217fb3babf2..68b20ea1635 100644
> --- a/gcc/config/i386/clwbintrin.h
> +++ b/gcc/config/i386/clwbintrin.h
> @@ -21,8 +21,8 @@
> see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> .  */
>
> -#if !defined _X86INTRIN_H_INCLUDED
> -# error "Never use  directly; include 
> instead."
> +#if !defined _IMMINTRIN_H_INCLUDED
> +# error "Never use  directly; include 
> instead."
>  #endif
>
>  #ifndef _CLWBINTRIN_H_INCLUDED
> diff --git a/gcc/config/i386/fxsrintrin.h b/gcc/config/i386/fxsrintrin.h
> index ff6c6f848eb..c4b12cf25f3 100644
> --- a/gcc/config/i386/fxsrintrin.h
> +++ b/gcc/config/i386/fxsrintrin.h
> @@ -21,9 +21,9 @@
> see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> .  */
>
> -/* #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED */
> -/* # error "Never use  directly; include 
> instead." */
> -/* #endif */
> +#if !defined _IMMINTRIN_H_INCLUDED
> +# error "Never use  directly; include 
> instead."
> +#endif
>
>  #ifndef _FXSRINTRIN_H_INCLUDED
>  #define _FXSRINTRIN_H_INCLUDED
> diff --git a/gcc/config/i386/immintrin.h b/gcc/config/i386/immintrin.h
> index 6ce00012b42..10e1f27c605 100644
> --- a/gcc/config/i386/immintrin.h
> +++ b/gcc/config/i386/immintrin.h
> @@ -38,6 +38,16 @@
>
>  #include 
>
> +#include 
> +
> +#include 
> +
> +#include 
> +
> +#include 
> +
> +#include 
> +
>  #include 
>
>  #include 
> @@ -120,6 +130,20 @@
>
>  #include 
>
> +#include 
> +
> +#include 
> +
> +#include 
> +
> +#include 
> +
> +#include 
> +
> +#include 
> +
> +#include 
> +
>  extern __inline void
>  

[PATCH] i386: Move Intel intrinsics head files to

2019-01-19 Thread H.J. Lu
According to Intel Intrinsics Guide:

https://software.intel.com/sites/landingpage/IntrinsicsGuide/

Intel intrinsics should be available by including .  This
patch moves remaining Intel intrinsics head files from  to
.

OK for trunk?

H.J.
---
PR target/71659
* config/i386/adxintrin.h: Just check _IMMINTRIN_H_INCLUDED.
* config/i386/clflushoptintrin.h: Check _IMMINTRIN_H_INCLUDED
instead of _X86INTRIN_H_INCLUDED.
* onfig/i386/clwbintrin.h: Likewise.
* config/i386/pkuintrin.h: Likewise.
* config/i386/prfchwintrin.h: Likewise.
* config/i386/rdseedintrin.h: Likewise.
* config/i386/wbnoinvdintrin.h: Likewise.
* config/i386/xsavecintrin.h: Likewise.
* config/i386/xsavesintrin.h: Likewise.
* config/i386/fxsrintrin.h: Enable _IMMINTRIN_H_INCLUDED check.
* config/i386/xsaveintrin.h: Likewise.
* config/i386/xsaveoptintrin.h: Likewise.
* config/i386/x86intrin.h: Move "#include" ,
, , ,
, , ,
, , ,
 and  to ...
* config/i386/immintrin.h: Here.
---
 gcc/config/i386/adxintrin.h|  4 ++--
 gcc/config/i386/clflushoptintrin.h |  4 ++--
 gcc/config/i386/clwbintrin.h   |  4 ++--
 gcc/config/i386/fxsrintrin.h   |  6 +++---
 gcc/config/i386/immintrin.h| 24 
 gcc/config/i386/pkuintrin.h|  4 ++--
 gcc/config/i386/prfchwintrin.h |  4 ++--
 gcc/config/i386/rdseedintrin.h |  4 ++--
 gcc/config/i386/wbnoinvdintrin.h   |  4 ++--
 gcc/config/i386/x86intrin.h| 28 
 gcc/config/i386/xsavecintrin.h |  4 ++--
 gcc/config/i386/xsaveintrin.h  |  6 +++---
 gcc/config/i386/xsaveoptintrin.h   |  6 +++---
 gcc/config/i386/xsavesintrin.h |  4 ++--
 14 files changed, 51 insertions(+), 55 deletions(-)

diff --git a/gcc/config/i386/adxintrin.h b/gcc/config/i386/adxintrin.h
index e01b77ddb4b..e8cb004390c 100644
--- a/gcc/config/i386/adxintrin.h
+++ b/gcc/config/i386/adxintrin.h
@@ -21,8 +21,8 @@
see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
.  */
 
-#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED
-# error "Never use  directly; include  instead."
+#if !defined _IMMINTRIN_H_INCLUDED
+# error "Never use  directly; include  instead."
 #endif
 
 #ifndef _ADXINTRIN_H_INCLUDED
diff --git a/gcc/config/i386/clflushoptintrin.h 
b/gcc/config/i386/clflushoptintrin.h
index 1e720c2515c..89aa0f68fc2 100644
--- a/gcc/config/i386/clflushoptintrin.h
+++ b/gcc/config/i386/clflushoptintrin.h
@@ -21,8 +21,8 @@
see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
.  */
 
-#if !defined _X86INTRIN_H_INCLUDED
-# error "Never use  directly; include  
instead."
+#if !defined _IMMINTRIN_H_INCLUDED
+# error "Never use  directly; include  
instead."
 #endif
 
 #ifndef _CLFLUSHOPTINTRIN_H_INCLUDED
diff --git a/gcc/config/i386/clwbintrin.h b/gcc/config/i386/clwbintrin.h
index 217fb3babf2..68b20ea1635 100644
--- a/gcc/config/i386/clwbintrin.h
+++ b/gcc/config/i386/clwbintrin.h
@@ -21,8 +21,8 @@
see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
.  */
 
-#if !defined _X86INTRIN_H_INCLUDED
-# error "Never use  directly; include  instead."
+#if !defined _IMMINTRIN_H_INCLUDED
+# error "Never use  directly; include  instead."
 #endif
 
 #ifndef _CLWBINTRIN_H_INCLUDED
diff --git a/gcc/config/i386/fxsrintrin.h b/gcc/config/i386/fxsrintrin.h
index ff6c6f848eb..c4b12cf25f3 100644
--- a/gcc/config/i386/fxsrintrin.h
+++ b/gcc/config/i386/fxsrintrin.h
@@ -21,9 +21,9 @@
see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
.  */
 
-/* #if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED */
-/* # error "Never use  directly; include  instead." 
*/
-/* #endif */
+#if !defined _IMMINTRIN_H_INCLUDED
+# error "Never use  directly; include  instead."
+#endif
 
 #ifndef _FXSRINTRIN_H_INCLUDED
 #define _FXSRINTRIN_H_INCLUDED
diff --git a/gcc/config/i386/immintrin.h b/gcc/config/i386/immintrin.h
index 6ce00012b42..10e1f27c605 100644
--- a/gcc/config/i386/immintrin.h
+++ b/gcc/config/i386/immintrin.h
@@ -38,6 +38,16 @@
 
 #include 
 
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+
 #include 
 
 #include 
@@ -120,6 +130,20 @@
 
 #include 
 
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+
 extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _wbinvd (void)
diff --git a/gcc/config/i386/pkuintrin.h b/gcc/config/i386/pkuintrin.h
index 727bec5dda8..be46522f0c0 100644
--- a/gcc/config/i386/pkuintrin.h
+++ b/gcc/config/i386/pkuintrin.h
@@ -21,8 +21,8 @@
see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
.  */
 
-#if !defined