From: "H.J. Lu" <hjl.tools@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
Jeffrey Law <law@redhat.com>,
Richard Biener <richard.guenther@gmail.com>,
Jakub Jelinek <jakub@redhat.com>, Jan Hubicka <hubicka@ucw.cz>
Subject: PING: [PATCH] x86: Add <x86gprintrin.h>
Date: Fri, 2 Oct 2020 05:51:33 -0700 [thread overview]
Message-ID: <CAMe9rOoNs6V3eYXQ4mXZPs9dFMP9ai0CRS2RDW+HpUTSHqA2qA@mail.gmail.com> (raw)
In-Reply-To: <20200923175800.3770-1-hjl.tools@gmail.com>
On Wed, Sep 23, 2020 at 10:58 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> For sources which can't use any vector instructions, <x86intrin.h> and
> <immintrin.h> cannot be included for compiler intrinsics:
>
> $ echo "#include <x86intrin.h>" | gcc -S -O2 -mno-sse -mno-mmx -x c -
> In file included from /usr/include/stdlib.h:1013,
> from /usr/lib/gcc/x86_64-redhat-linux/10/include/mm_malloc.h:27,
> from /usr/lib/gcc/x86_64-redhat-linux/10/include/xmmintrin.h:34,
> from /usr/lib/gcc/x86_64-redhat-linux/10/include/immintrin.h:29,
> from /usr/lib/gcc/x86_64-redhat-linux/10/include/x86intrin.h:32,
> from <stdin>:1:
> /usr/include/bits/stdlib-float.h: In function ‘atof’:
> /usr/include/bits/stdlib-float.h:26:1: error: SSE register return with SSE disabled
> 26 | {
> | ^
> $
>
> libgcc/config/i386/shadow-stack-unwind.h has a workaround:
>
> /* NB: We need _get_ssp and _inc_ssp from <cetintrin.h>. But we can't
> include <x86intrin.h> which ends up including <mm_malloc.h>, which
> includes <stdlib.h> and <errno.h> unconditionally. But we can't
> include any libc system headers unconditionally from libgcc. Avoid
> including <mm_malloc.h> here by defining _IMMINTRIN_H_INCLUDED. */
> #define _IMMINTRIN_H_INCLUDED
> #include <cetintrin.h>
> #undef _IMMINTRIN_H_INCLUDED
>
> Add a standalone intrinsic header file, <x86gprintrin.h>, to provide
> integer only intrinsics. All integer only intrinsics are placed in
> <x86gprintrin.h>. <x86intrin.h> and <immintrin.h> simply include
> <x86gprintrin.h>.
>
> Add the FSF copyright to <pconfigintrin.h>, <tsxldtrkintrin.h> and
> <wbnoinvdintrin.h>.
>
> gcc/
>
> PR target/97148
> * config.gcc (extra_headers): Add x86gprintrin.h.
> * config/i386/adxintrin.h: Check _X86GPRINTRIN_H_INCLUDED for
> <x86gprintrin.h>.
> * config/i386/bmi2intrin.h: Likewise.
> * config/i386/bmiintrin.h: Likewise.
> * config/i386/cetintrin.h: Likewise.
> * config/i386/cldemoteintrin.h: Likewise.
> * config/i386/clflushoptintrin.h: Likewise.
> * config/i386/clwbintrin.h: Likewise.
> * config/i386/fxsrintrin.h: Likewise.
> * config/i386/ia32intrin.h: Likewise.
> * config/i386/lwpintrin.h: Likewise.
> * config/i386/lzcntintrin.h: Likewise.
> * config/i386/movdirintrin.h: Likewise.
> * config/i386/pkuintrin.h: Likewise.
> * config/i386/rdseedintrin.h: Likewise.
> * config/i386/rtmintrin.h: Likewise.
> * config/i386/serializeintrin.h: Likewise.
> * config/i386/tbmintrin.h: Likewise.
> * config/i386/waitpkgintrin.h: Likewise.
> * config/i386/xsavecintrin.h: Likewise.
> * config/i386/xsaveintrin.h: Likewise.
> * config/i386/xsaveoptintrin.h: Likewise.
> * config/i386/xsavesintrin.h: Likewise.
> * config/i386/xtestintrin.h: Likewise.
> * config/i386/enqcmdintrin.h: Check _X86GPRINTRIN_H_INCLUDED for
> <x86gprintrin.h>. Replace <enqcmdntrin.h> with <enqcmdintrin.h>
> in the error message.
> * config/i386/immintrin.h: Include <x86gprintrin.h> instead of
> <fxsrintrin.h>, <xsaveintrin.h>, <xsaveoptintrin.h>,
> <xsavesintrin.h>, <xsavecintrin.h>, <lzcntintrin.h>,
> <bmiintrin.h>, <bmi2intrin.h>, <xtestintrin.h>, <cetintrin.h>,
> <movdirintrin.h>, <sgxintrin.h, <pconfigintrin.h>,
> <waitpkgintrin.h>, <cldemoteintrin.h>, <enqcmdintrin.h>,
> <serializeintrin.h>, <tsxldtrkintrin.h>, <adxintrin.h>,
> <clwbintrin.h>, <clflushoptintrin.h>, <wbnoinvdintrin.h> and
> <pkuintrin.h>.
> (_wbinvd): Moved to config/i386/x86gprintrin.h.
> (_rdrand16_step): Likewise.
> (_rdrand32_step): Likewise.
> (_rdpid_u32): Likewise.
> (_readfsbase_u32): Likewise.
> (_readfsbase_u64): Likewise.
> (_readgsbase_u32): Likewise.
> (_readgsbase_u64): Likewise.
> (_writefsbase_u32): Likewise.
> (_writefsbase_u64): Likewise.
> (_writegsbase_u32): Likewise.
> (_writegsbase_u64): Likewise.
> (_rdrand64_step): Likewise.
> (_ptwrite64): Likewise.
> (_ptwrite32): Likewise.
> * config/i386/x86gprintrin.h: New file.
> * config/i386/pconfigintrin.h: Add the FSF copyright. Check
> _X86GPRINTRIN_H_INCLUDED for <x86gprintrin.h>.
> * config/i386/tsxldtrkintrin.h: Likewise.
> * config/i386/wbnoinvdintrin.h: Likewise.
> * config/i386/x86intrin.h: Include <x86gprintrin.h>. Don't
> include <ia32intrin.h>, <lwpintrin.h>, <tbmintrin.h>,
> <popcntintrin.h>, <mwaitxintrin.h> and <clzerointrin.h>.
>
> gcc/testsuite/
>
> * gcc.target/i386/avx-1.c (__builtin_ia32_lwpval32): New to
> support <lwpintrin.h> included in <x86gprintrin.h>.
> (__builtin_ia32_lwpval64): Likewise.
> (__builtin_ia32_lwpins32): Likewise.
> (__builtin_ia32_lwpins64): Likewise.
> (__builtin_ia32_bextri_u32): New to support <tbmintrin.h>
> included in <x86gprintrin.h>.
> (__builtin_ia32_bextri_u64): Likewise.
> * gcc.target/i386/x86gprintrin-1.c: New test.
> * gcc.target/i386/x86gprintrin-2.c: Likewise.
> * gcc.target/i386/x86gprintrin-3.c: Likewise.
> * gcc.target/i386/x86gprintrin-4.c: Likewise.
> * gcc.target/i386/x86gprintrin-4a.c: Likewise.
> * gcc.target/i386/x86gprintrin-5.c: Likewise.
> * gcc.target/i386/x86gprintrin-5a.c: Likewise.
> * gcc.target/i386/x86gprintrin-5b.c: Likewise.
> * gcc.target/i386/x86gprintrin-6.c: Likewise.
>
> libgcc/
>
> PR target/97148
> * config/i386/shadow-stack-unwind.h: Include <x86gprintrin.h>
> instead of <cetintrin.h>.
PING:
https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554642.html
--
H.J.
next prev parent reply other threads:[~2020-10-02 12:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 17:58 H.J. Lu
2020-10-02 12:51 ` H.J. Lu [this message]
2020-10-08 12:12 ` PING^2 " H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMe9rOoNs6V3eYXQ4mXZPs9dFMP9ai0CRS2RDW+HpUTSHqA2qA@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=jakub@redhat.com \
--cc=law@redhat.com \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).