[Top][All Lists]

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

Re: [Lightning] Re: `pushr' on SPARC

From: Ludovic Courtès
Subject: Re: [Lightning] Re: `pushr' on SPARC
Date: Tue, 14 Nov 2006 10:10:16 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)


I considered using one register to keep information at run-time about
the last pushed register (and thereby avoid the pop-after-branch issue).
Currently, %l2 through %l7 are mapped to JIT_V registers, and JIT_R1 and
JIT_R2 use %l0 and %l1.  Thus, we would need to free one of these
precious %l registers.  I was tempted to make the following change in
order to free %l0 and %l1:

  R1 -> %g3
  R2 -> %g4

That seems to work fine on the test suite (on GNU/Linux with GCC), but
unfortunately, page 3-13 of the SysV ABI SPARC Supplement reads this:

  %g2 through %g4

  Global integer registers 2, 3, and 4 are reserved for the application
  software. System software (including the libraries described in
  Chapter 6) preserves these registers' values for the
  application. Their use is intended to be controlled by the compilation
  system and must be consistent throughout the application.

Which I understand as: the compiler may assign specific roles to those
registers within a compilation unit, and using them arbitrarily in
lightning-generated code may interfere with the compiler's register

Which brings me back to our previous conclusion: why not just keep
`jit_allocai' along with the register push area thing and its
limitations (a `save'-patching approach would have the same problems
with pop-after-branch)?  :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]