[m-dev.] for review: specializing comparisons

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Nov 6 19:20:43 AEDT 2000


On 06-Nov-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > +	% make_hlds contains an optimization which requires the value of the
> > +	% compare_specialization option to accurately specify the max number
> > +	% of constructors in a type whose comparison procedure is specialized
> > +	% and which therefore don't need index functions.
> > +	globals__io_lookup_int_option(compare_specialization, CompareSpec0),
> > +	{ int__min(unify_proc__max_exploited_compare_spec_value,
> > +		CompareSpec0, CompareSpec) },
> > +	globals__io_set_option(compare_specialization, int(CompareSpec)),
> 
> Did you mean to use `int__max' rather than `int__min' here?
> Won't that code always set the compare_specialization option to 3?

No, I mean int__min. I want to honor any value from 0 to 3 given by the
programmer, and I want to clip any higher value to 3. This way, the value
of the option will accurarely reflect what comparison procedures unify_proc.m
will specialize, which is what make_hlds.m needs.

Using int__max would make the option redundant: all compare predicates within
the capabilities of unify_proc.m would be redundant.

> That explains why the benchmark results were mostly within estimated
> measurement error ;-)

The fact that the sizes are all different contradicts your theory.

Zoltan.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list