This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
SH5 compact register numbering in gcc -> gdb interface
- From: Joern Rennecke <joern dot rennecke at st dot com>
- To: gcc at gcc dot gnu dot org, gdb at sources dot redhat dot com, aoliva at redhat dot com,ezannoni at redhat dot com, bje at redhat dot com
- Cc: ac131313 at cygnus dot com
- Date: Tue, 30 Apr 2002 18:48:51 +0100
- Subject: SH5 compact register numbering in gcc -> gdb interface
- Organization: SuperH UK Ltd.
- Reply-to: joern dot rennecke at st dot com
The numbers currently used to encode registers in the debug information
for SH5compact seem quite arbitrary. I see that they correspond
to the current pseudo register scheme in gdb, but this is going
to change when a unified interface for SH and SH64 is created.
What I have in mind for the simulator interface is to keep the
current SH1-SH4, SH[3]-DSP register numbers, (and also keep the
corresponding gdb pseudo register numbers), and start the SH64
numbers at 128.
The SHcompact simulator register numbers can be the same as for SH4.
However, this exposes the arbitrariness of the gcc->gdb interface,
and I think now - before the integration of the simulator and gdb
port into the FSF sources - is our last chance to change it.
The SHcompact registers are all mapped to SH5media registers,
and therefore it seems most natural to use the numbers used
for these SH5media registers also in SHcompact code - indeed,
this is currently already done for the general purpose registers.
The only odd one out is MACH, which resides in the upper 32 bit
of R17; for this I propose to use number 141.
This numbering also has the advantage that all SH5compact registers
except MACH can be encoded with LEB128 in a single byte.
compact reg current # sh5 equiv proposed #
-----------+-----------+------------+------------------
R0 .. R15 0 .. 15 R0 .. R15 0 .. 15
FR0 .. FR15 245 .. 260 FR0 .. FR15 77 .. 92
XD0 .. XD14 289 .. 296 DR16 .. DR30 93 .. 107 (odd only)
PR 241 R18 18
T 242 R19 19
GBR 238 R16 16
MACH 239 R17(high) 141
MACL 240 R17(low) 17
FPUL 244 FR32 109
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330