Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Stack bias



> OK, how does bias of 2047 allow to address more stack space, vs.
> 32-bit mode with no bias?

It doesn't.  But it lets you address more _useful_ stack space.

This is an artifact of the addressing modes the hardware provides.
With zero bias, half the space you can address with the
literal-constant-offset addressing modes most commonly used to access
the stack is space which isn't yours because it's below the bottom of
the stack and thus owned by asynchronous events like signals (or, in
the kernel, interrupts).  With the bias, that space cannot be addressed
without using multiple instructions to construct a larger offset, but
you can address twice as much of the usable stack space.

It's only a factor of two, but that's enough to be of some use.

However, I saw something upthread implying that the kernel treated the
low bit of %sp as a 64-bit flag, meaning that using %o6/%sp as an
ordinary register is not possible even if you're _not_ using the stack
(if it happens to hold an even value, halves of other registers can be
destroyed at unpredictable times).  Perhaps I misunderstood; I
certainly hope so, because this seems broken to me.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index