1 /* This file contains the floating-point save and restore routines.
3 * Copyright (C) 2004-2013 Free Software Foundation, Inc.
5 * This file is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 3, or (at your option) any
10 * This file is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * Under Section 7 of GPL version 3, you are granted additional
16 * permissions described in the GCC Runtime Library Exception, version
17 * 3.1, as published by the Free Software Foundation.
19 * You should have received a copy of the GNU General Public License and
20 * a copy of the GCC Runtime Library Exception along with this program;
21 * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 * <http://www.gnu.org/licenses/>.
25 /* THE SAVE AND RESTORE ROUTINES CAN HAVE ONLY ONE GLOBALLY VISIBLE
26 ENTRY POINT - callers have to jump to "saveFP+60" to save f29..f31,
27 for example. For FP reg saves/restores, it takes one instruction
28 (4 bytes) to do the operation; for Vector regs, 2 instructions are
31 MORAL: DO NOT MESS AROUND WITH THESE FUNCTIONS! */
33 #include "darwin-asm.h"
38 /* saveFP saves R0 -- assumed to be the callers LR -- to 8/16(R1). */
40 .private_extern saveFP
60 stg r0,SAVED_LR_OFFSET(r1)
63 /* restFP restores the caller`s LR from 8/16(R1). Note that the code for
64 this starts at the offset of F30 restoration, so calling this
65 routine in an attempt to restore only F31 WILL NOT WORK (it would
66 be a stupid thing to do, anyway.) */
68 .private_extern restFP
86 /* <OFFSET OF F30 RESTORE> restore callers LR */
87 lg r0,SAVED_LR_OFFSET(r1)
89 /* and prepare for return to caller */