[LLVMdev] Named register variables GNU-style
Renato Golin
renato.golin at linaro.org
Wed Apr 9 07:03:09 PDT 2014
On 7 April 2014 12:16, Richard Sandiford <rsandifo at linux.vnet.ibm.com> wrote:
> It might not matter, but MIPS linux is one case where a non-allocatable
> register is used as a true global variable, rather than as a convienent
> way of getting the value of a fixed-purpose register. The register used
> there is $gp, which on bare-metal is usually reserved for small-data and
> (in theory) GOT accesses. Since linux knows it doesn't use either,
> it instead uses $gp to hold information about the current thread.
Hi Richard,
I think all cases for named registers are unusual, and that's the
point. I think this is a perfectly valid case for using named
registers, since there is no way in C to represent this logic and bare
metal code might have a heavy use of that register's value.
cheers,
--renato
More information about the llvm-dev
mailing list