1 //===-- save_restore_regs.S - Implement save/restore* ---------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "../assembly.h"
13 // When compiling C++ functions that need to handle thrown exceptions the
14 // compiler is required to save all registers and call __Unwind_SjLj_Register
15 // in the function prolog. But when compiling for thumb1, there are
16 // no instructions to access the floating point registers, so the
17 // compiler needs to add a call to the helper function _save_vfp_d8_d15_regs
18 // written in ARM to save the float registers. In the epilog, the compiler
19 // must also add a call to __restore_vfp_d8_d15_regs to restore those registers.
26 // Restore registers d8-d15 from stack
29 DEFINE_COMPILERRT_PRIVATE_FUNCTION(__restore_vfp_d8_d15_regs)
30 vldmia sp!, {d8-d15} // pop registers d8-d15 off stack
31 bx lr // return to prolog
32 END_COMPILERRT_FUNCTION(__restore_vfp_d8_d15_regs)