diff options
author | Nick Kledzik <kledzik@apple.com> | 2009-10-29 22:31:39 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2009-10-29 22:31:39 +0000 |
commit | 670d09f2bd1e8830cdb17b628a8d33012bf6af6a (patch) | |
tree | 4251bd6a00692713d2672c0401b15f554d4e76f7 /lib/arm | |
parent | fb0e92637bf32a414114a6541d5436f462343a7f (diff) |
add __save_vfp_d8_d15_regs and __restore_vfp_d8_d15_regs for ARM
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@85531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/arm')
-rw-r--r-- | lib/arm/save_restore_d8_d15.S | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/arm/save_restore_d8_d15.S b/lib/arm/save_restore_d8_d15.S new file mode 100644 index 000000000..3ff0b4133 --- /dev/null +++ b/lib/arm/save_restore_d8_d15.S @@ -0,0 +1,45 @@ +//===-- 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 +// +DEFINE_COMPILERRT_PRIVATE_FUNCTION(__save_vfp_d8_d15_regs) + vstmdb sp!, {d8-d15} // push registers d8-d15 onto stack + bx lr // return to prolog + + + +// +// Restore registers d8-d15 from stack +// +DEFINE_COMPILERRT_PRIVATE_FUNCTION(__restore_vfp_d8_d15_regs) + vldmia sp!, {d8-d15} // pop registers d8-d15 off stack + bx lr // return to prolog + + + + // tell linker it can break up file at label boundaries + .subsections_via_symbols + |