[MLton-devel] Fwd: C back end for MLton

Stephen Weeks MLton@mlton.org
Mon, 4 Nov 2002 11:14:33 -0800


Hi Brad.  Suresh forwarded us (MLton@mlton.org) the mail that you sent
regarding MLton.

> Subject: C back end for MLton
> Date: Sun, 3 Nov 2002 22:55:50 -0500 (EST)
> From: Brad Lucier <lucier@math.purdue.edu>
> To: suresh@cs.purdue.edu
> Cc: lucier@math.purdue.edu
> 
> I looked at the C back end for MLton.  I didn't understand a word, of
> course, but I do know a fair amount about Gambit's C backend strategy,
> and I think you could get the C back end of MLton to generate *much*
> faster code.

Although we mostly live with the native codegen, we would be
interested in improving the C codegen, because it is likely what we
would use first in porting to a new architecture.  We did spend some
time years ago tuning the C backend when it was our sole means of
generating code, but it has received little attention in the last year
or two.

If you have any questions about how MLton's C codegen works, or even
better, would like to try some patching yourself, we'd be happy to
answer any questions.  We would appreciate any help you can give in
the C codegen, the runtime, or anywhere else for that matter.

Suresh also mentioned that you might be interested in running MLton on
Alpha's and PowerPCs.  One of our users, Alain Deutsch, has ported the
C codegen to run on Sparcs.  I assume it would be comparable amount of
effort to port the C codegen to Alpha or PowerPC.  Unfortunately,
Alain's work hasn't made been merged in with our CVS due to lack of
resources.  If you're interested in pursuing a port, we can get
whatever he did to you.

> BTW, mlton won't build with gcc 3.3 (the development version).  There's
> a problem in basis/Int/quot.c; the warnings are typical of the warnings
> for other files in this directory.
> 
> make[2]: Entering directory `/home/lucier/programs/mlton-20020923/runtime'
> if [ linux = freebsd ] && ! [ -r gmp.h -a -r libgmp.a ]; then   \
>         cp /usr/local/lib/mlton/self/libgmp.a
>  /usr/local/lib/mlton/self/include/gmp.h ./;               \ fi
> gcc -Wall -I. -mcpu=pentiumpro -malign-loops=2 -malign-jumps=2
>  -malign-functions=5 -fomit-frame-pointer  -O1 -DNODEBUG -c -o
>  basis/Int/quot.o basis/Int/quot.c cc1: warning: -malign-loops is obsolete,
>  use -falign-loops
> cc1: warning: -malign-jumps is obsolete, use -falign-jumps
> cc1: warning: -malign-functions is obsolete, use -falign-functions

These switches are in the mlton shell script, and so are easy enough
to fix yourself.  I'm not sure what to with our distribution so it
works for everyone.  I guess we can add some tests for gcc version in
the shell script.

> basis/Int/quot.c: In function `Int_quot':
> basis/Int/quot.c:10: error: asm-specifier for variable `eax' conflicts with
>  asm clobber list

I tried changing line 6 of quot.c to

	register int eax asm("eax");

and recompiled with gcc 2.96 without complaints.  Maybe that would be
enough to make gcc 3.3 happy?  Can you try it out and let us know?

BTW, please feel free to send any MLton-development-related questions
to MLton@mlton.org (to which Suresh is subscribed).  There are several
active developers reading this list.  Or, if your question is just
about using MLton, you could send it to MLton-user@mlton.org.


-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel