public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][x86] Remove duplicated headers includes
@ 2018-05-30 12:52 Peryt, Sebastian
  2018-05-30 19:59 ` Uros Bizjak
  0 siblings, 1 reply; 3+ messages in thread
From: Peryt, Sebastian @ 2018-05-30 12:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak, Kirill Yukhin, Peryt, Sebastian

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

Hi,

I have made some cleaning to remove redundancy in includes call of some of the headers in x86intrin.h.
Removed headers were included in both x86intrin.h and immintrin.h which is included into x86intrin.h.

Is it ok for trunk?

2018-05-30  Sebastian Peryt  <sebastian.peryt@intel.com>

gcc/

        * config/i386/cldemoteintrin.h: Change define from _X86INTRIN_H_INCLUDED
        to _IMMINTRIN_H_INCLUDED.
        * config/i386/pconfigintrin.h: Ditto.
        * config/i386/waitpkgintrin.h: Ditto.
        * config/i386/immintrin.h: Add includes for sgxintrin.h,
        pconfigintrin.h, waitpkgintrin.h and cldemoteintrin.h.
        * config/i386/x86intrin.h: Remove includes for mintrin.h, xmmintrin.h,
        emmintrin.h, pmmintrin.h, tmmintrin.h, smmintrin.h, wmmintrin.h,
        bmiintrin.h, bmi2intrin.h, lzcntintrin.h, sgxintrin.h, pconfigintrin.h,
        waitpkgintrin.h and cldemoteintrin.h.

Thanks,
Sebastian



[-- Attachment #2: 0001-Headers-changes.patch --]
[-- Type: application/octet-stream, Size: 3629 bytes --]

From ab185f8c87d48be73b91a1d2a2f5621bfadf94af Mon Sep 17 00:00:00 2001
From: Sebastian Peryt <sebastian.peryt@intel.com>
Date: Mon, 28 May 2018 10:29:29 +0300
Subject: [PATCH] Headers changes

---
 gcc/config/i386/cldemoteintrin.h |  4 ++--
 gcc/config/i386/immintrin.h      |  8 ++++++++
 gcc/config/i386/pconfigintrin.h  |  4 ++--
 gcc/config/i386/waitpkgintrin.h  |  4 ++--
 gcc/config/i386/x86intrin.h      | 30 ------------------------------
 5 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/gcc/config/i386/cldemoteintrin.h b/gcc/config/i386/cldemoteintrin.h
index 1fa4c2d..a961a1c 100644
--- a/gcc/config/i386/cldemoteintrin.h
+++ b/gcc/config/i386/cldemoteintrin.h
@@ -21,8 +21,8 @@
    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if !defined _X86INTRIN_H_INCLUDED
-# error "Never use <cldemoteintrin.h> directly; include <x86intrin.h> instead."
+#if !defined _IMMINTRIN_H_INCLUDED
+# error "Never use <cldemoteintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef _CLDEMOTE_H_INCLUDED
diff --git a/gcc/config/i386/immintrin.h b/gcc/config/i386/immintrin.h
index 63c5e59..344e92c 100644
--- a/gcc/config/i386/immintrin.h
+++ b/gcc/config/i386/immintrin.h
@@ -112,6 +112,14 @@
 
 #include <movdirintrin.h>
 
+#include <sgxintrin.h>
+
+#include <pconfigintrin.h>
+
+#include <waitpkgintrin.h>
+
+#include <cldemoteintrin.h>
+
 extern __inline void
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _wbinvd (void)
diff --git a/gcc/config/i386/pconfigintrin.h b/gcc/config/i386/pconfigintrin.h
index 1c9c35c..d2a3261 100644
--- a/gcc/config/i386/pconfigintrin.h
+++ b/gcc/config/i386/pconfigintrin.h
@@ -1,5 +1,5 @@
-#ifndef _X86INTRIN_H_INCLUDED
-#error "Never use <pconfigintrin.h> directly; include <x86intrin.h> instead."
+#ifndef _IMMINTRIN_H_INCLUDED
+#error "Never use <pconfigintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef _PCONFIGINTRIN_H_INCLUDED
diff --git a/gcc/config/i386/waitpkgintrin.h b/gcc/config/i386/waitpkgintrin.h
index 8b68091..4418dcd 100644
--- a/gcc/config/i386/waitpkgintrin.h
+++ b/gcc/config/i386/waitpkgintrin.h
@@ -21,8 +21,8 @@
    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if !defined _X86INTRIN_H_INCLUDED
-# error "Never use <waitpkgintrin.h> directly; include <x86intrin.h> instead."
+#if !defined _IMMINTRIN_H_INCLUDED
+# error "Never use <waitpkgintrin.h> directly; include <immintrin.h> instead."
 #endif
 
 #ifndef _WAITPKG_H_INCLUDED
diff --git a/gcc/config/i386/x86intrin.h b/gcc/config/i386/x86intrin.h
index 6d67e9c..92bdf65 100644
--- a/gcc/config/i386/x86intrin.h
+++ b/gcc/config/i386/x86intrin.h
@@ -28,22 +28,6 @@
 
 #ifndef __iamcu__
 
-#include <mmintrin.h>
-
-#include <xmmintrin.h>
-
-#include <emmintrin.h>
-
-#include <pmmintrin.h>
-
-#include <tmmintrin.h>
-
-#include <ammintrin.h>
-
-#include <smmintrin.h>
-
-#include <wmmintrin.h>
-
 /* For including AVX instructions */
 #include <immintrin.h>
 
@@ -55,14 +39,8 @@
 
 #include <lwpintrin.h>
 
-#include <bmiintrin.h>
-
-#include <bmi2intrin.h>
-
 #include <tbmintrin.h>
 
-#include <lzcntintrin.h>
-
 #include <popcntintrin.h>
 
 #include <rdseedintrin.h>
@@ -75,10 +53,6 @@
 
 #include <xsaveoptintrin.h>
 
-#include <sgxintrin.h>
-
-#include <pconfigintrin.h>
-
 #endif /* __iamcu__ */
 
 #include <adxintrin.h>
@@ -101,10 +75,6 @@
 
 #include <pkuintrin.h>
 
-#include <waitpkgintrin.h>
-
-#include <cldemoteintrin.h>
-
 #endif /* __iamcu__ */
 
 #endif /* _X86INTRIN_H_INCLUDED */
-- 
2.5.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][x86] Remove duplicated headers includes
  2018-05-30 12:52 [PATCH][x86] Remove duplicated headers includes Peryt, Sebastian
@ 2018-05-30 19:59 ` Uros Bizjak
  2018-05-30 20:28   ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Uros Bizjak @ 2018-05-30 19:59 UTC (permalink / raw)
  To: Peryt, Sebastian; +Cc: gcc-patches, Kirill Yukhin, H. J. Lu

On Wed, May 30, 2018 at 2:44 PM, Peryt, Sebastian
<sebastian.peryt@intel.com> wrote:
> Hi,
>
> I have made some cleaning to remove redundancy in includes call of some of the headers in x86intrin.h.
> Removed headers were included in both x86intrin.h and immintrin.h which is included into x86intrin.h.
>
> Is it ok for trunk?
>
> 2018-05-30  Sebastian Peryt  <sebastian.peryt@intel.com>
>
> gcc/
>
>         * config/i386/cldemoteintrin.h: Change define from _X86INTRIN_H_INCLUDED
>         to _IMMINTRIN_H_INCLUDED.
>         * config/i386/pconfigintrin.h: Ditto.
>         * config/i386/waitpkgintrin.h: Ditto.
>         * config/i386/immintrin.h: Add includes for sgxintrin.h,
>         pconfigintrin.h, waitpkgintrin.h and cldemoteintrin.h.
>         * config/i386/x86intrin.h: Remove includes for mintrin.h, xmmintrin.h,
>         emmintrin.h, pmmintrin.h, tmmintrin.h, smmintrin.h, wmmintrin.h,
>         bmiintrin.h, bmi2intrin.h, lzcntintrin.h, sgxintrin.h, pconfigintrin.h,
>         waitpkgintrin.h and cldemoteintrin.h.

IIRC all new headers should be included through x86intrin.h.

However, these headers follow ICC, so gcc should just copy what ICC
does. I'm not able to do any meaningful review in this area, lets ask
HJ for review and approval.

Uros.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][x86] Remove duplicated headers includes
  2018-05-30 19:59 ` Uros Bizjak
@ 2018-05-30 20:28   ` H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2018-05-30 20:28 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: Peryt, Sebastian, gcc-patches, Kirill Yukhin

On Wed, May 30, 2018 at 12:51 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Wed, May 30, 2018 at 2:44 PM, Peryt, Sebastian
> <sebastian.peryt@intel.com> wrote:
>> Hi,
>>
>> I have made some cleaning to remove redundancy in includes call of some of the headers in x86intrin.h.
>> Removed headers were included in both x86intrin.h and immintrin.h which is included into x86intrin.h.
>>
>> Is it ok for trunk?
>>
>> 2018-05-30  Sebastian Peryt  <sebastian.peryt@intel.com>
>>
>> gcc/
>>
>>         * config/i386/cldemoteintrin.h: Change define from _X86INTRIN_H_INCLUDED
>>         to _IMMINTRIN_H_INCLUDED.
>>         * config/i386/pconfigintrin.h: Ditto.
>>         * config/i386/waitpkgintrin.h: Ditto.
>>         * config/i386/immintrin.h: Add includes for sgxintrin.h,
>>         pconfigintrin.h, waitpkgintrin.h and cldemoteintrin.h.
>>         * config/i386/x86intrin.h: Remove includes for mintrin.h, xmmintrin.h,
>>         emmintrin.h, pmmintrin.h, tmmintrin.h, smmintrin.h, wmmintrin.h,
>>         bmiintrin.h, bmi2intrin.h, lzcntintrin.h, sgxintrin.h, pconfigintrin.h,
>>         waitpkgintrin.h and cldemoteintrin.h.
>
> IIRC all new headers should be included through x86intrin.h.
>
> However, these headers follow ICC, so gcc should just copy what ICC
> does. I'm not able to do any meaningful review in this area, lets ask
> HJ for review and approval.
>

Looks good to me.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-30 19:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 12:52 [PATCH][x86] Remove duplicated headers includes Peryt, Sebastian
2018-05-30 19:59 ` Uros Bizjak
2018-05-30 20:28   ` H.J. Lu

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).