save_vfp_d8_d15_regs.S revision 215125
11573Srgrimes//===-- save_restore_regs.S - Implement save/restore* ---------------------===//
21573Srgrimes//
31573Srgrimes//                     The LLVM Compiler Infrastructure
41573Srgrimes//
51573Srgrimes// This file is distributed under the University of Illinois Open Source
61573Srgrimes// License. See LICENSE.TXT for details.
71573Srgrimes//
81573Srgrimes//===----------------------------------------------------------------------===//
91573Srgrimes
101573Srgrimes#include "../assembly.h"
111573Srgrimes
121573Srgrimes//
131573Srgrimes// When compiling C++ functions that need to handle thrown exceptions the
141573Srgrimes// compiler is required to save all registers and call __Unwind_SjLj_Register
151573Srgrimes// in the function prolog.  But when compiling for thumb1, there are
161573Srgrimes// no instructions to access the floating point registers, so the
171573Srgrimes// compiler needs to add a call to the helper function _save_vfp_d8_d15_regs
181573Srgrimes// written in ARM to save the float registers.  In the epilog, the compiler
191573Srgrimes// must also add a call to __restore_vfp_d8_d15_regs to restore those registers.
201573Srgrimes//
211573Srgrimes
221573Srgrimes	.text
231573Srgrimes	.syntax unified
241573Srgrimes
251573Srgrimes//
261573Srgrimes// Save registers d8-d15 onto stack
271573Srgrimes//
281573Srgrimes	.align 2
291573SrgrimesDEFINE_COMPILERRT_PRIVATE_FUNCTION(__save_vfp_d8_d15_regs)
301573Srgrimes	vstmdb	sp!, {d8-d15}           // push registers d8-d15 onto stack
311573Srgrimes	bx      lr                      // return to prolog
321573Srgrimes
331573Srgrimes	// tell linker it can break up file at label boundaries
341573Srgrimes	.subsections_via_symbols
351573Srgrimes
361573Srgrimes