Return-Path: queinnec@margaux.inria.fr Received: by jove.pa.dec.com; id AA12432; Mon, 10 Jun 91 02:18:54 -0700 Received: by uucp-gw-1.pa.dec.com; id AA25584; Mon, 10 Jun 91 02:18:33 -0700 Received: from margaux.inria.fr by corton.inria.fr (5.65c+/90.0.9) via Fnet-EUnet id AA24416; Mon, 10 Jun 91 11:18:18 +0200 (MET) Received: by margaux.inria.fr, Mon, 10 Jun 91 11:17:34 +0200 Date: Mon, 10 Jun 91 11:17:34 +0200 From: Christian Queinnec Message-Id: <9106100917.AA09721@margaux.inria.fr> To: bartlett, (Joel, Bartlett) Subject: Scheme to C ported onto Sony News 3200 Circa: June 7, 1991. Return-Address: queinnec@poly.polytechnique.fr ( Christian Queinnec ) Hello, Here follows the shared patches to port Scheme to C onto a Sony News 3200. It is a Mips r3000 machine but a big endian one while the DEC3100 is a little endian machine. I just basically took the MIPS version and added some patches coming from REC-28sep90.patches. The result runs all the tests you provided but it fails on some tests of the Aubrey Jaffer's suite. Thanks for your work. Christian. PS: I send you the patches and a script to do the actual port. To whom it may interest, save this file, unshar it and run the readme script. #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'SONY-readme' <<'END_OF_FILE' X#! /bin/sh X# Regenerate Scheme to C for Sony News 3200 X# X# First, ftp the current release of Scheme to C, say 28sep90.tar.Z X# Second, ftp the patches for Sony News3200 for the same release X# These patches are probably named: SONY-28sep90.patches X# Store the two files in your current directory. X# BEWARE: You must roughly have 17 megs free to run this script ! X# What is finally installed (in /usr/local) takes 2.2 megs. X X# if not yet done, creates this script and SONY.patches Xunshar -n SONY-28sep90.patches X# Prepare a directory to contain the original sources of Scheme to C Xmkdir 28sep90 X( cd 28sep90 ; uncompress -c ../28sep90.tar.Z | tar -xvf - ) X# Use the makefile of Scheme to C to get a copy of the sources Xcd 28sep90 Xmake "SRCDIR=`pwd`" "CPU=MIPS" "CPUDIR=../sony3200" "BINDIR=bin" "LIBDIR=lib" forCPU X# Now go to the final directory where all things happen Xcd ../sony3200 X# get the patches Xpatch -p0 <../SONY.patches X# rebuild the entire system Xmake port X# test it optionally X(cd test ; make all ; test; test50; test51; test52; test54) X# To install the result, you must be root, do something like: X## su root Xmkdir /usr/local/schemetoc Xmake "LIBDIR=/usr/local/" "BINDIR=/usr/local/bin" install X## exit X# Now clean up all the things Xmake clean clean-sc-to-c X( cd test ; rm test test5? ) X# There are also other things to erase now X#( cd scrt ; rm sci ) X#( cd scsc ; rm sccomp sccomp.heap ) X END_OF_FILE if test 1416 -ne `wc -c <'SONY-readme'`; then echo shar: \"'SONY-readme'\" unpacked with wrong size! fi # end of 'SONY-readme' fi if test -f 'SONY.patches' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'SONY.patches'\" else echo shar: Extracting \"'SONY.patches'\" \(12019 characters\) sed "s/^X//" >'SONY.patches' <<'END_OF_FILE' XOnly in ../28sep90/: CHANGES XOnly in ../28sep90/: README XOnly in ../28sep90/: VAX XOnly in ../28sep90/: cdecl XCommon subdirectories: ../28sep90//doc and .//doc XOnly in ../28sep90/: gnuemacs Xdiff -r -c ../28sep90//makefile .//makefile X*** ../28sep90//makefile Tue Apr 10 22:48:28 1990 X--- .//makefile Fri Jun 7 13:03:23 1991 X*************** X*** 1,3 **** X--- 1,5 ---- X+ BINDIR = bin X+ LIBDIR = lib X # X # This file is used to make the Scheme->C system for multiple processor types. X # XCommon subdirectories: ../28sep90//scrt and .//scrt XCommon subdirectories: ../28sep90//scsc and .//scsc XCommon subdirectories: ../28sep90//test and .//test XOnly in ../28sep90/: xlib Xdiff -r -c ../28sep90//doc/makefile .//doc/makefile X*** ../28sep90//doc/makefile Mon Dec 19 20:54:45 1988 X--- .//doc/makefile Fri Jun 7 13:03:24 1991 X*************** X*** 1,3 **** X--- 1,4 ---- X+ SRCDIR = /usr/users/queinnec/public/bartlett/28sep90/doc X # X # Makefile for distributing the Scheme->C documentation. X # XOnly in .//scrt: GGC.c XOnly in .//scrt: GGC.h XOnly in .//scrt: GGCheap.c XOnly in .//scrt: GGCprivate.h XOnly in .//scrt: GGCscinit.c XOnly in .//scrt: RCS XOnly in .//scrt: libsc.a XOnly in .//scrt: makefile XOnly in ../28sep90//scrt: makefile-tail Xdiff -r -c ../28sep90//scrt/mips.s .//scrt/mips.s X*** ../28sep90//scrt/mips.s Fri Sep 21 21:55:03 1990 X--- .//scrt/mips.s Fri Jun 7 13:41:23 1991 X*************** X*** 49,55 **** X--- 49,60 ---- X collection. X */ X X+ #ifdef sony_news X+ #include X+ #define s8 $30 X+ #else X #include X+ #endif X X .text X .align 2 Xdiff -r -c ../28sep90//scrt/objects.h .//scrt/objects.h X*** ../28sep90//scrt/objects.h Fri Sep 21 21:56:06 1990 X--- .//scrt/objects.h Fri Jun 7 17:38:50 1991 X*************** X*** 60,65 **** X--- 60,69 ---- X #endif X #endif X X+ #ifdef sony_news X+ #include X+ #endif X+ X /* The Scheme->C installer may elect to have arithmetic overflow handled X gracefully on either the MIPS or the VAX implementations. The default X is to handle it. X*************** X*** 130,141 **** X--- 134,155 ---- X unsigned gned; X } unsi; X struct { /* EXTENDEDOBJ */ X+ #ifdef sony_news X+ unsigned rest:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned rest:24; X+ #endif X } extendedobj; X struct { /* SYMBOL */ X+ #ifdef sony_news X+ unsigned rest:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned rest:24; X+ #endif X TSCP name; X TSCP *ptrtovalue; X TSCP value; X*************** X*** 142,172 **** X--- 156,212 ---- X TSCP propertylist; X } symbol; X struct { /* STRING */ X+ #ifdef sony_news X+ unsigned length:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned length:24; X+ #endif X char char0; X } string; X struct { /* VECTOR */ X+ #ifdef sony_news X+ unsigned length:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned length:24; X+ #endif X TSCP element0; X } vector; X struct { /* PROCEDURE */ X+ #ifdef sony_news X+ unsigned optional:16; X+ unsigned required:8; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned required:8; X unsigned optional:16; X+ #endif X TSCP (*code)(); X TSCP closure; X } procedure; X struct { /* CLOSURE */ X+ #ifdef sony_news X+ unsigned length:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned length:24; X+ #endif X TSCP closure; X TSCP var0; X } closure; X struct { /* CONTINUATION */ X+ #ifdef sony_news X+ unsigned length:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned length:24; X+ #endif X TSCP continuation; X jmp_buf savedstate; X int *address; X*************** X*** 174,196 **** X--- 214,256 ---- X int word0; X } continuation; X struct { /* FLOAT32 */ X+ #ifdef sony_news X+ unsigned rest:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned rest:24; X+ #endif X float value; X } float32; X struct { /* FLOAT64 */ X+ #ifdef sony_news X+ unsigned rest:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned rest:24; X+ #endif X double value; X } float64; X struct { /* FORWARD */ X+ #ifdef sony_news X+ unsigned length:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned length:24; X+ #endif X TSCP forward; X } forward; X struct { /* WORDALIGN */ X+ #ifdef sony_news X+ unsigned length:24; X unsigned tag:8; X+ #else X+ unsigned tag:8; X unsigned length:24; X+ #endif X } wordalign; X struct { /* PAIR */ X TSCP car; X*************** X*** 752,758 **** X--- 812,831 ---- X X /* C declarations */ X X+ #ifdef sony_news X #define DEFSTRING( name, chars, len ) \ X+ static struct { unsigned length:24; \ X+ unsigned tag:8; \ X+ char char0[len+(4-(len % 4))]; } \ X+ name = { len, STRINGTAG, chars } X+ X+ #define DEFFLOAT( name, value ) \ X+ static struct { unsigned length:24; \ X+ unsigned tag:8; \ X+ FLOATTYPE f; } \ X+ name = { 0, FLOATTAG, value } X+ #else X+ #define DEFSTRING( name, chars, len ) \ X static struct { unsigned tag:8; \ X unsigned length:24; \ X char char0[len+(4-(len % 4))]; } \ X*************** X*** 763,768 **** X--- 836,842 ---- X unsigned length: 24; \ X FLOATTYPE f; } \ X name = { FLOATTAG, 0, value } X+ #endif X X #define DEFTSCP( name ) TSCP name X XOnly in ../28sep90//scrt: scdebug.c XOnly in ../28sep90//scrt: sceval.c XOnly in ../28sep90//scrt: scexpand.c XOnly in ../28sep90//scrt: scexpanders1.c XOnly in ../28sep90//scrt: scexpanders2.c XOnly in ../28sep90//scrt: sci.c Xdiff -r -c ../28sep90//scrt/scinit.c .//scrt/scinit.c X*** ../28sep90//scrt/scinit.c Fri Sep 21 21:57:01 1990 X--- .//scrt/scinit.c Fri Jun 7 18:37:53 1991 X*************** X*** 55,62 **** X--- 55,67 ---- X extern etext; X #ifdef MIPS X #define ETEXT ((int)&etext) /* First address after text */ X+ #ifdef sony_news X+ #include X+ #include X+ #else X #include X #include X+ #endif X #define STACKBASE (int*)USRSTACK X #endif X #ifdef TITAN X*************** X*** 722,729 **** X--- 727,738 ---- X sc_cstringtostring( "28sep90jfb" ), X sc_cons( X #ifdef MIPS X+ #ifdef sony_news X+ sc_cstringtostring( "Sony News3200" ), X+ #else X sc_cstringtostring( "DECstation3100" ), X #endif X+ #endif X #ifdef TITAN X sc_cstringtostring( "WRL-TITAN" ), X #endif X*************** X*** 732,739 **** X--- 741,752 ---- X #endif X sc_cons( X #ifdef MIPS X+ #ifdef sony_news X+ sc_cstringtostring( "R3000" ), X+ #else X sc_cstringtostring( "R2000" ), X #endif X+ #endif X #ifdef TITAN X sc_cstringtostring( "BYTE-ADDRESSED" ), X #endif X*************** X*** 741,747 **** X--- 754,764 ---- X sc_cstringtostring( "VAX" ), X #endif X sc_cons( X+ #ifdef sony_news X+ sc_cstringtostring( "NewsOS" ), X+ #else X sc_cstringtostring( "ULTRIX" ), X+ #endif X sc_cons( X FALSEVALUE, X EMPTYLIST XOnly in ../28sep90//scrt: scqquote.c XOnly in ../28sep90//scrt: screp.c XOnly in ../28sep90//scrt: scrt1.c XOnly in ../28sep90//scrt: scrt2.c XOnly in ../28sep90//scrt: scrt3.c XOnly in ../28sep90//scrt: scrt4.c XOnly in ../28sep90//scrt: scrt5.c XOnly in ../28sep90//scrt: scrt6.c XOnly in ../28sep90//scrt: scrt7.c Xdiff -r -c ../28sep90//scrt/signal.c .//scrt/signal.c X*** ../28sep90//scrt/signal.c Fri Sep 21 22:00:13 1990 X--- .//scrt/signal.c Fri Jun 7 13:41:04 1991 X*************** X*** 53,60 **** X--- 53,65 ---- X extern TSCP scrt4_onsignal2(); X X #ifdef MIPS X+ #ifdef sony_news X+ #include X+ #include X+ #else X #include X #include X+ #endif X #endif X X int sc_mutex; /* Mutual exclusion flag */ XOnly in ../28sep90//scsc: callcode.c XOnly in ../28sep90//scsc: closeana.c XOnly in ../28sep90//scsc: compile.c XOnly in ../28sep90//scsc: expform.c XOnly in ../28sep90//scsc: gencode.c XOnly in ../28sep90//scsc: lambdacode.c XOnly in ../28sep90//scsc: lambdaexp.c XOnly in ../28sep90//scsc: lap.c XOnly in ../28sep90//scsc: load.sc XOnly in ../28sep90//scsc: macros.c XOnly in ../28sep90//scsc: main.c XOnly in .//scsc: makefile XOnly in ../28sep90//scsc: makefile-tail XOnly in ../28sep90//scsc: misccode.c XOnly in ../28sep90//scsc: miscexp.c XOnly in ../28sep90//scsc: plist.c XOnly in ../28sep90//scsc: readtext.c XOnly in ../28sep90//scsc: transform.c XOnly in .//test: makefile XOnly in ../28sep90//test: makefile-tail Xdiff -r -c ../28sep90//test/test16.sc .//test/test16.sc X*** ../28sep90//test/test16.sc Fri Feb 23 04:11:07 1990 X--- .//test/test16.sc Fri Jun 7 18:08:25 1991 X*************** X*** 52,57 **** X--- 52,62 ---- X ;;; *.* Extensions for accessing C structures. At the moment, they assume X ;;; that the bits are ordered like the VAX. X X+ (let ((big-endian (or (member (list-ref (implementation-information) 2) X+ '("Sony News3200") ) X+ (member (list-ref (implementation-information) 3) X+ '("SPARC") ) ))) X+ X (let ((s (make-string 10 #\*))) X (c-byte-set! s 0 (char->integer #\S)) X (c-byte-set! s 1 (char->integer #\c)) X*************** X*** 71,84 **** X (let ((s (make-string 10 #\*))) X (c-int-set! s 0 #xffff) X (chk 10 (c-int-ref s 0) #xffff) X! (chk 11 (c-shortunsigned-ref s 0) #xffff) X! (chk 12 (c-shortunsigned-ref s 2) 0) X! (chk 13 (c-shortint-ref s 0) -1) X! (chk 14 (c-shortint-ref s 2) 0) X! (c-shortint-set! s 2 -1) X! (chk 15 (c-int-ref s 0) -1) X! (c-shortunsigned-set! s 0 #xfffe) X! (chk 16 (c-int-ref s 0) -2)) X X (let ((s (make-string 10 #\*))) X (c-unsigned-set! s 0 (- (expt 2 32) 1)) X--- 76,100 ---- X (let ((s (make-string 10 #\*))) X (c-int-set! s 0 #xffff) X (chk 10 (c-int-ref s 0) #xffff) X! (if big-endian X! (begin X! (chk 11 (c-shortunsigned-ref s 2) #xffff) X! (chk 12 (c-shortunsigned-ref s 0) 0) X! (chk 13 (c-shortint-ref s 2) -1) X! (chk 14 (c-shortint-ref s 0) 0) X! (c-shortint-set! s 0 -1) X! (chk 15 (c-int-ref s 0) -1) X! (c-shortunsigned-set! s 2 #xfffe) X! (chk 16 (c-int-ref s 0) -2)) X! (begin X! (chk 11 (c-shortunsigned-ref s 0) #xffff) X! (chk 12 (c-shortunsigned-ref s 2) 0) X! (chk 13 (c-shortint-ref s 0) -1) X! (chk 14 (c-shortint-ref s 2) 0) X! (c-shortint-set! s 2 -1) X! (chk 15 (c-int-ref s 0) -1) X! (c-shortunsigned-set! s 0 #xfffe) X! (chk 16 (c-int-ref s 0) -2)))) X X (let ((s (make-string 10 #\*))) X (c-unsigned-set! s 0 (- (expt 2 32) 1)) X*************** X*** 99,105 **** X X (let ((s (make-string 10 #\*)) X (v (make-vector 10 -1))) X! (chk 40 (scheme-byte-ref s 1) 10) X (chk 41 (scheme-byte-ref s 4) (char->integer #\*)) X (chk 42 (scheme-byte-ref s 14) 0) X (scheme-byte-set! s 5 (char->integer #\^)) X--- 115,123 ---- X X (let ((s (make-string 10 #\*)) X (v (make-vector 10 -1))) X! (if big-endian X! (chk 40 (scheme-byte-ref s 2) 10) X! (chk 40 (scheme-byte-ref s 1) 10)) X (chk 41 (scheme-byte-ref s 4) (char->integer #\*)) X (chk 42 (scheme-byte-ref s 14) 0) X (scheme-byte-set! s 5 (char->integer #\^)) X*************** X*** 123,126 **** X (chk 55 (bit-or 1 3 5) 7) X (chk 56 (bit-xor 1 3 5) 7) X (chk 57 (bit-lsh 1 31) 2147483648.) X! (chk 58 (bit-rsh -1 31) 1)) X--- 141,144 ---- X (chk 55 (bit-or 1 3 5) 7) X (chk 56 (bit-xor 1 3 5) 7) X (chk 57 (bit-lsh 1 31) 2147483648.) X! (chk 58 (bit-rsh -1 31) 1))) XOnly in .//test: test16.sc.orig XOnly in .//test: test18.tmp XOnly in .//test: test19.tmp END_OF_FILE if test 12019 -ne `wc -c <'SONY.patches'`; then echo shar: \"'SONY.patches'\" unpacked with wrong size! fi # end of 'SONY.patches' fi echo shar: End of shell archive. exit 0