[m-rev.] for review: float registers

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Sep 19 17:40:04 AEST 2011


Hi Peter,

On Fri, 9 Sep 2011, Peter Wang wrote:

> Branches: main
>
> Add float registers to the Mercury abstract machine, implemented as simply an

Delete "simply".

> array of MR_Float in the Mercury engine structure.
>
> Float registers are only useful if a Mercury `float' is wider than a word
> (i.e. when using double precision floats on 32-bit platforms) so we let them
> exist only then.  In other cases floats may simply be passed via the regular
> registers, as before.
>
> Currently, higher order calls still require the use of the regular registers
> for all arguments.  As all exported procedures are potentially the target of
> higher order calls, exported procedures must use only the regular registers for
> argument passing.  This can lead to more (un)boxing than if floats were simply
> always boxed.  Until this is solved, float registers must be enabled explicitly
> with the developer only option `--use-float-registers'.
>
> The other aspect of this change is using two consecutive stack slots to hold a
> single double variable.  Without that, the benefit of passing unboxed floats
> via dedicated float registers would be largely eroded.

...

> index 711744b..8bec3f4 100644
> --- a/runtime/mercury_regs.h
> +++ b/runtime/mercury_regs.h
> @@ -196,7 +196,7 @@
> /*
> ** The Mercury abstract machine registers layer.
> **
> -** The Mercury abstract machine registers consist of four groups.
> +** The Mercury abstract machine registers consist of five groups.
> **
> ** - The general purpose registers that may be allocated to real machine
> **   registers, MR_rN for 1 <= N <= MR_MAX_REAL_R_REG.
> @@ -243,6 +243,9 @@
> **   They need to be fields in the Mercury engine structure.  We already
> **   do this for MR_parent_sp, but incompletely for a few of the others.
> **
> +** - The floating point registers, if present, are always stored in the
> +**   float_reg array and not a physical register.
> +**
> ** The Mercury abstract machine registers layer also provides MR_virtual_r(),
> ** MR_virtual_succip, MR_virtual_hp, etc., which are similar to mr<N>,
> ** MR_succip, MR_hp, etc. except that they always map to the underlying
> @@ -268,6 +271,18 @@
> #endif
>
> /*
> +** The float registers only exist if MR_BOXED_FLOAT. To reduce the need for

... if MR_BOXED_FLOAT is defined.

That looks ok otherwise.

Cheers,
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list