[m-rev.] for review: better code for unify and compare procs

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 12 21:41:58 AEDT 2004


On 12-Jan-2004, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> For review by Fergus. Together with the change to jumpopt, this change
> reduces the size of aditi_backend.rl_code.c by 13 to 18%, depending on
> the measure (lines, characters, object code size). It should also make
> some compare predicates faster.

The log message is long enough that it should have a summary line, e.g.

	Improve the code that we generate for unify and compare procs.

> +++ handle_options.m	10 Jan 2004 16:01:02 -0000
> @@ -1304,6 +1304,15 @@
>  		[]
>  	),
>  
> +	(
> +		{ Target = c },
> +		{ TagsMethod = low }
> +	->
> +		globals__io_set_option(can_compare_constants_as_ints, bool(yes))
> +	;
> +		globals__io_set_option(can_compare_constants_as_ints, bool(no))
> +	),

The data representation is the same for --target asm as for --target c,
so we should handle that case here too.

If TagsMethod = low but --num-tag-bits is zero, then constants will be
represented using a secondary tag which will get allocated on the heap.

Likewise if TagsMethod = low and --num-tag-bits is 1 but the --reserve-tag
option is set.

Likewise also if TagsMethod = low and --num-tag-bits is 1 and the type
in question has a `pragma reserve_tag' for it.

Otherwise that looks good.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list