Commit 9b789cc1 by Uros Bizjak Committed by Uros Bizjak

config.host (i[34567]-*-*, x86_64-*-*): Add t-crtfm instead of i386/t-crtfm to tmake_file.

	* config.host (i[34567]-*-*, x86_64-*-*): Add t-crtfm instead of
	i386/t-crtfm to tmake_file.
	* config/i386/crtfastmath.c (set_fast_math_sse): New function.
	(set_fast_math): Use set_fast_math_sse for SSE targets.
	* config/i386/t-crtfm: Remove.

From-SVN: r223578
parent b6ec6215
2015-05-22 Uros Bizjak <ubizjak@gmail.com>
* config.host (i[34567]-*-*, x86_64-*-*): Add t-crtfm instead of
i386/t-crtfm to tmake_file.
* config/i386/crtfastmath.c (set_fast_math_sse): New function.
(set_fast_math): Use set_fast_math_sse for SSE targets.
* config/i386/t-crtfm: Remove.
2015-05-21 Alan Modra <amodra@gmail.com> 2015-05-21 Alan Modra <amodra@gmail.com>
PR libgcc/66225 PR libgcc/66225
......
...@@ -553,12 +553,12 @@ hppa*-*-openbsd*) ...@@ -553,12 +553,12 @@ hppa*-*-openbsd*)
tmake_file="$tmake_file pa/t-openbsd" tmake_file="$tmake_file pa/t-openbsd"
;; ;;
i[34567]86-*-darwin*) i[34567]86-*-darwin*)
tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm" tmake_file="$tmake_file i386/t-crtpc t-crtfm"
tm_file="$tm_file i386/darwin-lib.h" tm_file="$tm_file i386/darwin-lib.h"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;; ;;
x86_64-*-darwin*) x86_64-*-darwin*)
tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm" tmake_file="$tmake_file i386/t-crtpc t-crtfm"
tm_file="$tm_file i386/darwin-lib.h" tm_file="$tm_file i386/darwin-lib.h"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;; ;;
...@@ -595,24 +595,24 @@ x86_64-*-openbsd*) ...@@ -595,24 +595,24 @@ x86_64-*-openbsd*)
;; ;;
i[34567]86-*-linux*) i[34567]86-*-linux*)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules"
tm_file="${tm_file} i386/elf-lib.h" tm_file="${tm_file} i386/elf-lib.h"
md_unwind_header=i386/linux-unwind.h md_unwind_header=i386/linux-unwind.h
;; ;;
i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu) i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules"
tm_file="${tm_file} i386/elf-lib.h" tm_file="${tm_file} i386/elf-lib.h"
;; ;;
x86_64-*-linux*) x86_64-*-linux*)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules"
tm_file="${tm_file} i386/elf-lib.h" tm_file="${tm_file} i386/elf-lib.h"
md_unwind_header=i386/linux-unwind.h md_unwind_header=i386/linux-unwind.h
;; ;;
x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu) x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules" tmake_file="${tmake_file} i386/t-crtpc t-crtfm i386/t-crtstuff t-dfprules"
tm_file="${tm_file} i386/elf-lib.h" tm_file="${tm_file} i386/elf-lib.h"
;; ;;
i[34567]86-pc-msdosdjgpp*) i[34567]86-pc-msdosdjgpp*)
...@@ -628,7 +628,7 @@ i[34567]86-*-rtems*) ...@@ -628,7 +628,7 @@ i[34567]86-*-rtems*)
extra_parts="$extra_parts crti.o crtn.o" extra_parts="$extra_parts crti.o crtn.o"
;; ;;
i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*) i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm" tmake_file="$tmake_file i386/t-crtpc t-crtfm"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o" extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tm_file="${tm_file} i386/elf-lib.h" tm_file="${tm_file} i386/elf-lib.h"
md_unwind_header=i386/sol2-unwind.h md_unwind_header=i386/sol2-unwind.h
...@@ -652,7 +652,7 @@ i[34567]86-*-cygwin*) ...@@ -652,7 +652,7 @@ i[34567]86-*-cygwin*)
else else
tmake_dlldir_file="i386/t-dlldir-x" tmake_dlldir_file="i386/t-dlldir-x"
fi fi
tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin i386/t-crtfm i386/t-chkstk t-dfprules" tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin t-crtfm i386/t-chkstk t-dfprules"
;; ;;
x86_64-*-cygwin*) x86_64-*-cygwin*)
extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o" extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
...@@ -672,7 +672,7 @@ x86_64-*-cygwin*) ...@@ -672,7 +672,7 @@ x86_64-*-cygwin*)
tmake_dlldir_file="i386/t-dlldir-x" tmake_dlldir_file="i386/t-dlldir-x"
fi fi
# FIXME - dj - t-chkstk used to be in here, need a 64-bit version of that # FIXME - dj - t-chkstk used to be in here, need a 64-bit version of that
tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin i386/t-crtfm t-dfprules i386/t-chkstk" tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin t-crtfm t-dfprules i386/t-chkstk"
;; ;;
i[34567]86-*-mingw*) i[34567]86-*-mingw*)
extra_parts="crtbegin.o crtend.o crtfastmath.o" extra_parts="crtbegin.o crtend.o crtfastmath.o"
...@@ -700,7 +700,7 @@ i[34567]86-*-mingw*) ...@@ -700,7 +700,7 @@ i[34567]86-*-mingw*)
else else
tmake_dlldir_file="i386/t-dlldir-x" tmake_dlldir_file="i386/t-dlldir-x"
fi fi
tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-mingw32 i386/t-crtfm i386/t-chkstk t-dfprules" tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-mingw32 t-crtfm i386/t-chkstk t-dfprules"
;; ;;
x86_64-*-mingw*) x86_64-*-mingw*)
case ${target_thread_file} in case ${target_thread_file} in
...@@ -723,7 +723,7 @@ x86_64-*-mingw*) ...@@ -723,7 +723,7 @@ x86_64-*-mingw*)
else else
tmake_dlldir_file="i386/t-dlldir-x" tmake_dlldir_file="i386/t-dlldir-x"
fi fi
tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-mingw32 t-dfprules i386/t-crtfm i386/t-chkstk" tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-mingw32 t-dfprules t-crtfm i386/t-chkstk"
extra_parts="$extra_parts crtbegin.o crtend.o crtfastmath.o" extra_parts="$extra_parts crtbegin.o crtend.o crtfastmath.o"
if test x$enable_vtable_verify = xyes; then if test x$enable_vtable_verify = xyes; then
extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
......
...@@ -29,25 +29,15 @@ ...@@ -29,25 +29,15 @@
/* All 64-bit targets have SSE and DAZ; /* All 64-bit targets have SSE and DAZ;
only check them explicitly for 32-bit ones. */ only check them explicitly for 32-bit ones. */
#include "cpuid.h" #include "cpuid.h"
#endif
static void __attribute__((constructor)) __attribute__ ((target("fxsr,sse")))
#ifndef __x86_64__ static void
/* The i386 ABI only requires 4-byte stack alignment, so this is necessary /* The i386 ABI only requires 4-byte stack alignment, so this is necessary
to make sure the fxsave struct gets correct alignment. to make sure the fxsave struct gets correct alignment.
See PR27537 and PR28621. */ See PR27537 and PR28621. */
__attribute__ ((force_align_arg_pointer)) __attribute__ ((force_align_arg_pointer))
#endif set_fast_math_sse (unsigned int edx)
set_fast_math (void)
{ {
#ifndef __x86_64__
unsigned int eax, ebx, ecx, edx;
if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
return;
if (edx & bit_SSE)
{
unsigned int mxcsr; unsigned int mxcsr;
if (edx & bit_FXSAVE) if (edx & bit_FXSAVE)
...@@ -86,7 +76,20 @@ set_fast_math (void) ...@@ -86,7 +76,20 @@ set_fast_math (void)
mxcsr |= MXCSR_FTZ; mxcsr |= MXCSR_FTZ;
__builtin_ia32_ldmxcsr (mxcsr); __builtin_ia32_ldmxcsr (mxcsr);
} }
#endif
static void __attribute__((constructor))
set_fast_math (void)
{
#ifndef __x86_64__
unsigned int eax, ebx, ecx, edx;
if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
return;
if (edx & bit_SSE)
set_fast_math_sse (edx);
#else #else
unsigned int mxcsr = __builtin_ia32_stmxcsr (); unsigned int mxcsr = __builtin_ia32_stmxcsr ();
mxcsr |= MXCSR_DAZ | MXCSR_FTZ; mxcsr |= MXCSR_DAZ | MXCSR_FTZ;
......
# 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) -mfxsr -msse -c $<
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment