public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Telling gcc to assume a register value
@ 2021-03-23  1:38 Rena
  2021-03-23  9:56 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Rena @ 2021-03-23  1:38 UTC (permalink / raw)
  To: gcc-help

I'm building patches for a GameCube game, which sets r2 and r13 at
startup and never changes them. Is there any way to tell gcc to assume
these registers have specific values, so that it can optimize code
that references memory in the areas they point to?

-- 
Sent from my Game Boy.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Telling gcc to assume a register value
  2021-03-23  1:38 Telling gcc to assume a register value Rena
@ 2021-03-23  9:56 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2021-03-23  9:56 UTC (permalink / raw)
  To: gcc-help

On 3/23/21 1:38 AM, Rena via Gcc-help wrote:
> I'm building patches for a GameCube game, which sets r2 and r13 at
> startup and never changes them. Is there any way to tell gcc to assume
> these registers have specific values, so that it can optimize code
> that references memory in the areas they point to?

That depends on exactly what you mean. Does https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html
do what you want?

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-23  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23  1:38 Telling gcc to assume a register value Rena
2021-03-23  9:56 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).