Add large frame support
This commit is contained in:
parent
a490f8c130
commit
0b019fa141
|
@ -3,10 +3,10 @@ Fri Dec 27 14:53:40 1996 Michael Meissner <meissner@tiktok.cygnus.com>
|
||||||
* v850-tdep.c (struct pifsr): Add cur_frameoffset field.
|
* v850-tdep.c (struct pifsr): Add cur_frameoffset field.
|
||||||
(v850_scan_prologue): Add debug code #ifdef'ed DEBUG. Support new
|
(v850_scan_prologue): Add debug code #ifdef'ed DEBUG. Support new
|
||||||
compiler prologues using register save functions and short store
|
compiler prologues using register save functions and short store
|
||||||
instructions.
|
instructions. Add support for functions with large stack frames.
|
||||||
|
|
||||||
* config/v850/tm-vm850.h ({R1,EP}_REGNUMS): New register number
|
* config/v850/tm-vm850.h ({R0,R1,R12,EP}_REGNUMS): New register
|
||||||
defintiions for r1, ep.
|
number defintiions for r0, r1, r12, ep.
|
||||||
(SAVE{1,2,3}_{START,END}_REGNUM): Register number definitions for
|
(SAVE{1,2,3}_{START,END}_REGNUM): Register number definitions for
|
||||||
the 3 sets of saved registers.
|
the 3 sets of saved registers.
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#define REGISTER_SIZE 4
|
#define REGISTER_SIZE 4
|
||||||
#define MAX_REGISTER_RAW_SIZE 4
|
#define MAX_REGISTER_RAW_SIZE 4
|
||||||
|
|
||||||
|
#define R0_REGNUM 0
|
||||||
#define R1_REGNUM 1
|
#define R1_REGNUM 1
|
||||||
#define SAVE1_START_REGNUM 2
|
#define SAVE1_START_REGNUM 2
|
||||||
#define SAVE1_END_REGNUM 2
|
#define SAVE1_END_REGNUM 2
|
||||||
|
@ -47,6 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#define ARGLAST_REGNUM 9
|
#define ARGLAST_REGNUM 9
|
||||||
#define V0_REGNUM 10
|
#define V0_REGNUM 10
|
||||||
#define V1_REGNUM 11
|
#define V1_REGNUM 11
|
||||||
|
#define R12_REGNUM 12
|
||||||
#define SAVE2_START_REGNUM 20
|
#define SAVE2_START_REGNUM 20
|
||||||
#define SAVE2_END_REGNUM 29
|
#define SAVE2_END_REGNUM 29
|
||||||
#define FP_REGNUM 29
|
#define FP_REGNUM 29
|
||||||
|
|
|
@ -71,6 +71,7 @@ v850_scan_prologue (pc, pi)
|
||||||
CORE_ADDR save_pc, save_end;
|
CORE_ADDR save_pc, save_end;
|
||||||
int regsave_func_p;
|
int regsave_func_p;
|
||||||
int current_sp_size;
|
int current_sp_size;
|
||||||
|
int r12_tmp;
|
||||||
|
|
||||||
/* First, figure out the bounds of the prologue so that we can limit the
|
/* First, figure out the bounds of the prologue so that we can limit the
|
||||||
search to something reasonable. */
|
search to something reasonable. */
|
||||||
|
@ -115,6 +116,7 @@ v850_scan_prologue (pc, pi)
|
||||||
regsave_func_p = 0;
|
regsave_func_p = 0;
|
||||||
save_pc = 0;
|
save_pc = 0;
|
||||||
save_end = 0;
|
save_end = 0;
|
||||||
|
r12_tmp = 0;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf_filtered ("Current_pc = 0x%.8lx, prologue_end = 0x%.8lx\n",
|
printf_filtered ("Current_pc = 0x%.8lx, prologue_end = 0x%.8lx\n",
|
||||||
|
@ -184,6 +186,12 @@ v850_scan_prologue (pc, pi)
|
||||||
pi->framereg = FP_REGNUM;
|
pi->framereg = FP_REGNUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (insn == ((R12_REGNUM << 11) | 0x0640 | R0_REGNUM)) /* movhi hi(const),r0,r12 */
|
||||||
|
r12_tmp = read_memory_integer (current_pc + 2, 2) << 16;
|
||||||
|
else if (insn == ((R12_REGNUM << 11) | 0x0620 | R12_REGNUM)) /* movea lo(const),r12,r12 */
|
||||||
|
r12_tmp += read_memory_integer (current_pc + 2, 2);
|
||||||
|
else if (insn == ((SP_REGNUM << 11) | 0x01c0 | R12_REGNUM) && r12_tmp) /* add r12,sp */
|
||||||
|
pi->frameoffset = r12_tmp;
|
||||||
else if (insn == ((EP_REGNUM << 11) | 0x0000 | SP_REGNUM)) /* mov sp,ep */
|
else if (insn == ((EP_REGNUM << 11) | 0x0000 | SP_REGNUM)) /* mov sp,ep */
|
||||||
ep_used = 1;
|
ep_used = 1;
|
||||||
else if (insn == ((EP_REGNUM << 11) | 0x0000 | R1_REGNUM)) /* mov r1,ep */
|
else if (insn == ((EP_REGNUM << 11) | 0x0000 | R1_REGNUM)) /* mov r1,ep */
|
||||||
|
|
Loading…
Reference in New Issue