save_vfp_d8_d15_regs.S 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. //===-- save_restore_regs.S - Implement save/restore* ---------------------===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "../assembly.h"
  9. //
  10. // When compiling C++ functions that need to handle thrown exceptions the
  11. // compiler is required to save all registers and call __Unwind_SjLj_Register
  12. // in the function prolog. But when compiling for thumb1, there are
  13. // no instructions to access the floating point registers, so the
  14. // compiler needs to add a call to the helper function _save_vfp_d8_d15_regs
  15. // written in ARM to save the float registers. In the epilog, the compiler
  16. // must also add a call to __restore_vfp_d8_d15_regs to restore those registers.
  17. //
  18. .text
  19. .syntax unified
  20. //
  21. // Save registers d8-d15 onto stack
  22. //
  23. .p2align 2
  24. DEFINE_COMPILERRT_PRIVATE_FUNCTION(__save_vfp_d8_d15_regs)
  25. vstmdb sp!, {d8-d15} // push registers d8-d15 onto stack
  26. bx lr // return to prolog
  27. END_COMPILERRT_FUNCTION(__save_vfp_d8_d15_regs)
  28. NO_EXEC_STACK_DIRECTIVE