brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · fd6d59b Raw
35 lines · plain
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-exception6//7//===----------------------------------------------------------------------===//8 9#include "../assembly.h"10 11//12// When compiling C++ functions that need to handle thrown exceptions the13// compiler is required to save all registers and call __Unwind_SjLj_Register14// in the function prolog.  But when compiling for thumb1, there are15// no instructions to access the floating point registers, so the16// compiler needs to add a call to the helper function _save_vfp_d8_d15_regs17// written in ARM to save the float registers.  In the epilog, the compiler18// must also add a call to __restore_vfp_d8_d15_regs to restore those registers.19//20 21	.text22	.syntax unified23 24//25// Restore registers d8-d15 from stack26//27	.p2align 228DEFINE_COMPILERRT_PRIVATE_FUNCTION(__restore_vfp_d8_d15_regs)29	vldmia	sp!, {d8-d15}           // pop registers d8-d15 off stack30	bx      lr                      // return to prolog31END_COMPILERRT_FUNCTION(__restore_vfp_d8_d15_regs)32 33NO_EXEC_STACK_DIRECTIVE34 35