aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2015-05-06 12:01:05 -0400
committerSandra Loosemore <sandra@gcc.gnu.org>2015-05-06 12:01:05 -0400
commit5a0ff57c48cbaeedfac667d5e808baca8dbcb83c (patch)
treea9fc9cd0a5bcc2c76ff3803079fb8a0b0254fb94 /libgcc/config
parent29e597d0e6c853b1487ee86357df704a5e0ab618 (diff)
downloadgcc-5a0ff57c48cbaeedfac667d5e808baca8dbcb83c.zip
gcc-5a0ff57c48cbaeedfac667d5e808baca8dbcb83c.tar.gz
gcc-5a0ff57c48cbaeedfac667d5e808baca8dbcb83c.tar.bz2
unknown-elf.h (STARTFILE_SPEC): Add conditional linking of crtfastmath.o.
2015-05-06 Sandra Loosemore <sandra@codesourcery.com> Chris Jones <chrisj@nvidia.com> Joshua Conner <jconner@nvidia.com> gcc/ * config/arm/unknown-elf.h (STARTFILE_SPEC): Add conditional linking of crtfastmath.o. * config/arm/linux-eabi.h (STARTFILE_SPEC): Likewise. libgcc/ * config.host (arm*-*-linux*): Add support for crtfastmath.o. (arm*-*-uclinux*): Likewise. (arm*-*-eabi* | arm*-*-rtems*): Likewise. * config/arm/crtfastmath.c: New file. Co-Authored-By: Chris Jones <chrisj@nvidia.com> Co-Authored-By: Joshua Conner <jconner@nvidia.com> From-SVN: r222857
Diffstat (limited to 'libgcc/config')
-rw-r--r--libgcc/config/arm/crtfastmath.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/libgcc/config/arm/crtfastmath.c b/libgcc/config/arm/crtfastmath.c
new file mode 100644
index 0000000..9573514
--- /dev/null
+++ b/libgcc/config/arm/crtfastmath.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2014 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/>.
+ */
+
+/* Enable flush-to-zero support for -ffast-math on VFP targets. */
+#ifndef __SOFTFP__
+
+#define FPSCR_FZ (1 << 24)
+
+static void __attribute__((constructor))
+__arm_set_fast_math (void)
+{
+ unsigned int fpscr_save;
+
+ /* Set the FZ (flush-to-zero) bit in FPSCR. */
+ __asm__("vmrs %0, fpscr" : "=r" (fpscr_save));
+ fpscr_save |= FPSCR_FZ;
+ __asm__("vmsr fpscr, %0" : : "r" (fpscr_save));
+}
+
+#endif /* __SOFTFP__ */