From 567d20f046c31dde4949a293069879b8ac246d2a Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 23 Jun 2001 19:05:06 -0700 Subject: [PATCH] crtfastmath.c: New file. * config/alpha/crtfastmath.c: New file. * config/alpha/t-crtfm: New file. * config/alpha/elf.h (ENDFILE_SPEC): Use crtfastmath.o. * config/alpha/osf.h (ENDFILE_SPEC): Likewise. * config/alpha/t-crtbe (EXTRA_PARTS): Add pieces defined here. * config.gcc (alpha-{linux,freebsd,netbsd,osf}): Use alpha/t-crtfm; do not set extra_parts here. From-SVN: r43537 --- gcc/ChangeLog | 10 ++++++++ gcc/config.gcc | 13 ++++------ gcc/config/alpha/crtfastmath.c | 46 ++++++++++++++++++++++++++++++++++ gcc/config/alpha/elf.h | 3 ++- gcc/config/alpha/osf.h | 3 +++ gcc/config/alpha/t-crtbe | 2 ++ gcc/config/alpha/t-crtfm | 4 +++ 7 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 gcc/config/alpha/crtfastmath.c create mode 100644 gcc/config/alpha/t-crtfm diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f0d23dd4dfb..b5acd57cff2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2001-06-23 Richard Henderson + + * config/alpha/crtfastmath.c: New file. + * config/alpha/t-crtfm: New file. + * config/alpha/elf.h (ENDFILE_SPEC): Use crtfastmath.o. + * config/alpha/osf.h (ENDFILE_SPEC): Likewise. + * config/alpha/t-crtbe (EXTRA_PARTS): Add pieces defined here. + * config.gcc (alpha-{linux,freebsd,netbsd,osf}): Use alpha/t-crtfm; + do not set extra_parts here. + 2001-06-24 Joseph S. Myers * doc/install-old.texi: Remove more documentation of configure diff --git a/gcc/config.gcc b/gcc/config.gcc index 3f708a4df7f..df9f3c765db 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -430,8 +430,7 @@ alpha*-*-linux*ecoff*) alpha*-*-linux*libc1*) tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h" target_cpu_default="MASK_GAS" - tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-ieee" - extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-crtfm alpha/t-ieee" gas=yes gnu_ld=yes if test x$enable_threads = xyes; then thread_file='posix' @@ -440,8 +439,7 @@ alpha*-*-linux*libc1*) alpha*-*-linux*) tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h" target_cpu_default="MASK_GAS" - tmake_file="t-slibgcc-elf-ver t-linux alpha/t-crtbe alpha/t-alpha alpha/t-ieee" - extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + tmake_file="t-slibgcc-elf-ver t-linux alpha/t-crtbe alpha/t-crtfm alpha/t-alpha alpha/t-ieee" gas=yes gnu_ld=yes if test x$enable_threads = xyes; then thread_file='posix' @@ -450,14 +448,13 @@ alpha*-*-linux*) alpha*-*-freebsd*) tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h" target_cpu_default="MASK_GAS" - tmake_file="${tmake_file} alpha/t-crtbe alpha/t-alpha alpha/t-ieee" + tmake_file="${tmake_file} alpha/t-crtbe alpha/t-crtfm alpha/t-alpha alpha/t-ieee" ;; alpha*-*-netbsd*) xm_defines=POSIX tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h" target_cpu_default="MASK_GAS" - tmake_file="alpha/t-crtbe alpha/t-alpha alpha/t-ieee" - extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" + tmake_file="alpha/t-crtbe alpha/t-crtfm alpha/t-alpha alpha/t-ieee" gas=yes gnu_ld=yes ;; @@ -478,7 +475,7 @@ alpha*-dec-osf*) extra_passes="mips-tfile mips-tdump" fi use_collect2=yes - tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-osf" + tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-osf alpha/t-crtfm" case $machine in *-*-osf1*) tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h" diff --git a/gcc/config/alpha/crtfastmath.c b/gcc/config/alpha/crtfastmath.c new file mode 100644 index 00000000000..4651ee7899f --- /dev/null +++ b/gcc/config/alpha/crtfastmath.c @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2001 Free Software Foundation, Inc. + * Contributed by Richard Henderson (rth@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. + */ + +/* Assume OSF/1 compatible interfaces. */ + +extern void __ieee_set_fp_control (unsigned long int); + +#define IEEE_MAP_DMZ (1UL<<12) /* Map denorm inputs to zero */ +#define IEEE_MAP_UMZ (1UL<<13) /* Map underflowed outputs to zero */ + +static void __attribute__((constructor)) +set_fast_math (void) +{ + __ieee_set_fp_control (IEEE_MAP_DMZ | IEEE_MAP_UMZ); +} diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h index a77a64328d9..dbec2b487f3 100644 --- a/gcc/config/alpha/elf.h +++ b/gcc/config/alpha/elf.h @@ -677,7 +677,8 @@ void FN () \ #undef ENDFILE_SPEC #define ENDFILE_SPEC \ - "%{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s" + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + %{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s" /* We support #pragma. */ #define HANDLE_SYSV_PRAGMA diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h index 1aecf33ad39..24ebaf6aa3f 100644 --- a/gcc/config/alpha/osf.h +++ b/gcc/config/alpha/osf.h @@ -68,6 +68,9 @@ Boston, MA 02111-1307, USA. */ #define STARTFILE_SPEC \ "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}" +#define ENDFILE_SPEC \ + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" + #define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/" #define ASM_FILE_START(FILE) \ diff --git a/gcc/config/alpha/t-crtbe b/gcc/config/alpha/t-crtbe index 27e402747d5..384237b1c9c 100644 --- a/gcc/config/alpha/t-crtbe +++ b/gcc/config/alpha/t-crtbe @@ -1,6 +1,8 @@ # Effectively disable the crtbegin/end rules using crtstuff.c T = disable +EXTRA_PARTS += crtbegin.o crtend.o crtbeginS.o crtendS.o + # Assemble startup files. crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES) $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm diff --git a/gcc/config/alpha/t-crtfm b/gcc/config/alpha/t-crtfm new file mode 100644 index 00000000000..7076b517861 --- /dev/null +++ b/gcc/config/alpha/t-crtfm @@ -0,0 +1,4 @@ +EXTRA_PARTS += crtfastmath.o + +crtfastmath.o: $(srcdir)/config/alpha/crtfastmath.c $(GCC_PASSES) + $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o crtfastmath.o $(srcdir)/config/alpha/crtfastmath.c -- 2.30.2