[m-rev.] for review: enumeration argument packing

Peter Wang novalazy at gmail.com
Mon Jul 4 12:50:10 AEST 2011

On 2011-07-01, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> Hi Peter,
> On Mon, 27 Jun 2011, Peter Wang wrote:
> >Branches: main
> >
> >Pack consecutive enumeration arguments in discriminated union types into a
> >single word to reduce cell sizes.  Argument packing is only enabled on C
> >back-ends, and reordering arguments to improve opportunities for packing is
> >not yet attempted.  The RTTI implementations for other back-ends will need to
> >be updated, but that is best left until after any argument reordering change.
> >
> >Modules which import abstract enumeration types are notified so by writing
> >declarations of the form:
> >
> >	:- type foo where type_is_abstract_enum(NumBits).
> >
> >into the interface file for the module which defines the type.
> I have a couple of questions regarding this:
> * Is this option safe in the presence (possibly, by disabling it) of
>   --cross-compiling?

I don't know what effect --cross-compiling should have, if any.
The packing uses the --bits-per-word option to know how many arguments
can be packed together.

> * Do the C grades in which the optimization is supported include grades
>   in which --highlevel-data is enabled?  e.g. the hl.gc grade.

Presumably if you wanted high-level data, you wouldn't want to deal with
argument packing yourself.  In hl grades we might want to use C
bit-field syntax. For now I will make --highlevel-data imply

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