From e5b9ee95f68d936443776321c2260c8d2e5604f9 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 24 Apr 1997 12:06:14 +0000 Subject: [PATCH] Fix? some reg definitions --- gdb/ChangeLog | 11 +++++++++++ gdb/config/tic80/tm-tic80.h | 36 +++++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b12ff40c20e..4c8ff276ee6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +start-sanitize-tic80 +Thu Apr 24 16:11:47 1997 Andrew Cagney + + * config/tic80/tm-tic80.h (NUM_REGS): Four 64bit accumulators. + (REGISTER_BYTE, REGISTER_RAW_SIZE, REGISTER_SIZE, + MAX_REGISTER_RAW_SIZE, REGISTER_VIRTUAL_TYPE): Adjust. + (NPC_REGNUM): Tic80 has a delay slot. + (R0_REGNUM, Rn_REGNUM, An_REGNUM): For sim, provide base/bound for + register blocks. + +end-sanitize-tic80 Wed Apr 23 11:18:45 1997 Jeffrey A Law (law@cygnus.com) * config/mn10200/tm-mn10200.h (STORE_RETURN_VALUE): Pointers are diff --git a/gdb/config/tic80/tm-tic80.h b/gdb/config/tic80/tm-tic80.h index 8792101e53e..2ca66dc07e8 100644 --- a/gdb/config/tic80/tm-tic80.h +++ b/gdb/config/tic80/tm-tic80.h @@ -36,58 +36,68 @@ struct frame_saved_regs; #define NAMES_HAVE_UNDERSCORE -#define NUM_REGS 35 +#define NUM_REGS 37 #define REGISTER_NAMES \ { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \ "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \ - "pc", "a0", "a1" \ + "pc", "npc", \ + "a0", "a1", "a2", "a3", \ } -/* Various dedicated register numbers */ +/* Various dedicated register numbers + FIXME: Shadow updates in sim/tic80/sim-calls.c */ #define SP_REGNUM 1 /* Contains address of top of stack */ #define FP_REGNUM 31 /* Contains address of executing stack frame */ #define PC_REGNUM 32 /* Contains program counter (FIXME?) */ -#define A0_REGNUM 33 /* Accumulator register 0 */ -#define A1_REGNUM 34 /* Accumulator register 1 */ +#define NPC_REGNUM 33 /* Contains the next program counter (FIXME?) */ +#define A0_REGNUM 34 /* Accumulator register 0 */ +#define A3_REGNUM 37 /* Accumulator register 1 */ + +#define R0_REGNUM 0 /* General Purpose Register 0 - for sim */ +#define Rn_REGNUM 31 /* Last General Purpose Register - for sim */ +#define An_REGNUM A3_REGNUM /* Last Accumulator register - for sim */ /* Total amount of space needed to store our copies of the machine's register state, the array `registers'. */ -#define REGISTER_BYTES (((NUM_REGS - 2) * 4) + (2 * 8)) +#define REGISTER_BYTES (((NUM_REGS - 4) * 4) + (4 * 8)) /* Index within `registers' of the first byte of the space for register N. */ #define REGISTER_BYTE(N) \ - (((N) > A0_REGNUM) ? (((N) - A0_REGNUM) * 8 + A0_REGNUM * 4) : ((N) * 4)) + (((N) >= A0_REGNUM) ? (((N) - A0_REGNUM) * 8 + A0_REGNUM * 4) : ((N) * 4)) + +/* Most registers are 4 bytes */ #define REGISTER_SIZE 4 -/* All regs are 4 bytes. */ +/* Some registers are 8 bytes. */ -#define REGISTER_RAW_SIZE(N) (4) +#define REGISTER_RAW_SIZE(N) \ + (((N) >= A0_REGNUM) ? 8 : 4) /* Largest value REGISTER_RAW_SIZE can have. */ -#define MAX_REGISTER_RAW_SIZE 4 +#define MAX_REGISTER_RAW_SIZE (8) /* All regs are 4 bytes. */ -#define REGISTER_VIRTUAL_SIZE(N) (4) +#define REGISTER_VIRTUAL_SIZE(N) (REGISTER_RAW_SIZE(N)) /* Largest value REGISTER_VIRTUAL_SIZE can have. */ -#define MAX_REGISTER_VIRTUAL_SIZE (4) +#define MAX_REGISTER_VIRTUAL_SIZE (MAX_REGISTER_RAW_SIZE) /* Return the GDB type object for the "standard" data type of data in register N. */ #define REGISTER_VIRTUAL_TYPE(N) /* FIXME? */ \ - (((N) == A0_REGNUM || (N) == A1_REGNUM) ? builtin_type_float : builtin_type_int) + (((N) >= A0_REGNUM) ? builtin_type_float : builtin_type_int) /* Offset from address of function to start of its code. Zero on most machines. */ -- 2.30.2