[m-dev.] GCC back-end: fix some omissions in mlds_to_gcc.m

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jan 20 00:08:24 AEDT 2001


On 19-Jan-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 19-Jan-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > 	With these changes, the GCC back-end now builds `samples/diff'
> > 	and passes the tests in samples/tests/diff.
> 
> Is it generating the same .s code as the hlc grade? If not, what is the
> difference and the relative performance?

The .s files are very similar.

The differences that I know about are
	- the `--target asm' is allocating some static data in `.data'
	  which `--target c' allocates in `.rodata'
	- `--target asm' uses a signed type for the result of `MR_tag',
	  whereas `--target c' uses an unsigned type,
	  which leads to slightly different code for tag switches.
	  At `-O2' the two code sequences look pretty similar in terms of
	  performance as far as I can tell.  At `-O0', the code for
	  the switch on an unsigned type is better.
	- `--target asm' generates inline code for strcmp() even at `-O0',
	  I think.

There are a few other differences that I haven't analyzed,
but the relative performance should be almost the same.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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