1 //===-- save_restore_regs.S - Implement save/restore* ---------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "../assembly.h"
12 // When compiling C++ functions that need to handle thrown exceptions the
13 // compiler is required to save all registers and call __Unwind_SjLj_Register
14 // in the function prolog. But when compiling for thumb1, there are
15 // no instructions to access the floating point registers, so the
16 // compiler needs to add a call to the helper function _save_vfp_d8_d15_regs
17 // written in ARM to save the float registers. In the epilog, the compiler
18 // must also add a call to __restore_vfp_d8_d15_regs to restore those registers.
25 // Save registers d8-d15 onto stack
28 DEFINE_COMPILERRT_PRIVATE_FUNCTION(__save_vfp_d8_d15_regs)
29 vstmdb sp!, {d8-d15} // push registers d8-d15 onto stack
30 bx lr // return to prolog
31 END_COMPILERRT_FUNCTION(__save_vfp_d8_d15_regs)
33 NO_EXEC_STACK_DIRECTIVE