README file for kForth for Mac OS X ppc snapshots (dnw) In general, snapshots include enough stuff to build the ppc port, and run the tests in core.4th, regress.4th, divtest.4th, and dbl.4th. They also include various source files from the kForth distribution that run successfully. The snapshot archive is obtained by: make snapshot The executable is built by: make kforth Or to include kforth-fast: make all To run the current Hayes-style tests: kforth core kforth-fast core kforth regress kforth-fast regress kforth divtest kforth-fast divtest kforth dbltest kforth-fast dbltest 14-Jun-06 --------- Version 1.4.0 release. Fixed faulty printing comment about SOURCE test in core.4th. Verified that KFORTH_DIR environment variable works with OS X. In Makefile, substituted plain vanilla syntax for "cp --target-directory=..." under "archive", which doesn't work in OS X. Adjusted title of README. 13-Jun-06 --------- Nearly ready to release, sync'ing with linux kforth-2006-06-12. Substituted Krishna's new dbltest.4th, which uncomments the tests for D2* and D2/, and includes ans-words.4th. Substituted Krishna's new ForthVM.cpp and ForthVM-fast.cpp. Uncommented UTM/ in ForthCompiler.cpp and ForthCompiler-fast.cpp to sync with linux version. Uncommented CPU-TEST in ForthCompiler-fast.cpp to sync with linux. Added Krishna's suggested copyright statement to startup banner in kforth.cpp. Synchronized *.4th files to linux list, except that files.4th keeps the changes supplied by Krishna for OS X, and we include pispigot.4th, sudoku.4th. Also, core.4th has SOURCE test commented out. Linux version will do this too. Synchronized Makefile's as far as natural for OS X context, and abbreviated revision log. Rewrote README for Mac OS X ppc. We haven't checked the X Windows functionality. Present in ppc fbc.h but not linux: // 2006-05-30 km added OP_MOVE 06-Jun-06 --------- Added L_move to vm-osxppc.s and vm-osxppc-fast.s as a primitive, and made it visible, aiming to sync with Krishna's linux snapshot of 2006-06-05. Made MOVE visible, and commented out the corresponding source in ans-words.4th. Revised L_cmove and L_cmovefrom to use persistent registers. The ppc and x86 cpp, .c, and .h files are in sync except for CPUTEST, UTM/, and F0> in ForthCompiler.cpp and ForthCompiler-fast.cpp. 05-Jun-06 --------- Added tests for SP! and RP! to regress.4th. 03-Jun-06 --------- Krishna found that regress.4th fails with SP@ in the x86 version. Turns out we simply fetched GlobalSp and GlobalRp, instead of adjusting to point to the tops of the stacks. Fixed vm-osxppc.s, vm-osxppc-fast.s, as well as regress.4th. 25-Apr-2006 ----------- Cleaned up comments in vm-osxppc.s and vmp-oxsppc-fast.s, including the repair of a few erroneous statements. The ppc port seems ready to release. 20-Apr-2006 ----------- Cleaned up F>D tests in regress.4th and added some. Added Krishna's intrinsic word SYSCALL (C_syscall in vmc.c and vmc-fast.c) to provide a method for calling low-level system functions. It's not entirely portable between Linux and Darwin, but both get it from BSD, and there's a lot of overlap. Replaced hmac-md5.4th by Krishna's new version. Added lists.4th, lists-test.4th, struct.4th, gps.4th, hmac-md5.4th to snapshots. Replaced hmac-md5.4th by Krishna's new version. 17-Apr-2006 ----------- With more confidence in our understanding of the OS X ppc ABI, we reduced the sizes of the stack frames for subroutine calls. In preparation for L_ftod, added a macro, _DLT, and used it in L_dlt, where it passed the tests. Added a macro _QDNEG for L_ftod, to restore the sign. We're pleased with it. Added L_ftod, with tests for F>D in regress.4th. Added complex.4th and complex-test.4th to snapshots in Makefile. 16-Apr-2006 ----------- Fixed L_wfetch in vm-osxppc-fast.s, inadvertently left out. Krishna found that complex-test.4th fails. Fixed by adding L_dfloats, and L_dfloatplus, which were somehow left out. Added corresponding tests to regress.4th. Now complex-test.4th works. Looked for more unpopulated stubs in vm-osxppc.s and vm-osxppc-fast.s, but didn't find any, except for L_jnz, which is "not implemented" in the linux version. Hope we've really got 'em all! 15-Apr-2006 ----------- The experts in the darwin-dev list say our linkage scheme for clib functions is normal for non-PIC executables. So we'll use it, as long as kForth is not a dynamic, loadable library. Replaced vmc.c and vmc-fast.c from kforth-x86-linux-2006-04-15.tar.gz, to include Krishna's fix for signals, and added signal-test.4th to snapshots, which runs fine on our system. Changed L_wfetch to load with sign extension, in accord with the kForth policy, and modifed W@ tests in regress.4th accordingly. The implementation of L_ftod remains to be done. 13-Apr-2006 ----------- Added all of the rest of the words, with tests, except for L_ftod. Added code for L_fzerogt and made F0> visible. Made UTM/ and CPUTEST invisible by commenting out their dictionary entries, but left #define's for OP_UTMSLASH and OP_CPUTEST. Commented out UTM/ tests in divtest.4th. Except for the changes in the above paragraph, *.cpp, *.c, and *.h files are identical to those of Krishna's 1.4.0 Linux distribution. The Makefile's are sync'd, up to target and snapshot differences. The file ans-words.4th is different, because DMAX and DMIN are instrinsic, and because UDM* is used instead of M*/ in >NUMBER. Did some code optimizations -- don't see any more obvious ones. Added more *.4th files, caught up to Krishna's list of those that work, AFAIK. Replaced sieve.fs by siev.fs, to agree with gforth and pfe's 1000 iteration versions. Need to check with the experts whether our simplified scheme for clib function linkage might cause future problems. The only remaining thing that I can think of that needs checking is whether multiprecision division overflow needs an extra test for words that floor a symmetric division result. 10-Apr-2006 ----------- The fast version is working, and included in snapshots. It passes the four sets of Hayes tests, except we haven't retried the rather tedious error return tests. The usual benchmarks on our dual G4/1.42GHz: slow / fast SIEVE 3.282 / 2.682 = 1.224 BUBBLE-SORT 3.803 / 3.093 = 1.230 MATRIX-MULT 3.093 / 2.411 = 1.283 FIB 4.724 / 3.987 = 1.185 Fixed a type-stack bug in L_dminus. 09-Apr-2006 ----------- The first snapshot to adopt the persistent register version. The version number is now 1.4.0, in sync with Krishna. Replaced #define NUMBER_OF_INTRINSIC_WORDS by an automatic caluclation. Removed DMIN and DMAX from ans-words.4th because now they're intrinsic. Modified Makefile for consolidated setup. Added the analogue of Krishna's linux/intel target information for macos/ppc. 06-Mar-2006 -- 08-Apr-2006 -------------------------- The earlier series of snapshots was a parallel development of nonregister and register ppc versions. That was terminated after it was determined that the register version gave a speedup of roughly 1.03 over the nonregister version for the four standard benchmarks on a dual G4, and Krishna found a speedup of about 1.07 on a dual G5 for "mv e2e4" in Ian Osgood's chess program, tscp.4th. Besides being modestly faster, it is easier to write ppc asssembly language intrinisic words in the register version, with due care to avoid using the persistent registers in words that can be called from outside the virtual machine, where they may not be properly initialized.