Commit a261e0cc by David S. Miller

crtfastmath.c: New file.

2002-04-03  David S. Miller  <davem@redhat.com>

	* config/sparc/crtfastmath.c: New file.
	* config/sparc/t-crtfm: New file.
	* config/sparc/linux.h (ENDFILE_SPEC): Use crtfastmath.o
	* config/sparc/linux64.h (ENDFILE_SPEC): Likewise.
	* config/sparc/sol2.h (ENDFILE_SPEC): Likewise.
	* config/sparc/sp64-elf.h (ENDFILE_SPEC): Likewise.
	* config/sparc/elf.h (ENDFILE_SPEC): Likewise.
	* config.gcc (sparc*-*-{elf*,linux*,solaris2*}): Add
	sparc/t-crtfm to tmake_file.

	* config/sparc/sparc-protos.h (sparc_emitting_epilogue): Add.

From-SVN: r51808
parent 68c17f30
......@@ -3018,7 +3018,7 @@ sparc-*-chorusos*)
;;
sparc-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h sparc/elf.h"
tmake_file=sparc/t-elf
tmake_file="sparc/t-elf sparc/t-crtfm"
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
#float_format=i128
float_format=i64
......@@ -3029,14 +3029,14 @@ sparc-*-linux*aout*) # Sparc's running GNU/Linux, a.out
;;
sparc-*-linux*libc1*) # Sparc's running GNU/Linux, libc5
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1"
tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 sparc/t-crtfm"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
float_format=sparc
;;
sparc-*-linux*) # Sparc's running GNU/Linux, libc6
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
tmake_file="t-slibgcc-elf-ver t-linux"
tmake_file="t-slibgcc-elf-ver t-linux sparc/t-crtfm"
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
gnu_ld=yes
if test x$enable_threads = xyes; then
......@@ -3080,7 +3080,7 @@ sparcv9-*-solaris2* | sparc64-*-solaris2*)
tm_file=sparc/sol2-sld-64.h
fi
xm_defines=POSIX
tmake_file="sparc/t-sol2 sparc/t-sol2-64"
tmake_file="sparc/t-sol2 sparc/t-sol2-64 sparc/t-crtfm"
if test x$gnu_ld = xyes; then
tmake_file="$tmake_file t-slibgcc-elf-ver"
else
......@@ -3105,7 +3105,7 @@ sparcv9-*-solaris2* | sparc64-*-solaris2*)
sparc-hal-solaris2*)
xm_defines=POSIX
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h sparc/hal.h"
tmake_file="sparc/t-halos sparc/t-sol2"
tmake_file="sparc/t-halos sparc/t-sol2 sparc/t-crtfm"
if test x$gnu_ld = xyes; then
tmake_file="$tmake_file t-slibgcc-elf-ver"
else
......@@ -3130,7 +3130,7 @@ sparc-*-solaris2*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h sparc/sol2-sld.h"
fi
xm_defines=POSIX
tmake_file=sparc/t-sol2
tmake_file="sparc/t-sol2 sparc/t-crtfm"
if test x$gnu_ld = xyes; then
tmake_file="$tmake_file t-slibgcc-elf-ver"
else
......
/*
* Copyright (C) 2001 Free Software Foundation, Inc.
* Contributed by David S. Miller (davem@redhat.com)
*
* This file is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* In addition to the permissions in the GNU General Public License, the
* Free Software Foundation gives you unlimited permission to link the
* compiled version of this file with other programs, and to distribute
* those programs without any restriction coming from the use of this
* file. (The General Public License restrictions do apply in other
* respects; for example, they cover modification of the file, and
* distribution when not linked into another program.)
*
* This file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* As a special exception, if you link this library with files
* compiled with GCC to produce an executable, this does not cause
* the resulting executable to be covered by the GNU General Public License.
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*/
#define FPRS_NS (1 << 22) /* Non-Standard fpu results */
static void __attribute__((constructor))
set_fast_math (void)
{
unsigned long fsr;
/* This works for the 64-bit case because, even if 32-bit ld/st of
the fsr register modified the upper 32-bit, the only thing up there
are the 3 other condition codes which are "do not care" at the time
that this runs. */
__asm__("st %%fsr, %0"
: "=m" (fsr));
fsr |= FPRS_NS;
__asm__("ld %0, %%fsr"
: : "m" (fsr));
}
......@@ -26,7 +26,9 @@ Boston, MA 02111-1307, USA. */
#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
#define ENDFILE_SPEC \
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
crtend.o%s crtn.o%s"
/* Use the default. */
#undef LINK_SPEC
......
......@@ -64,7 +64,8 @@ Boston, MA 02111-1307, USA. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
/* This is for -profile to use -lc_p instead of -lc. */
#undef CC1_SPEC
......
......@@ -104,23 +104,28 @@ Boston, MA 02111-1307, USA. */
#define ENDFILE_SPEC64 \
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s"
#define ENDFILE_SPEC_COMMON \
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
#ifdef SPARC_BI_ARCH
#if DEFAULT_ARCH32_P
#define ENDFILE_SPEC "\
%{m32:" ENDFILE_SPEC32 "} \
%{m64:" ENDFILE_SPEC64 "} \
%{!m32:%{!m64:" ENDFILE_SPEC32 "}}"
%{!m32:%{!m64:" ENDFILE_SPEC32 "}} " \
ENDFILE_SPEC_COMMON
#else
#define ENDFILE_SPEC "\
%{m32:" ENDFILE_SPEC32 "} \
%{m64:" ENDFILE_SPEC64 "} \
%{!m32:%{!m64:" ENDFILE_SPEC64 "}}"
%{!m32:%{!m64:" ENDFILE_SPEC64 "}} " \
ENDFILE_SPEC_COMMON
#endif
#else
#define ENDFILE_SPEC ENDFILE_SPEC64
#define ENDFILE_SPEC ENDFILE_SPEC64 " " ENDFILE_SPEC_COMMON
#endif
......
......@@ -160,7 +160,9 @@ Boston, MA 02111-1307, USA. */
%{p|pg:-ldl} -lc}}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
#define ENDFILE_SPEC \
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
crtend.o%s crtn.o%s"
/* This should be the same as in svr4.h, except with -R added. */
#undef LINK_SPEC
......
......@@ -71,7 +71,9 @@ crtbegin.o%s \
"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s"
#define ENDFILE_SPEC \
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
crtend.o%s"
/* Use the default (for now). */
#undef LIB_SPEC
......
EXTRA_PARTS += crtfastmath.o
crtfastmath.o: $(srcdir)/config/sparc/crtfastmath.c $(GCC_PASSES)
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o crtfastmath.o $(srcdir)/config/sparc/crtfastmath.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