2009-10-30 06:31:39 +08:00
|
|
|
//===-- save_restore_regs.S - Implement save/restore* ---------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2010-11-17 06:13:33 +08:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2009-10-30 06:31:39 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "../assembly.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// When compiling C++ functions that need to handle thrown exceptions the
|
2010-01-19 08:01:10 +08:00
|
|
|
// compiler is required to save all registers and call __Unwind_SjLj_Register
|
|
|
|
// in the function prolog. But when compiling for thumb1, there are
|
2009-10-30 06:31:39 +08:00
|
|
|
// 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
|
2010-01-19 08:01:10 +08:00
|
|
|
// written in ARM to save the float registers. In the epilog, the compiler
|
2009-10-30 06:31:39 +08:00
|
|
|
// must also add a call to __restore_vfp_d8_d15_regs to restore those registers.
|
|
|
|
//
|
|
|
|
|
|
|
|
.text
|
2010-01-19 08:01:10 +08:00
|
|
|
.syntax unified
|
2009-10-30 06:31:39 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// Save registers d8-d15 onto stack
|
|
|
|
//
|
2014-05-12 23:23:37 +08:00
|
|
|
.p2align 2
|
2009-10-30 06:31:39 +08:00
|
|
|
DEFINE_COMPILERRT_PRIVATE_FUNCTION(__save_vfp_d8_d15_regs)
|
|
|
|
vstmdb sp!, {d8-d15} // push registers d8-d15 onto stack
|
|
|
|
bx lr // return to prolog
|
2014-01-24 22:33:42 +08:00
|
|
|
END_COMPILERRT_FUNCTION(__save_vfp_d8_d15_regs)
|
2009-10-30 06:31:39 +08:00
|
|
|
|