This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libgfortran]: Use __builtin_ia32_{stmxcsr,ldmxcsr} intrinsics in config/fpu-i387.h
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Fortran List <fortran at gcc dot gnu dot org>
- Date: Wed, 5 Sep 2012 23:30:05 +0200
- Subject: Re: [PATCH, libgfortran]: Use __builtin_ia32_{stmxcsr,ldmxcsr} intrinsics in config/fpu-i387.h
- References: <CAFULd4ZU=8hg7yqjbpCMVsqZm4najcGM0Mr3eAA6XAh+fDFj6A@mail.gmail.com>
On Wed, Sep 5, 2012 at 9:53 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> This patch substitutes volatile asms with equivalent intrinsics.
>
> 2012-09-05 Uros Bizjak <ubizjak@gmail.com>
>
> * config/fpu-387.h (set_fpu): Use __builtin_ia32_stmxcsr and
> __builtin_ia32_ldmxcsr intrinsics.
>
> Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline an 4.7 branch.
I forgot that these builtins are enabled for SSE only (and x86_64
bootstrap enables SSE2 by default), so following addition is needed:
--cut here--
Index: config/fpu-387.h
===================================================================
--- config/fpu-387.h (revision 190992)
+++ config/fpu-387.h (working copy)
@@ -96,7 +96,11 @@
#define _FPU_MASK_UM 0x10
#define _FPU_MASK_PM 0x20
-void set_fpu (void)
+void
+#ifndef __SSE__
+__attribute__((__target__("sse")))
+#endif
+set_fpu (void)
{
unsigned short cw;
--cut here--
Re-tested on x86_64-pc-linux-gnu and committed.
Uros.
>
> Uros.