mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
added ret test and clarified JIT_RET documentation
Patches applied: * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--base-0 tag of lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-18 * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--patch-1 tests/push-pop.c: Use more `pushr's. * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--patch-3 Added a test for `JIT_RET' (fails on SPARC). * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--patch-4 Fixed use of `JIT_RET': Move %o0 into %i0 after `calli' and `callr'. * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-19 Merge from `sparc-fixes': Fixed `pushr' and `popr', fixed `JIT_RET'. * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-20 Undoed `lightning--sparc-fixes--1.2--patch-4' (about `JIT_RET') which was wrong. * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-21 tests/ret.c: Use `jit_retval_i' to copy the function's return value. * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-22 Doc: Clarified the use of `JIT_RET' and documented `jit_retval'. git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-32
This commit is contained in:
parent
147efb8d90
commit
e2cb4af6aa
5 changed files with 117 additions and 13 deletions
|
@ -104,10 +104,12 @@ which, like the x86, are poor of registers; anyway, backends can
|
|||
specify the actual number of available caller- and callee-save
|
||||
registers.
|
||||
|
||||
In addition, there is a special @code{RET} register which contains
|
||||
the return value. You should always remember, however, that writing
|
||||
this register could overwrite either a general-purpose register or
|
||||
an incoming parameter, depending on the architecture.
|
||||
In addition, there is a special @code{RET} register which contains the
|
||||
return value of the current function (@emph{not} the return value of
|
||||
callees---use the @code{retval} instruction for this). You should
|
||||
always remember, however, that writing this register could overwrite
|
||||
either a general-purpose register or an incoming parameter, depending
|
||||
on the architecture.
|
||||
|
||||
There are at least six floating-point registers, named @code{FPR0} to
|
||||
@code{FPR5}. These are separate from the integer registers on
|
||||
|
@ -285,6 +287,7 @@ prepare i f d
|
|||
pusharg c uc s us i ui l ul p f d
|
||||
getarg c uc s us i ui l ul p f d
|
||||
arg c uc s us i ui l ul p f d
|
||||
retval c uc s us i ui l ul p
|
||||
@end example
|
||||
|
||||
Of these, the first two are used by the caller, while the last two
|
||||
|
@ -315,6 +318,13 @@ that generates other code, so they will be treated more
|
|||
specifically in @ref{GNU lightning macros, , Generating code at
|
||||
run-time}.
|
||||
|
||||
Finally, the @code{retval} instruction fetches the return value of a
|
||||
called function in a register. The @code{retval} instruction takes a
|
||||
register argument and copies the return value of the previously called
|
||||
function in that register. A function should put its own return value
|
||||
in the @code{RET} register before returning. @xref{Fibonacci, the
|
||||
Fibonacci numbers}, for an example.
|
||||
|
||||
You should observe a few rules when using these macros. First of
|
||||
all, it is not allowed to call functions with more than six arguments;
|
||||
this was done to simplify and speed up the implementation on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue