Subject: Re: {REG,PTR}_{L,S} usage
To: Masao Uebayashi <uebayasi@gmail.com>
From: Simon Burge <simonb@NetBSD.org>
List: port-mips
Date: 11/13/2007 17:35:22
"Masao Uebayashi" wrote:

> I have many questions now. :)
> 
> I think REG_L / REG_R / PTR_L / PTR_S macros are used by the size of
> the memory object size.  Is this correct?
> 
> For example, if I want to store a pointer (e.g. return address; which
> is 32-bit on N32) into a call frame RA slot (which is register_t ==
> 64-bit on N32) on a stack, I should use REG_S, right?

If you want to load/store a pointer, you use PTR_*.  If you're using n32
or o32 ABI, PTR_S will be "sw" and if you're using the n64 (or o64 if we
care about it) then PTR_S will be "sd".

You'd use REG_* if you know you want to deal with the full register.
One example that immediately jumps to mind is say setjmp()/longjmp().

Cheers,
Simon.