[comp.lang.scheme.c] MIT Scheme & mc68000 code from the Compiler.

smr@beach.cis.ufl.edu (Samual Rushing) (08/16/90)

I am interested in porting the MIT Scheme system to the Amiga home
computer.  A few of us Amiga fanatics have just ported GCC, and we can
now use it to port other software that until now has been untouchable
with the available C compilers .  We've compiled most of the microcode
with no problems (except the unix.c file, which will take some work),
so I'm pretty sure the interpreter could be made to work. 

It would be very nice if we could support compiled code on generic
Amiga's with 68000's.  Can the Scheme compiler produce plain 68000
code, and do 68881 stuff in software?  From what code I've looked 
through in the 7.0 distribution, it seems there are only two machine
configurations supported: Vax and 68020 & 68881.  Will this require
work - and has it been done already?  Am I going to have to upgrade
to an '020 or '030 Amiga?

--
(not (not (not (not (not ... )))))
-------------------------------------------------------------------------------
smr@beach.cis.ufl.edu				    rushing@titan.ksc.nasa.gov

jinx@ZURICH.AI.MIT.EDU (Guillermo J. Rozas) (08/16/90)

    It would be very nice if we could support compiled code on generic
    Amiga's with 68000's.  Can the Scheme compiler produce plain 68000
    code, and do 68881 stuff in software?  From what code I've looked 
    through in the 7.0 distribution, it seems there are only two machine
    configurations supported: Vax and 68020 & 68881.  Will this require
    work - and has it been done already?  Am I going to have to upgrade
    to an '020 or '030 Amiga?

The main problem is not the 68881 but the 68020 addressing modes not
supported by the 68000.

All the floating point code can be turned off and the operations done
out of line, handled by whatever routines C uses for floating point
computation.

The problem is that the current back end assumes that it can use the
addressing modes not available on the 68000 quite freely, and making
it not use them would require work.

Furthermore, it also assumes that shifts and rotates are cheap, since
the 68020 has a barrel shifter, but they are expensive on the 68000.

The compiler was originally brought up on a plain 68000, but it has
changed sufficiently after we moved to the 68020 that it would be more
work to bring the original back end up to the present than to modify
the current one to use only 68000 instructions and addressing modes.

If you are interested in doing this, I can point out to the likely
problem places and tell you what you can do about them, but to my
knowledge no one has done the work.

BTW, if you are not on a hurry, you should wait until a new release
comes out (or try to get a pre-release from us).  The back end was
changed a fair amount to avoid 68020 addressing modes when we found
out that the fastest code for a 68020 was plain-68000 code, so
starting from the current version would be better than starting from
7.0 .  In addition, the OS-dependent code has been cleaned up
significantly, and it should be easier to port.