summaryrefslogtreecommitdiffstats
path: root/libgcc
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 17:54:50 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 17:54:50 +0000
commit113702f604dd2b4c30118a51e410bd603223cfc8 (patch)
treef77b722f6470dec4c6e4d13c1f5218250646f0c2 /libgcc
parent8bd4cb0808e21b288e4c85baf090372f4fe25b17 (diff)
downloadppe42-gcc-113702f604dd2b4c30118a51e410bd603223cfc8.tar.gz
ppe42-gcc-113702f604dd2b4c30118a51e410bd603223cfc8.zip
* config/i386/crtfastmath.c (set_fast_math): Use __builtin_ia32_fxsave.
Clear only fxsave.mxcsr_mask. Use saved mxcsr from fxsave structure when appropriate. Correct structure element types. * config/i386/t-crtfm (crtfastmath.o): Compile with -mfxsr, remove -minline-all-stringops from compile flags. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192855 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog10
-rw-r--r--libgcc/config/i386/crtfastmath.c39
-rw-r--r--libgcc/config/i386/t-crtfm2
3 files changed, 32 insertions, 19 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 3f17f3f1769..3f073ab12eb 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,10 +1,18 @@
+2012-10-26 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/crtfastmath.c (set_fast_math): Use __builtin_ia32_fxsave.
+ Clear only fxsave.mxcsr_mask. Use saved mxcsr from fxsave structure
+ when appropriate. Correct structure element types.
+ * config/i386/t-crtfm (crtfastmath.o): Compile with -mfxsr, remove
+ -minline-all-stringops from compile flags.
+
2012-10-25 Ralf Corsépius <ralf.corsepius@rtems.org>
* config.host (sparc64-*-rtems*): Remove sparc/t-elf.
2012-10-25 Ralf Corsépius <ralf.corsepius@rtems.org>
- * config.host (sh*-*-rtems*): Add sh*-*-elf*'s extra_parts.
+ * config.host (sh*-*-rtems*): Add sh*-*-elf*'s extra_parts.
2012-10-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
diff --git a/libgcc/config/i386/crtfastmath.c b/libgcc/config/i386/crtfastmath.c
index 7abe500e981..e923d8f4669 100644
--- a/libgcc/config/i386/crtfastmath.c
+++ b/libgcc/config/i386/crtfastmath.c
@@ -91,36 +91,41 @@ set_fast_math (void)
return;
#endif /* __sun__ && __svr4__ */
- mxcsr = __builtin_ia32_stmxcsr () | MXCSR_FTZ;
-
if (edx & bit_FXSAVE)
{
/* Check if DAZ is available. */
struct
{
- unsigned short int cwd;
- unsigned short int swd;
- unsigned short int twd;
- unsigned short int fop;
- long int fip;
- long int fcs;
- long int foo;
- long int fos;
- long int mxcsr;
- long int mxcsr_mask;
- long int st_space[32];
- long int xmm_space[32];
- long int padding[56];
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd;
+ unsigned short fop;
+ unsigned int fip;
+ unsigned int fcs;
+ unsigned int foo;
+ unsigned int fos;
+ unsigned int mxcsr;
+ unsigned int mxcsr_mask;
+ unsigned int st_space[32];
+ unsigned int xmm_space[32];
+ unsigned int padding[56];
} __attribute__ ((aligned (16))) fxsave;
- __builtin_memset (&fxsave, 0, sizeof (fxsave));
+ /* This is necessary since some implementations of FXSAVE
+ do not modify reserved areas within the image. */
+ fxsave.mxcsr_mask = 0;
+
+ __builtin_ia32_fxsave (&fxsave);
- asm volatile ("fxsave %0" : "=m" (fxsave) : "m" (fxsave));
+ mxcsr = fxsave.mxcsr;
if (fxsave.mxcsr_mask & MXCSR_DAZ)
mxcsr |= MXCSR_DAZ;
}
+ else
+ mxcsr = __builtin_ia32_stmxcsr ();
+ mxcsr |= MXCSR_FTZ;
__builtin_ia32_ldmxcsr (mxcsr);
}
#else
diff --git a/libgcc/config/i386/t-crtfm b/libgcc/config/i386/t-crtfm
index 46ce70bbb21..b9da06bfd20 100644
--- a/libgcc/config/i386/t-crtfm
+++ b/libgcc/config/i386/t-crtfm
@@ -1,4 +1,4 @@
# This is an endfile, Use -minline-all-stringops to ensure
# that __builtin_memset doesn't refer to the lib function memset().
crtfastmath.o: $(srcdir)/config/i386/crtfastmath.c
- $(gcc_compile) -msse -minline-all-stringops -c $<
+ $(gcc_compile) -mfxsr -msse -c $<
OpenPOWER on IntegriCloud