This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: x86-64 merger part 4 - dwarf2 register maps
> On Fri, Mar 09, 2001 at 07:08:14PM +0100, Jan Hubicka wrote:
> > Oops - I didn't know about them. Would be OK to do that by separate patch
> > (or as pre-approved change?)
>
> Pre-approved.
>
> > Would be patch OK with:
> [MMX renumbered]
>
> Yes.
Thanks, here is what I am just testing for commit:
Sat Mar 10 14:22:24 CET 2001 Jan Hubicka <jh@suse.cz>
* i386.h (DBX_REGISTER_NUMBER): Return proper values for 64bits.
(dbx64_register_map): Declare.
(RETURN_ADDR_RTX): Fix for 64bit.
(DWARF_FRAME_RETURN_COLUMN): Set to 16 for 64bit.
(INCOMING_FRAME_SP_OFFSET): Set to 8.
* i386.c (dbx64_register_map): New global array.
* beos-elf.h, freebsd.h, i386-interix.h, i386elf.h,
linux.h (DBX_REGISTER_REGNUMBER): Use dbx64_register_map
for 64bits.
Index: beos-elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/beos-elf.h,v
retrieving revision 1.6
diff -c -3 -p -r1.6 beos-elf.h
*** beos-elf.h 2000/11/02 23:29:09 1.6
--- beos-elf.h 2001/03/10 13:21:42
*************** Boston, MA 02111-1307, USA. */
*** 49,55 ****
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
--- 49,56 ----
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) \
! (TARGET_64BIT ? dbx64_register_map[n] : svr4_register_map[n])
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
Index: freebsd.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/freebsd.h,v
retrieving revision 1.25
diff -c -3 -p -r1.25 freebsd.h
*** freebsd.h 2000/11/02 23:29:09 1.25
--- freebsd.h 2001/03/10 13:21:42
*************** Boston, MA 02111-1307, USA. */
*** 50,56 ****
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
#undef NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS
--- 50,57 ----
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) \
! (TARGET_64BIT ? dbx64_register_map[n] : svr4_register_map[n])
#undef NO_PROFILE_COUNTERS
#define NO_PROFILE_COUNTERS
Index: i386-interix.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386-interix.h,v
retrieving revision 1.13
diff -c -3 -p -r1.13 i386-interix.h
*** i386-interix.h 2001/03/09 16:40:43 1.13
--- i386-interix.h 2001/03/10 13:21:43
*************** while (0)
*** 432,438 ****
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
! ((n) == 0 ? 0 \
: (n) == 1 ? 2 \
: (n) == 2 ? 1 \
: (n) == 3 ? 3 \
--- 432,439 ----
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
! (TARGET_64BIT ? dbx64_register_map[n] \
! : (n) == 0 ? 0 \
: (n) == 1 ? 2 \
: (n) == 2 ? 1 \
: (n) == 3 ? 3 \
Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.231
diff -c -3 -p -r1.231 i386.c
*** i386.c 2001/03/09 18:55:27 1.231
--- i386.c 2001/03/10 13:21:44
*************** int const dbx_register_map[FIRST_PSEUDO_
*** 353,358 ****
--- 353,370 ----
29, 30, 31, 32, 33, 34, 35, 36, /* MMX */
};
+ /* The "default" register map used in 64bit mode. */
+ int const dbx64_register_map[FIRST_PSEUDO_REGISTER] =
+ {
+ 0, 1, 2, 3, 4, 5, 6, 7, /* general regs */
+ 33, 34, 35, 36, 37, 38, 39, 40 /* fp regs */
+ -1, -1, -1, -1, -1, /* arg, flags, fpsr, dir, frame */
+ 17, 18, 19, 20, 21, 22, 23, 24, /* SSE */
+ 41, 42, 43, 44, 45, 46, 47, 48, /* MMX */
+ 8,9,10,11,12,13,14,15, /* extended integer registers */
+ 25, 26, 27, 28, 29, 30, 31, 32, /* extended SSE registers */
+ };
+
/* Define the register numbers to be used in Dwarf debugging information.
The SVR4 reference port C compiler uses the following register numbers
in its Dwarf output code:
Index: i386.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.h,v
retrieving revision 1.164
diff -c -3 -p -r1.164 i386.h
*** i386.h 2001/03/09 19:09:21 1.164
--- i386.h 2001/03/10 13:21:45
*************** number as al, and ax.
*** 2718,2726 ****
/* How to renumber registers for dbx and gdb. */
! #define DBX_REGISTER_NUMBER(n) dbx_register_map[n]
extern int const dbx_register_map[FIRST_PSEUDO_REGISTER];
extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
/* Before the prologue, RA is at 0(%esp). */
--- 2718,2728 ----
/* How to renumber registers for dbx and gdb. */
! #define DBX_REGISTER_NUMBER(n) \
! (TARGET_64BIT ? dbx64_register_map[n] : dbx_register_map[n])
extern int const dbx_register_map[FIRST_PSEUDO_REGISTER];
+ extern int const dbx64_register_map[FIRST_PSEUDO_REGISTER];
extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
/* Before the prologue, RA is at 0(%esp). */
*************** extern int const svr4_dbx_register_map[F
*** 2730,2743 ****
/* After the prologue, RA is at -4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
! ? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -4))\
! : gen_rtx_MEM (Pmode, plus_constant (FRAME, 4)))
/* PC is dbx register 8; let's use that column for RA. */
! #define DWARF_FRAME_RETURN_COLUMN 8
/* Before the prologue, the top of the frame is at 4(%esp). */
! #define INCOMING_FRAME_SP_OFFSET 4
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
--- 2732,2745 ----
/* After the prologue, RA is at -4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
! ? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, TARGET_64BIT ? -8 : -4))\
! : gen_rtx_MEM (Pmode, plus_constant (FRAME, TARGET_64BIT ? 8 : 4)))
/* PC is dbx register 8; let's use that column for RA. */
! #define DWARF_FRAME_RETURN_COLUMN (TARGET_64BIT ? 16 : 8)
/* Before the prologue, the top of the frame is at 4(%esp). */
! #define INCOMING_FRAME_SP_OFFSET UNITS_PER_WORD
/* This is how to output the definition of a user-level label named NAME,
such as the label on a static function or variable NAME. */
Index: i386elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386elf.h,v
retrieving revision 1.10
diff -c -3 -p -r1.10 i386elf.h
*** i386elf.h 2001/03/09 16:40:43 1.10
--- i386elf.h 2001/03/10 13:21:45
*************** do { long value[3]; \
*** 112,118 ****
} while (0)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
/* The routine used to output sequences of byte values. We use a special
version of this for most svr4 targets because doing so makes the
--- 112,119 ----
} while (0)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) \
! (TARGET_64BIT ? dbx64_register_map[n] : svr4_register_map[n])
/* The routine used to output sequences of byte values. We use a special
version of this for most svr4 targets because doing so makes the
Index: linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/linux.h,v
retrieving revision 1.22
diff -c -3 -p -r1.22 linux.h
*** linux.h 2001/01/09 22:10:53 1.22
--- linux.h 2001/03/10 13:21:45
*************** Boston, MA 02111-1307, USA. */
*** 56,62 ****
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
/* Output assembler code to FILE to call the profiler.
To the best of my knowledge, no Linux libc has required the label
--- 56,63 ----
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
#undef DBX_REGISTER_NUMBER
! #define DBX_REGISTER_NUMBER(n) \
! (TARGET_64BIT ? dbx64_register_map[n] : svr4_register_map[n])
/* Output assembler code to FILE to call the profiler.
To the best of my knowledge, no Linux libc has required the label