mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-06 20:20:20 +02:00
Add updated sparc example from lightning 1.2c documentation.
* doc/body.texi: Add back the SPARC code generation example.
This commit is contained in:
parent
e6a14a61eb
commit
678e72484c
2 changed files with 22 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2013-02-19 Paulo Andrade <pcpa@gnu.org>
|
||||||
|
|
||||||
|
* doc/body.texi: Add back the SPARC code generation example.
|
||||||
|
|
||||||
2013-02-19 Paulo Andrade <pcpa@gnu.org>
|
2013-02-19 Paulo Andrade <pcpa@gnu.org>
|
||||||
|
|
||||||
* check/lightning.c: Remove state flag to work with partial
|
* check/lightning.c: Remove state flag to work with partial
|
||||||
|
|
|
@ -710,10 +710,27 @@ code for these instructions. The client program has the responsibility
|
||||||
of describing the code to be generated using the standard @lightning{}
|
of describing the code to be generated using the standard @lightning{}
|
||||||
instruction set.
|
instruction set.
|
||||||
|
|
||||||
Let's examine the code generated for @code{incr} on the x86_64
|
Let's examine the code generated for @code{incr} on the SPARC and x86_64
|
||||||
architecture (on the right is the code that an assembly-language
|
architecture (on the right is the code that an assembly-language
|
||||||
programmer would write):
|
programmer would write):
|
||||||
|
|
||||||
|
@table @b
|
||||||
|
@item SPARC
|
||||||
|
@example
|
||||||
|
save %sp, -112, %sp
|
||||||
|
mov %i0, %g2 ret
|
||||||
|
inc %g2 inc %i0
|
||||||
|
mov %g2, %i0
|
||||||
|
restore
|
||||||
|
retl
|
||||||
|
nop
|
||||||
|
@end example
|
||||||
|
In this case, @lightning{} introduces overhead to create a register
|
||||||
|
window (not knowing that the procedure is a leaf procedure) and to
|
||||||
|
move the argument to the general purpose register @code{R0} (which
|
||||||
|
maps to @code{%g2} on the SPARC).
|
||||||
|
@end table
|
||||||
|
|
||||||
@table @b
|
@table @b
|
||||||
@item x86_64
|
@item x86_64
|
||||||
@example
|
@example
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue