summaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-13 17:39:35 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-13 17:39:35 +0000
commitba079bc9bb8a670aaaab681d6dc9cb586f54e789 (patch)
tree69146b101b02ce0507a1a190b64c68ba7f4876bc /libgcc
parent1125ba8353fe7c4fa26f72ca22b970bfef27ce5b (diff)
downloadgcc-ba079bc9bb8a670aaaab681d6dc9cb586f54e789.tar.gz
gcc:
* config/i386/crtprec.c: Move to ../libgcc/config/i386. * config/i386/t-crtpc: Remove. * config/t-darwin (EXTRA_MULTILIB_PARTS): Remove. * config.gcc (i[34567]86-*-darwin*): Remove i386/t-crtpc from tmake_file. (x86_64-*-darwin*): Likewise. (i[34567]86-*-linux*): Likewise. (x86_64-*-linux*): Likewise. * config/i386/sol2.h (ENDFILE_SPEC): Redefine. Handle -mpc32, -mpc64, -mpc80. libgcc: * config/i386/crtprec.c: New file. * config/i386/t-crtpc: Use $(srcdir) to refer to crtprec.c. * config.host (i[34567]86-*-darwin*): Add i386/t-crtpc to tmake_file. Add crtprec32.o, crtprec64.o, crtprec80.o to extra_parts. (x86_64-*-darwin*): Likewise. (i[34567]86-*-solaris2*: Likewise. gcc/testsuite: * gcc.c-torture/execute/990127-2.x: Use -mpc64 on i?86-*-darwin*, i?86-*-solaris2*, x86_64-*-darwin*, x86_64-*-solaris2*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176242 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog9
-rw-r--r--libgcc/config.host12
-rw-r--r--libgcc/config/i386/crtprec.c47
-rw-r--r--libgcc/config/i386/t-crtpc6
4 files changed, 65 insertions, 9 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 401287cfb06..49fed6ef5c1 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,5 +1,14 @@
2011-07-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ * config/i386/crtprec.c: New file.
+ * config/i386/t-crtpc: Use $(srcdir) to refer to crtprec.c.
+ * config.host (i[34567]86-*-darwin*): Add i386/t-crtpc to tmake_file.
+ Add crtprec32.o, crtprec64.o, crtprec80.o to extra_parts.
+ (x86_64-*-darwin*): Likewise.
+ (i[34567]86-*-solaris2*: Likewise.
+
+2011-07-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
* config/alpha/crtfastmath.c: New file.
* config/i386/crtfastmath.c: New file.
* config/ia64/crtfastmath.c: New file.
diff --git a/libgcc/config.host b/libgcc/config.host
index fba7ecd67ab..63c4dcc34ab 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -325,12 +325,12 @@ hppa[12]*-*-hpux11*)
md_unwind_header=pa/hpux-unwind.h
;;
i[34567]86-*-darwin*)
- tmake_file="$tmake_file i386/t-crtfm"
- extra_parts="$extra_parts crtfastmath.o"
+ tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
x86_64-*-darwin*)
- tmake_file="t-darwin ${cpu_type}/t-darwin64 i386/t-crtfm t-slibgcc-darwin"
- extra_parts="$extra_parts crtfastmath.o"
+ tmake_file="t-darwin ${cpu_type}/t-darwin64 i386/t-crtpc i386/t-crtfm t-slibgcc-darwin"
+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
i[34567]86-*-elf*)
;;
@@ -387,8 +387,8 @@ i[34567]86-*-rtems*)
tmake_file="${tmake_file} t-crtin i386/t-softfp i386/t-crtstuff t-rtems"
;;
i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
- tmake_file="$tmake_file i386/t-crtfm"
- extra_parts="$extra_parts crtfastmath.o"
+ tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+ extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
md_unwind_header=i386/sol2-unwind.h
;;
i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
diff --git a/libgcc/config/i386/crtprec.c b/libgcc/config/i386/crtprec.c
new file mode 100644
index 00000000000..4f42a8fa1c1
--- /dev/null
+++ b/libgcc/config/i386/crtprec.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2007, 2009 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 3, or (at your option) any
+ * later version.
+ *
+ * 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.
+ *
+ * Under Section 7 of GPL version 3, you are granted additional
+ * permissions described in the GCC Runtime Library Exception, version
+ * 3.1, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License and
+ * a copy of the GCC Runtime Library Exception along with this program;
+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#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));
+}
diff --git a/libgcc/config/i386/t-crtpc b/libgcc/config/i386/t-crtpc
index c231ce195f2..b605f6f7930 100644
--- a/libgcc/config/i386/t-crtpc
+++ b/libgcc/config/i386/t-crtpc
@@ -1,8 +1,8 @@
-crtprec32.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec32.o: $(srcdir)/config/i386/crtprec.c
$(gcc_compile) -D__PREC=32 -c $<
-crtprec64.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec64.o: $(srcdir)/config/i386/crtprec.c
$(gcc_compile) -D__PREC=64 -c $<
-crtprec80.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec80.o: $(srcdir)/config/i386/crtprec.c
$(gcc_compile) -D__PREC=80 -c $<