This is the mail archive of the
mailing list for the GCC project.
Re: [i386] __builtin_ia32_stmxcsr could be pure
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Jun 2017 23:34:31 +0200 (CEST)
- Subject: Re: [i386] __builtin_ia32_stmxcsr could be pure
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.email@example.com> <CAFiYyc1X81Myu3KW9E=AkYFpq=EKtvXfZ74Hu7aNn2Ry7Ksi4g@mail.gmail.com> <alpine.DEB.firstname.lastname@example.org>
On Sat, 3 Jun 2017, Marc Glisse wrote:
I don't think Richard's "sounds good" was meant as "ok to commit". Does an
x86 maintainer want to approve or criticize the patch?
On Fri, 26 May 2017, Richard Biener wrote:
On Fri, May 26, 2017 at 10:55 AM, Marc Glisse <email@example.com> wrote:
glibc marks fegetround as a pure function. On x86, people tend to use
_MM_GET_ROUNDING_MODE instead, which could benefit from the same. I think
is safe, but a second opinion would be welcome.
Sounds good. The important part is to keep the dependency to
which is done via claiming both touch global memory.
I could have handled just this builtin, but it seemed better to provide
def_builtin_pure (like "const" already has) since there should be other
builtins that can be marked this way (maybe the gathers?).
Should work for gathers. They could even use stronger guarantees,
namely a fnspec with "..R" (the pointer argument is only read from
Similarly scatter can use ".W" (the pointer argument is only written to
Bootstrap+testsuite on x86_64-pc-linux-gnu with default languages.
2017-05-29 Marc Glisse <firstname.lastname@example.org>
* config/i386/i386.c (struct builtin_isa): New field pure_p.
Reorder for compactness.
(def_builtin, def_builtin2, ix86_add_new_builtins): Handle pure_p.
(def_builtin_pure, def_builtin_pure2): New functions.
(ix86_init_mmx_sse_builtins) [__builtin_ia32_stmxcsr]: Mark as
* gcc.target/i386/getround.c: New file.