config.gcc (i[34567]86-*-linux*): Add i386/t-crtpc to tm-file.

* config.gcc (i[34567]86-*-linux*): Add i386/t-crtpc to tm-file.
	(x86_64-*-linux*): Ditto.
	* config/i386/i386.opt (mpc): New option.
	* config/i386/i386.c (overrride_options): Handle
	ix87_precision_string.
	* config/i386/crtprec.c: New file.
	* config/i386/t-crtpc: Ditto.
	* config/i386/linux.h (ENDFILE_SPEC): Add handling of -mpc32, -mpc64
	and -mpc80 options.
	* config/i386/linux64.h (ENDFILE_SPEC): Ditto.
	* config/i386/t-linux64 (EXTRA_MULTILIB_PARTS): Add
	crtprec32.o, crtprec64.o and crtprec80.o.

	* doc/invoke.texi (Machine Dependent Options): Add -mpc32, -mpc64
	and -mpc80 options.
	(i386 and x86-64 Options): Document -mpc32, -mpc64 and -mpc80 options.

libgcc/ChangeLog:

	* config/i386/t-crtpc: New file.
	* config.host (i[34567]86-*-linux*): Add i386/t-crtpc to tm-file.
        (x86_64-*-linux*): Ditto.

From-SVN: r123450
This commit is contained in:
Uros Bizjak 2007-04-03 09:37:56 +02:00
parent 8854e14c61
commit 577565f934
13 changed files with 148 additions and 9 deletions

View file

@ -1,3 +1,22 @@
2007-04-03 Uros Bizjak <ubizjak@gmail.com>
* config.gcc (i[34567]86-*-linux*): Add i386/t-crtpc to tm-file.
(x86_64-*-linux*): Ditto.
* config/i386/i386.opt (mpc): New option.
* config/i386/i386.c (overrride_options): Handle
ix87_precision_string.
* config/i386/crtprec.c: New file.
* config/i386/t-crtpc: Ditto.
* config/i386/linux.h (ENDFILE_SPEC): Add handling of -mpc32, -mpc64
and -mpc80 options.
* config/i386/linux64.h (ENDFILE_SPEC): Ditto.
* config/i386/t-linux64 (EXTRA_MULTILIB_PARTS): Add
crtprec32.o, crtprec64.o and crtprec80.o.
* doc/invoke.texi (Machine Dependent Options): Add -mpc32, -mpc64
and -mpc80 options.
(i386 and x86-64 Options): Document -mpc32, -mpc64 and -mpc80 options.
2007-04-02 Eric Christopher <echristo@apple.com>
* doc/invoke.texi (i386 and x86-64 Options): Document -m64
@ -64,7 +83,7 @@
(call_value): Likewise.
2007-03-31 Wolfgang Bangerth <bangerth@dealii.org>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 14737
* doc/invoke.texi: (optimization options): Reword description

View file

@ -1147,7 +1147,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
i[34567]86-*-knetbsd*-gnu) tm_file="${tm_file} i386/linux.h knetbsd-gnu.h i386/knetbsd-gnu.h" ;;
i[34567]86-*-kfreebsd*-gnu) tm_file="${tm_file} i386/linux.h kfreebsd-gnu.h i386/kfreebsd-gnu.h" ;;
esac
tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtfm t-dfprules"
tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules"
;;
x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \
@ -1156,7 +1156,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;;
x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;;
esac
tmake_file="${tmake_file} i386/t-linux64 i386/t-crtfm t-dfprules"
tmake_file="${tmake_file} i386/t-linux64 i386/t-crtpc i386/t-crtfm t-dfprules"
;;
i[34567]86-*-gnu*)
;;

57
gcc/config/i386/crtprec.c Normal file
View file

@ -0,0 +1,57 @@
/*
* Copyright (C) 2007 Free Software Foundation, Inc.
*
* 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, 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, 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.
*/
#if __PREC == 32
#define X87CW (0 << 8) /* Single precision (24 bits) */
#elif __PREC == 64
#define X87CW (2 << 8) /* Double precision (53 bits) */
#elif __PREC == 80
#define X87CW (3 << 8) /* Extended precision (64 bits) */
#else
#error "Wrong precision requested."
#endif
#define X87CW_PCMASK (3 << 8)
static void __attribute__((constructor))
set_precision (void)
{
unsigned short int cwd;
asm volatile ("fstcw\t%0" : "=m" (cwd));
cwd &= ~X87CW_PCMASK;
cwd |= X87CW;
asm volatile ("fldcw\t%0" : : "m" (cwd));
}

View file

@ -2095,6 +2095,13 @@ override_options (void)
ix86_tls_dialect_string);
}
if (ix87_precision_string)
{
i = atoi (ix87_precision_string);
if (i != 32 && i != 64 && i != 80)
error ("pc%d is not valid precision setting (32, 64 or 80)", i);
}
/* Keep nonleaf frame pointers. */
if (flag_omit_frame_pointer)
target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER;

View file

@ -151,6 +151,10 @@ momit-leaf-frame-pointer
Target Report Mask(OMIT_LEAF_FRAME_POINTER)
Omit the frame pointer in leaf functions
mpc
Target RejectNegative Report Joined Var(ix87_precision_string)
Set 80387 floating-point precision (-mpc32, -mpc64, -mpc80)
mpentium
Target RejectNegative Undocumented
;; Deprecated

View file

@ -121,6 +121,9 @@ Boston, MA 02110-1301, USA. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{mpc32:crtprec32.o%s} \
%{mpc64:crtprec64.o%s} \
%{mpc80:crtprec80.o%s} \
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
/* A C statement (sans semicolon) to output to the stdio stream

View file

@ -78,6 +78,9 @@ Boston, MA 02110-1301, USA. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
%{mpc32:crtprec32.o%s} \
%{mpc64:crtprec64.o%s} \
%{mpc80:crtprec80.o%s} \
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
#if TARGET_64BIT_DEFAULT

16
gcc/config/i386/t-crtpc Normal file
View file

@ -0,0 +1,16 @@
EXTRA_PARTS += crtprec32.o crtprec64.o crtprec80.o
$(T)crtprec32.o: $(srcdir)/config/i386/crtprec.c $(GCC_PASSES)
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -D__PREC=32 -c \
$(srcdir)/config/i386/crtprec.c \
-o $(T)crtprec32$(objext)
$(T)crtprec64.o: $(srcdir)/config/i386/crtprec.c $(GCC_PASSES)
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -D__PREC=64 -c \
$(srcdir)/config/i386/crtprec.c \
-o $(T)crtprec64$(objext)
$(T)crtprec80.o: $(srcdir)/config/i386/crtprec.c $(GCC_PASSES)
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -D__PREC=80 -c \
$(srcdir)/config/i386/crtprec.c \
-o $(T)crtprec80$(objext)

View file

@ -12,7 +12,8 @@ LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o \
crtbeginT.o crtfastmath.o
crtbeginT.o crtprec32.o crtprec64.o crtprec80.o \
crtfastmath.o
# The pushl in CTOR initialization interferes with frame pointer elimination.
# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables,

View file

@ -548,7 +548,7 @@ Objective-C and Objective-C++ Dialects}.
-mthreads -mno-align-stringops -minline-all-stringops @gol
-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
-m96bit-long-double -mregparm=@var{num} -msseregparm @gol
-mstackrealign @gol
-mpc32 -mpc64 -mpc80 mstackrealign @gol
-momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol
-mcmodel=@var{code-model} @gol
-m32 -m64 -mlarge-data-threshold=@var{num}}
@ -10018,6 +10018,21 @@ function by using the function attribute @samp{sseregparm}.
modules with the same value, including any libraries. This includes
the system libraries and startup modules.
@item -mpc32
@itemx -mpc64
@itemx -mpc80
@opindex mpc32
@opindex mpc64
@opindex mpc80
Set 80387 floating-point precision to 32, 64 or 80 bits. When @option{-mpc32}
is specified, the significand of floating-point operations is rounded to 24
bits (single precision), @option{-mpc64} rounds the significand of
floating-point operations to 53 bits (double precision) and @option{-mpc80}
rounds the significand of floating-point operations to 64 bits (extended
double precision). Note that a change of default precision control may
affect the results returned by some of the mathematical functions.
@item -mstackrealign
@opindex mstackrealign
Realign the stack at entry. On the Intel x86, the

View file

@ -1,3 +1,9 @@
2007-04-03 Uros Bizjak <ubizjak@gmail.com>
* config/i386/t-crtpc: New file.
* config.host (i[34567]86-*-linux*): Add i386/t-crtpc to tm-file.
(x86_64-*-linux*): Ditto.
2007-02-30 Kai Tietz <kai.tietz@onevision.com>
* config.host (x86_64-*-mingw*): New target.

View file

@ -328,12 +328,12 @@ i[34567]86-*-openbsd*)
i[34567]86-*-coff*)
;;
i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu)
extra_parts="$extra_parts crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtfm"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
;;
x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
extra_parts="$extra_parts crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtfm"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm"
;;
i[34567]86-*-gnu*)
;;

View file

@ -0,0 +1,8 @@
crtprec32.o: $(gcc_srcdir)/config/i386/crtprec.c
$(gcc_compile) -D__PREC=32 -c $<
crtprec64.o: $(gcc_srcdir)/config/i386/crtprec.c
$(gcc_compile) -D__PREC=64 -c $<
crtprec80.o: $(gcc_srcdir)/config/i386/crtprec.c
$(gcc_compile) -D__PREC=80 -c $<