[MLton] power pc "port"

Filip Pizlo pizlo@purdue.edu
Sat, 4 Sep 2004 01:08:56 -0500 (EST)


> > Anyway, I investigated further by adding some tracing to
> > fixed-integer.sml.  Turns out that this exception is occurring on the very
> > first test (Int2), in the very beginning where it tries to do
> > Int2.toString.  From there, I've been trying to figure out exactly how
> > toString gets to sub - with not very much luck.
> 
> That's not too hard to see:
>   Int2.toString calls
>   Int8.toString calls
>   Int8.fmt which does a bunch of operations on CharArray.array,
>   which are built by the sequence functor.

Ah, I see.  That saved me some grepping. :-)

> The first thing I would try is to look at the rest of the regression
> tests.  You should be able to make it past modules now.  There is always a
> chance that multiple regression failures arise from the same underlying
> problem and you can "triangulate" from them.

I've started another run of the regression tests.  I'll send out another
e-mail when they finish or die - which won't be for a while.  The tests
seem to take a very long time.  Can someone give me an estimate of how
long they take on a fairly average PC?

> I'm especially curious to know if the int.sml regession has any failures.
> I notice that the formatting routine needs to perform Int8.quot and
> Int8.rem.  Those are an obvious candidate for problems when moving to a
> new architecture.

Going by your comments and comments from Stephen, I wrote a simple test in
C that goes as follows:

#include <stdio.h>

int main() {
        printf("2/1 = %d\n",2/1);
        printf("1%%2 = %d\n",1%2);
        printf("-2/1 = %d\n",-2/1);
        printf("-1%%2 = %d\n",-1%2);
        printf("2/-1 = %d\n",2/-1);
        printf("1%%-2 = %d\n",1%-2);
        printf("-2/-1 = %d\n",-2/-1);
        printf("-1%%-2 = %d\n",-1%-2);
	return 0;
}

The results that I got on both Linux/x86 and Darwin/ppc are:

2/1 = 2
1%2 = 1
-2/1 = -2
-1%2 = -1
2/-1 = -2
1%-2 = 1
-2/-1 = 2
-1%-2 = -1

Is this the right test to have done, or did I misunderstand?  'Cause from
this it seems that ppc behaves like x86.

--
Filip Pizlo
http://bocks.psych.purdue.edu/
pizlo@purdue.edu