mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-11 10:25:41 +00:00
Lazy compilation callback save / restore VFP registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59274 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -60,6 +60,9 @@ extern "C" {
|
|||||||
// whole compilation callback doesn't exist as far as the caller is
|
// whole compilation callback doesn't exist as far as the caller is
|
||||||
// concerned, so we can't just preserve the callee saved regs.
|
// concerned, so we can't just preserve the callee saved regs.
|
||||||
"stmdb sp!, {r0, r1, r2, r3, lr}\n"
|
"stmdb sp!, {r0, r1, r2, r3, lr}\n"
|
||||||
|
#ifdef __APPLE__
|
||||||
|
"fstmfdd sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n"
|
||||||
|
#endif
|
||||||
// The LR contains the address of the stub function on entry.
|
// The LR contains the address of the stub function on entry.
|
||||||
// pass it as the argument to the C part of the callback
|
// pass it as the argument to the C part of the callback
|
||||||
"mov r0, lr\n"
|
"mov r0, lr\n"
|
||||||
@@ -77,8 +80,14 @@ extern "C" {
|
|||||||
// +--------+
|
// +--------+
|
||||||
// 1 | LR | Stub address (start of stub)
|
// 1 | LR | Stub address (start of stub)
|
||||||
// 2-5 | R3..R0 | Saved registers (we need to preserve all regs)
|
// 2-5 | R3..R0 | Saved registers (we need to preserve all regs)
|
||||||
|
// 6-20 | D0..D7 | Saved VFP registers
|
||||||
// +--------+
|
// +--------+
|
||||||
//
|
//
|
||||||
|
#ifdef __APPLE__
|
||||||
|
// Restore VFP caller-saved registers.
|
||||||
|
"fldmfdd sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n"
|
||||||
|
#endif
|
||||||
|
//
|
||||||
// We need to exchange the values in slots 0 and 1 so we can
|
// We need to exchange the values in slots 0 and 1 so we can
|
||||||
// return to the address in slot 1 with the address in slot 0
|
// return to the address in slot 1 with the address in slot 0
|
||||||
// restored to the LR.
|
// restored to the LR.
|
||||||
|
Reference in New Issue
Block a user