summaryrefslogtreecommitdiff
path: root/libgcc/config/arm
diff options
context:
space:
mode:
authorsandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-06 16:01:05 +0000
committersandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>2015-05-06 16:01:05 +0000
commit1ddaa252d0d1cbf4999cf0f8798fd9261447b693 (patch)
treea9fc9cd0a5bcc2c76ff3803079fb8a0b0254fb94 /libgcc/config/arm
parentb176768d9df248307470ac0db8b8c98ccd93aa71 (diff)
downloadgcc-1ddaa252d0d1cbf4999cf0f8798fd9261447b693.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc/config/arm')
-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 00000000000..9573514961e
--- /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__ */