From 678e72484c859c3f740c7723da55a8fc90654f99 Mon Sep 17 00:00:00 2001 From: pcpa Date: Tue, 19 Feb 2013 22:10:35 -0300 Subject: [PATCH] Add updated sparc example from lightning 1.2c documentation. * doc/body.texi: Add back the SPARC code generation example. --- ChangeLog | 4 ++++ doc/body.texi | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 56ecbd068..0d6007f3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-02-19 Paulo Andrade + + * doc/body.texi: Add back the SPARC code generation example. + 2013-02-19 Paulo Andrade * check/lightning.c: Remove state flag to work with partial diff --git a/doc/body.texi b/doc/body.texi index 3eef13b47..7d3099d75 100644 --- a/doc/body.texi +++ b/doc/body.texi @@ -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{} 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 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 @item x86_64 @example