add __save_vfp_d8_d15_regs and __restore_vfp_d8_d15_regs for ARM

llvm-svn: 85531
This commit is contained in:
Nick Kledzik 2009-10-29 22:31:39 +00:00
parent 554a75a973
commit d4b78d38d4
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,45 @@
//===-- save_restore_regs.S - Implement save/restore* ---------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "../assembly.h"
//
// When compiling C++ functions that need to handle thrown exceptions the
// compiler is required to save all registers and call __Unwind_SjLj_Register
// in the function prolog. But when compiling for thumb1, there are
// 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
// written in ARM to save the float registers. In the epilog, the compiler
// must also add a call to __restore_vfp_d8_d15_regs to restore those registers.
//
.text
.syntax unified
//
// Save registers d8-d15 onto stack
//
DEFINE_COMPILERRT_PRIVATE_FUNCTION(__save_vfp_d8_d15_regs)
vstmdb sp!, {d8-d15} // push registers d8-d15 onto stack
bx lr // return to prolog
//
// Restore registers d8-d15 from stack
//
DEFINE_COMPILERRT_PRIVATE_FUNCTION(__restore_vfp_d8_d15_regs)
vldmia sp!, {d8-d15} // pop registers d8-d15 off stack
bx lr // return to prolog
// tell linker it can break up file at label boundaries
.subsections_via_symbols

View File

@ -58,7 +58,7 @@ Funcs_armv6 = adddf3vfp.o addsf3vfp.o bswapdi2.o bswapsi2.o divdf3vfp.o \
muldf3vfp.o mulsf3vfp.o \
nedf2vfp.o negdf2vfp.o negsf2vfp.o nesf2vfp.o \
subdf3vfp.o subsf3vfp.o truncdfsf2vfp.o unorddf2vfp.o unordsf2vfp.o \
modsi3.o umodsi3.o udivsi3.o divsi3.o switch.o
modsi3.o umodsi3.o udivsi3.o divsi3.o switch.o save_restore_d8_d15.o
# copies any public headers to DSTROOT