🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51730

Re: Global Registers Question

#51730
From: Bruno Haible
Date: Sun, 04 Apr 1993 15:00
20 lines
1706 bytes
John Garnett asks:
> What I'd like
> to know are appropriate values for REG on different architectures.
> That is, which registers can I safely use on the various SPARCs,
> hp's, decstations, etc (just need to know two or three regs for
> each architecture).

Look into the machine description for the specific CPU, especially
the definitions of FIXED_REGISTERS and CALL_USED_REGISTERS. Take any
register that has a 0 in both of these arrays, and which can hold values
of the desired type.

On Sparc, you can take %g7, %g6, %g5. (gcc emits a warning that these
registers may be used as temporary registers, but for me it works.)
On HPPA, it's %r5 to %r18. On 680x0, take a4 and a3. (a6 is the static
chain register, and a5 is used by some operating systems.)


                    Bruno Haible
                    haible@ma2s2.mathematik.uni-karlsruhe.de
Technical Details
Message-ID: <1pmt5p$sse@nz12.rz.uni-karlsruhe.de>
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!ira.uka.de!rz.uni-karlsruhe.de!ma2s2!haible
References: <1pjeghINNfg1@geraldo.cc.utexas.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,1fcd76eac4049c43
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-04-04 08:00:33 PST
Path: arc1-ca.pugleaf.net!gmd.de!Germany.EU.net!ira.uka.de!rz.uni-karlsruhe.de!ma2s2!haible
From: haible@ma2s2.uucp (Bruno Haible)
Newsgroups: gnu.gcc.help
Subject: Re: Global Registers Question
Date: 4 Apr 1993 15:00:09 GMT
Organization: University of Karlsruhe, Germany
Lines: 20
Sender: haible@ma2s2.mathematik.uni-karlsruhe.de
Message-ID: <1pmt5p$sse@nz12.rz.uni-karlsruhe.de>
References: <1pjeghINNfg1@geraldo.cc.utexas.edu>
NNTP-Posting-Host: ma2s2.mathematik.uni-karlsruhe.de
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Summary: the non-call-used registers
Keywords: gcc, register, asm, a5, global variable