summaryrefslogtreecommitdiffstats
path: root/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-11-11 15:13:11 +0000
committered <ed@FreeBSD.org>2010-11-11 15:13:11 +0000
commit870837e3e92f721a44db51308f2b900d928fb04f (patch)
tree9f851f7f6da4a4d9010d26bf17881d3bc5320f2b /contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S
parenta1b6fa69a6f674978270e402b8bba6552e152066 (diff)
parent653bb6745595746d04ad4acacaaab66caaaeb69b (diff)
downloadFreeBSD-src-870837e3e92f721a44db51308f2b900d928fb04f.zip
FreeBSD-src-870837e3e92f721a44db51308f2b900d928fb04f.tar.gz
Import libcompiler_rt into HEAD and add Makefiles.
Obtained from: user/ed/compiler-rt
Diffstat (limited to 'contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S')
-rw-r--r--contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S35
1 files changed, 35 insertions, 0 deletions
diff --git a/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S b/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S
new file mode 100644
index 0000000..92de61b
--- /dev/null
+++ b/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S
@@ -0,0 +1,35 @@
+//===-- save_restore_regs.S - Implement save/restore* ---------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "../assembly.h"
+
+//
+// When compiling C++ functions that need to handle thrown exceptions the
+// compiler is required to save all registers and call __Unwind_SjLj_Register
+// in the function prolog. But when compiling for thumb1, there are
+// no instructions to access the floating point registers, so the
+// compiler needs to add a call to the helper function _save_vfp_d8_d15_regs
+// written in ARM to save the float registers. In the epilog, the compiler
+// must also add a call to __restore_vfp_d8_d15_regs to restore those registers.
+//
+
+ .text
+ .syntax unified
+
+//
+// Save registers d8-d15 onto stack
+//
+ .align 2
+DEFINE_COMPILERRT_PRIVATE_FUNCTION(__save_vfp_d8_d15_regs)
+ vstmdb sp!, {d8-d15} // push registers d8-d15 onto stack
+ bx lr // return to prolog
+
+ // tell linker it can break up file at label boundaries
+ .subsections_via_symbols
+
OpenPOWER on IntegriCloud