Re: [PATCH] VAX libstdc++ common runtime - register used but not saved

Rin Okuyama <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <CAPSZb0RivLSAEPJk9-QPPP_2QdCAOBwQ_osmXKBSWhcr82=7RQ@mail.gmail.com>
On Fri, Jul 28, 2023 at 4:59 PM Jan-Benedict Glaw <[email protected]> wrote:
>
> On Fri, 2023-07-28 09:51:07 +0200, Edgar Fuß <[email protected]> wrote:
> > > This 0x0101 seems like two NOPs copy-paste from pre-ELF code:
> > Is it absolutely clear to VAX insiders what these constants mean or why
> > aren't there any #defines (or whatever that is in asm) for it?
>
> Yes, I think so. It's the "Procedure Entry Mask", 16 bits showing
> which registers should be automatically pushed onto the stack before
> starting the actual function code. So it's an ORed value where each
> bit represents one register.
>
>   VAX has 16 registers. r0 and r1 are commonly used to return values
> and are thus not saved for obvious reasone. r12 to r15 have fixed
> purposes (r12 = argument pointer, r13 = frame pointer, r14 = stack
> pointer and r15 = program counter.) Bits 14 and 15 are used not
> actually for registers but to mark for integer/decimal overflow, and
> bits 12 and 13 may not be set.

And we have register number definitions in <vax/asm.h>:
https://nxr.netbsd.org/xref/src/sys/arch/vax/include/asm.h#36

Thanks,
rin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.