Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/HISTORY
ViewVC logotype

Diff of /sml/trunk/HISTORY

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1158, Fri Mar 22 01:21:25 2002 UTC revision 1491, Tue May 18 20:49:37 2004 UTC
# Line 13  Line 13 
13  Description:  Description:
14    
15  ----------------------------------------------------------------------  ----------------------------------------------------------------------
16    Name: Matthias Blume (blume (at) tti - c (dot) org)
17    Date: 2004/05/18 15:50:00 CDT
18    Tag: blume-20040518-mkreader
19    Description:
20    
21    Added Posix.IO.mk{Bin,Text}{Reader,Writer} by lifting their respective
22    implementations from internal modules PosixBinPrimIO and PosixTextPrimIO.
23    
24    ----------------------------------------------------------------------
25    Name: Matthias Blume (blume (at) tti - c (dot) org)
26    Date: 2004/05/11 14:35:00 CDT
27    Tag: blume-20040511-win32sock
28    Description:
29    
30    Added previously missing support for many socket-related functions
31    under win32.  Thanks to David Hansel <hansel@reactive-systems.com>
32    for the voluminous patch!
33    
34    (I have not tested this patch under win32 yet.)
35    
36    Here is David's e-mail:
37    
38    Hi,
39    
40    Attached to this email you find a diff against sml/nj 110.45
41    that will enable socket support under Windows.
42    
43    To apply the patch (using unix or cygwin)
44    1) gunzip runtime.diff.gz
45    2) "cd" into "src/runtime" in the source tree of a fresh
46       110.45 installation.
47    3) patch -p 1 < [your/path/to]runtime.diff
48    
49    The code compiles fine but has NOT yet been extensively tested.
50    I only ran a few tests for basic socket client functionality
51    (which worked fine).  Especially the functions that use ioctl
52    are not tested at all and might not work (see below).
53    
54    I implemented this since we want to move to a newer version of sml/nj
55    but need socket support in order to use it.  This is the first time I
56    even had a look at the sml/nj source,  so please review my changes
57    before making this part of the distribution!  Here are a few issues
58    that I think might be better for someone to solve who is more
59    familiar with the sml/nj source (and socket programming):
60    
61    - getnetbyaddr.c and getnetbyname.c will raise a "not implemented"
62      exception since I could not figure out what the windows equivalent
63      of these functions is
64    
65    - In sockets-osdep.h there are a some #include statements that are
66      only used in a few files that include sockets-osdep.h
67    
68    - In smlnj-sock-lib.c, function init_fn() calls WSAStartup() but
69      does not process its return value since I don't know how to
70      report an error upwards.
71    
72    - It would probably be good to have a call to WSACleanup() when
73      the library is unloaded (if there is such a possibility).
74      Otherwise I think Windows will take care of this automatically
75      when the process finishes.
76    
77    - I used ioctlsocket() as a replacement for ioctl() but I have
78      no idea if that is actually the proper replacement on Windows.
79    
80    - All these issues are marked in the code by "FIXME" comments.
81    
82    We use sml/nj extensively in our products and are quite happy
83    with it.  I hope this contribution will help you.
84    
85    Keep up the good work!
86    
87    David
88    
89    ----------------------------------------------------------------------
90    Name: Matthias Blume (blume (at) tti - c (dot) org)
91    Date: 2004/05/11 14:20:00 CDT
92    Tag: blume-20040511-installml
93    Description:
94    
95    Fixed two bugs in installml script.  (Thanks to Vesa A. Norrman for
96    the patch.)
97    
98    ----------------------------------------------------------------------
99    Name: Matthias Blume (blume (at) tti - c (dot) org)
100    Date: 2004/05/11 14:05:00 CDT
101    Tag: blume-20040511-nlffi-netbsd
102    Description:
103    
104    Added support for nlffi under netbsd.  (Thanks to Vesa A. Norrman for
105    the patch.)
106    
107    ----------------------------------------------------------------------
108    Name: Matthias Blume (blume (at) tti - c (dot) org)
109    Date: 2004/05/11 12:05:00 CDT
110    Tag: blume-20040511-exports
111    Description:
112    
113    As per request by Adam Chlipala <adam@hcoop.net>, extended various
114    export lists in compiler-related .cm-files.
115    
116    ----------------------------------------------------------------------
117    Name: Matthias Blume (blume (at) tti - c (dot) org)
118    Date: 2004/05/11 11:35:00 CDT
119    Tag: blume-20040511-allsource
120    Description:
121    
122    The installer now honors the "src-smlnj" target again, although its meaning
123    has changed from "all sources required for the compiler" to "all sources
124    the installer knows about".  In other words, if you enable "src-smlnj"
125    in the "targets" file, then the installer will pull in sources for
126    everything.  (Notice that this refers to source code only.  Compiled
127    code is still only installed for modules that were requested explicitly
128    or which are required for other modules that were requested explicitly.)
129    
130    ----------------------------------------------------------------------
131    Name: Matthias Blume (blume (at) tti - c (dot) org)
132    Date: 2004/04/23 17:40:00 CDT
133    Tag: blume-20040423-ieee-scan
134    Description:
135    
136    Fixed IEEEReal.scan (and .fromString) so that if there is an overflow
137    in the exponent calculation we get INF or ZERO (depending on the mantissa
138    and the sign of the exponent).
139    
140    ----------------------------------------------------------------------
141    Name: Matthias Blume (blume (at) tti - c (dot) org)
142    Date: 2004/04/23 10:40:00 CDT
143    Tag: blume-20040423-ml-build
144    Description:
145    
146    The ml-build script now terminates with a non-0 status when something
147    goes wrong.
148    
149    ----------------------------------------------------------------------
150    Name: Matthias Blume (blume (at) tti - c (dot) org)
151    Date: 2004/04/22 16:35:00 CDT
152    Tag: blume-20040422-Option
153    Description:
154    
155    Made exception Option to be the same as exception Option.Option
156    (as it should be).
157    
158    ----------------------------------------------------------------------
159    Name: Allen Leung (leunga (at) reservoir (dot) com)
160    Date: 2004/03/19 14:40:00 EST
161    Tag: leunga-20040319-cygwin-nlffi
162    Description:
163    
164    Fixed the runtime so that ml-nlffi-lib runs on the cygwin version
165    of SML/NJ.  The problem is that
166    
167       lib = dlopen(NULL, ...)
168       f   = dlsym(lib, "malloc");
169    
170    does not work on Windows unless we explicitly export symbols
171    such as 'malloc' during linking.  We fixed this by explicitly
172    exporting the required symbols with the magic gcc incantation:
173    
174        -Wl,--export-all cygwin.def
175    
176    where cygwin.def is a file containing all the symbols that
177    we wish to export.
178    
179    I suspect this is a Windows problem and we'll have to
180    do the same (somehow with windows compilers) when
181    we build the native win32 version with the system
182    calls LoadLibrary/GetProcAddress.
183    
184    ----------------------------------------------------------------------
185    Name: Matthias Blume (blume (at) tti - c (dot) org)
186    Date: 2004/03/04 16:35:00 CST
187    Tag: blume-20040304-intinf-fmt
188    Description:
189    
190    Fixed problem with IntInf.fmt (sign would show up on the right instead
191    of on the left for BIN, OCT, and HEX).
192    
193    ----------------------------------------------------------------------
194    Name: Matthias Blume (blume (at) tti - c (dot) org)
195    Date: 2004/03/04 11:25:00 CST
196    Tag: blume-20040304-symlinks
197    Description:
198    
199    Fixed problem with installer script (unix only) where bin/ml-yacc and
200    friends pointed (via symlinks) to absolute locations instead of just
201    .run-sml.  This was reported by Vesa A Norrman.
202    
203    ----------------------------------------------------------------------
204    Name: Matthias Blume (blume (at) tti - c (dot) org)
205    Date: 2004/02/13 14:50:00 CST
206    Tag: Release_110_45
207    Description:
208    
209    New working version (110.45). New bootfiles.
210    
211    ----------------------------------------------------------------------
212    Name: Matthias Blume (blume (at) tti - c (dot) org)
213    Date: 2004/01/26 15:15:15 CST
214    Tag: blume-20040126-toplevel
215    Description:
216    
217    Improved handling of exceptions at the interactive toplevel.
218    
219    ----------------------------------------------------------------------
220    Name: Matthias Blume (blume (at) tti - c (dot) org)
221    Date: 2004/01/26 11:25:00
222    Tag: blume-20040126-app
223    Description:
224    
225    Type of top-level "app" corrected.
226    Added code for setting vp_limitPtrMask to Win32-specific runtime.
227    
228    ----------------------------------------------------------------------
229    Name: Matthias Blume (blume (at) tti - c (dot) org)
230    Date: 2003/11/18 17:10 CST
231    Tag: blume-20031118-basis-fiddle
232    Description:
233    
234    - changed Timer interface to what might become the spec
235    - POSIX_FLAGS -> BIT_FLAGS according to spec
236    - some other minor discrepancies wrt. spec eliminated
237    
238    ----------------------------------------------------------------------
239    Name: Matthias Blume (blume (at) tti - c (dot) org)
240    Date: 2003/11/06 12:00:00 CST
241    Tag: Release_110_44
242    Description:
243    
244    New working version (110.44). New bootfiles.
245    
246    ----------------------------------------------------------------------
247    Name: Matthias Blume (blume (at) tti - c (dot) org)
248    Date: 2003/11/04 11:50:00 CST
249    Tag: blume-20031104-move-libraries
250    Description:
251    
252    Eliminated the "dont_move_libraries" directive in config/targets.
253    (The mechanism was broken and could not be fixed easily.  Moreover,
254    there does not seem to be any reason not to move all libraries into
255    lib during installation.  I originally implemented this directive as a
256    backward-compatibility feature when I first introduced the new CM.
257    Now that things have been stable for a long time and going back to the
258    old CM is not an option, there is no reason to keep it around.)
259    
260    ----------------------------------------------------------------------
261    Name: Matthias Blume (blume (at) tti - c (dot) org)
262    Date: 2003/11/03 16:00:00 CST
263    Tag: blume-20031103-installdir
264    Description:
265    
266    Made installer honor INSTALLDIR variable again.  (Thanks to Chris
267    Richards for pointing out the problem and providing the solution.)
268    
269    ----------------------------------------------------------------------
270    Name: Matthias Blume (blume (at) tti - c (dot) org)
271    Date: 2003/10/01 17:05:00 CDT
272    Tag: blume-20031001-lal-mlrisc
273    Description:
274    
275    MLRISC bug fix from Lal.
276    
277    ----------------------------------------------------------------------
278    Name: Matthias Blume (blume (at) tti - c (dot) org)
279    Date: 2003/09/30 16:10:00 CDT
280    Tag: blume-20030930-primio-bat
281    Description:
282    
283    1. Added openVector, nullRd, and nullWr to PRIM_IO.
284    2. Improved .bat files (for Win32 port) to make things work under Win95.
285       (thanks to Aaron S. Hawley for this one)
286    
287    ----------------------------------------------------------------------
288    Name: Matthias Blume (blume (at) tti - c (dot) org)
289    Date: 2003/09/26 16:05:00 CDT
290    Tag: blume-20030926-wrappriv
291    Description:
292    
293    Added missing wrapper for privilege "primitive" in $smlnj/viscomp/core.cm.
294    
295    ----------------------------------------------------------------------
296    Name: Matthias Blume (blume (at) tti - c (dot) org)
297    Date: 2003/09/26 15:00:00 CDT
298    Tag: blume-20030926-110_43_3
299    Description:
300    
301    - additional cleanup
302    - version number bump, NEW BOOTFILES
303    
304    ----------------------------------------------------------------------
305    Name: Matthias Blume (blume (at) tti - c (dot) org)
306    Date: 2003/09/26 12:00:00 CDT
307    Tag: blume-20030926-ppautoload
308    Description:
309    
310    I modified the read-eval-print loop so that the autoloader gets
311    invoked whenever the prettyprinter tries to look up a symbol that
312    is not currently defined in the toplevel environment but which
313    appears in CM's autoload registry.  As a result, we see far fewer of
314    those ?.Foo.Bar.xxx names in the prettyprinter's output.
315    
316    In addition to this I tried to clean up some pieces of the Basis
317    implementation (e.g., Socket, Word8Array) in order to prevent other
318    instances of these ?.Foo.Bar.xxx names from being printed.
319    
320    The mechanism that picks names for types still needs some work, though.
321    (Right now it seems that if there is a type A.t which is defined to
322    be B.u, but B is unavailable at toplevel, then A.t gets printed as
323    "?.B.u" although the perhaps more sensible solution would be to use
324    "A.t" in this case.  In other words, the prettyprinter should follow
325    a chain of DEFtycs not farther than there are corresponding toplevel
326    names in the current environment.)
327    
328    ----------------------------------------------------------------------
329    Name: Matthias Blume (blume (at) tti - c (dot) org)
330    Date: 2003/09/24 16:31:00 CDT
331    Tag: blume-20030924-installer
332    Description:
333    
334    Another installer tweak:  All the ML code for the installer is now
335    compiled during CMB.make and put into a little library called
336    $smlnj/installer.cm.  The installation then simply invokes
337    
338       sml -m $smlnj/installer.cm
339    
340    and everything happens automagically.
341    
342    Win32:  ML code senses value of environment variable SMLNJ_HOME.
343    Unix:   ML code senses values of environment variables ROOT, CONFIGDIR,
344            and BINDIR.
345    
346    The new scheme guarantees that the ML code responsible for the installation
347    is in sync with the APIs of the main system.  Also, the installer is
348    somewhat faster because the installer script is precompiled.
349    
350    ----------------------------------------------------------------------
351    Name: Matthias Blume (blume (at) tti - c (dot) org)
352    Date: 2003/09/24 15:35:00 CDT
353    Tag: blume-20030924-synsock
354    Description:
355    
356    Added a signature SYNCHRONOUS_SOCKET to basis.cm.  This is like SOCKET
357    but excludes all non-blocking operations.  Defined SOCKET (in Basis)
358    and CML_SOCKET in terms of SYNCHRONOUS_SOCKET.  Removed superfluous
359    implementations of non-blocking operations from CML's Socket
360    structure.
361    
362    ----------------------------------------------------------------------
363    Name: Matthias Blume (blume (at) tti - c (dot) org)
364    Date: 2003/09/24 15:10:05 CDT
365    Tag: blume-20030924-sockets
366    Description:
367    
368    1. Fixed SOCKET API and implementation to match Basis spec.
369       This required changing the internal representation of sockets to one
370       that remembers (for each socket file descriptor) whether it is currently
371       blocking or non-blocking.  This state is maintained lazily (i.e., a system
372       call is made only if the state actually needs to change).
373    
374    2. OS-specific details of sockets were moved into separate files, thus
375       making it possible to unify the bulk of the socket implementations
376       between Unix and Win32.
377    
378    3. CML's socket API changed accordingly.
379       (Note that we need to remove non-blocking functions from this API
380       since they are redundant in the case of CML!)
381    
382    4. CML's socket implementation now makes use of non-blocking functions
383       provided by Basis, thus removing all OS-dependent code from this part
384       of CML.
385    
386    5. Changed Real64.precision from 52 to 53.  Minor cleanup in Real64 code.
387    
388    ----------------------------------------------------------------------
389    Name: Matthias Blume (blume (at) tti - c (dot) org)
390    Date: 2003/09/22 12:10:00 CDT
391    Tag: blume-20030922-110_43_2
392    Description:
393    
394    Made a new interim version and bootfiles for developer's bootstrapping
395    convenience.
396    
397       110.43.2 -- NEW BOOTFILES
398    
399    ----------------------------------------------------------------------
400    Name: Matthias Blume (blume (at) tti - c (dot) org)
401    Date: 2003/09/19 15:55:00 CDT
402    Tag: blume-20030919-cmdir
403    Description:
404    
405    1. new-install.sh -> install.sh
406    2. changed default CM "metadata" directory name to ".cm" (instead of "CM")
407    3. tweaked installer so that another name instead of .cm can be chosen
408       at install time (by setting the CM_DIR_ARC environment variable
409       during installation); once installation is complete, the name is
410       fixed
411    
412    ----------------------------------------------------------------------
413    Name: Matthias Blume (blume (at) tti - c (dot) org)
414    Date: 2003/09/18 16:00:00 CDT
415    Tag: blume-20030918-110_43_1
416    Description:
417    
418    Made a new interim version and bootfiles for developer's bootstrapping
419    convenience.
420    
421       110.43.1 -- NEW BOOTFILES
422    
423    ----------------------------------------------------------------------
424    Name: Matthias Blume (blume (at) tti - c (dot) org)
425    Date: 2003/09/18 15:20:00 CDT
426    Tag: blume-20030918-misc
427    Description:
428    
429    1. Exported fractionsPerSecond etc. from TimeImp (but not from Time as
430       this seems to be controversial at the moment) and used those in
431       Posix.ProcEnv.times.
432    
433    2. Added Time.{from,to}Nanoseconds to Time.
434    
435    3. Improved Real.{from,to}LargeInt by avoiding needless calculations.
436       For example, fromLargeInt never needs to look at more than 3 "big
437       digits" to get its 53 bits of precision.
438    
439    ----------------------------------------------------------------------
440    Name: Matthias Blume (blume (at) tti - c (dot) org)
441    Date: 2003/09/17 16:30:00 CDT
442    Tag: blume-20030917-real32-slices
443    Description:
444    
445    Added an entry to the primitive environment
446    (compiler/Semant/statenv/prim.sml) for int32->real64 conversion and
447    added code to compiler/CodeGen/main/mlriscGen.sml to implement it.
448    
449    Removed some of the "magic" constants in real64.sml and replaced them
450    with code that generates these values from their corresponding
451    integer counterparts.
452    
453    Made all(?) the slice-related changes to the Basis and made everything
454    compile again...
455    
456    ----------------------------------------------------------------------
457    Name: Matthias Blume (blume (at) tti - c (dot) org)
458    Date: 2003/09/15 17:45:00 CDT
459    Tag: blume-20030915-rbase
460    Description:
461    
462    Fixed bug in Real.fromLargeInt.
463    
464    ----------------------------------------------------------------------
465    Name: Matthias Blume (blume (at) tti - c (dot) org)
466    Date: 2003/09/13 18:11:00 CDT
467    Tag: blume-20030913-libinstall
468    Description:
469    
470    Minor bugfix in config/libinstall (set anchor with path to
471    standalone tool after installing it, otherwise libraries that
472    need ml-lex or ml-yacc won't compile the first time the installer
473    runs).
474    
475    ----------------------------------------------------------------------
476    Name: Matthias Blume (blume (at) tti - c (dot) org)
477    Date: 2003/09/12 11:45:00 CDT
478    Tag: blume-20030912-various
479    Description:
480    
481     - fixed bug in Real.toLargeInt
482     - fixed bug in Posix.ProcEnv.times
483     - changed inputLine functions to return an option
484     - minor installer improvements / bugfixes
485     - changed default @SMLalloc parameter for x86/celeron to 64k
486    
487    ----------------------------------------------------------------------
488    Name: Matthias Blume (blume (at) tti - c (dot) org)
489    Date: 2003/09/09 22:00:00 CDT
490    Tag: Release_110_43
491    Description:
492    
493        New working release 110.43.  New bootfiles.
494    
495    ----------------------------------------------------------------------
496    Name: Matthias Blume (blume (at) tti - c (dot) org)
497    Date: 2003/09/09 19:20:00 CDT
498    Tag: blume-20030909-installer
499    Description:
500    
501    Rewrote large parts of config/install.sh in SML (config/libinstall.sml).
502    Modified config/install.bat to take advantage of it.  Also modified
503    config/install.sh (and called it config/new-install.sh) to take advantage
504    of it on Unix systems.  (The SML code is (supposed to be) platform-
505    independent.)
506    
507    The installer can now install everything under Win32
508    as well as under *nix as long as it compiles.
509    
510    Other changes:
511    
512      - made CML compile again under Win32
513      - made eXene compile under Win32 (by providing a fake structure UnixSock
514        and by using OS.Process.getEnv instead of Posix.ProcEnv.getenv)
515      - fixed a bug in nowhere: it assumed that type OS.Process.status is the
516        same as type int;  under Win32 it isn't
517      - fixed some slice-related problems in the win32-specific parts of CML
518      - added a functor argument "sameVol" to os-path-fn.sml in the Basis
519        (under Win32, the volume name is case-insensitive, and the
520        OS.Path code compares volume names for equality)
521    
522    ----------------------------------------------------------------------
523    Name: Matthias Blume (blume (at) tti - c (dot) org)
524    Date: 2003/09/08 11:55:00 CDT
525    Tag: blume-20030908-fullpath
526    Description:
527    
528    Made Win32 version of OS.FileSys.fullPath return current directory
529    when given an empty string.  This is what the spec says, and incidentally,
530    CM depends on it.  (CM otherwise goes into an infinite loop in certain
531    cases when presented with the name of a non-existing .cm file.)
532    
533    ----------------------------------------------------------------------
534    Name: Matthias Blume (blume (at) tti - c (dot) org)
535    Date: 2003/09/04 16:30:00 CDT
536    Tag: blume-20030905-slices-etc
537    Description:
538    
539      1. Changed interface to vectors and arrays in Basis to match
540         (draft) Basis spec.
541      2. Added signatures and implementations of slices according to
542         Basis spec.
543      3. Edited source code throughout the system to make it compile again
544         under 1. and 2.  (In some cases code had to be added to have it
545         match the new signatures.)
546      4. MLRISC should be backward-compatible: the copies of the originals
547         of files that needed to change under 3. were retained, the .cm files
548         check the compiler version number and use old versions when
549         appropriate.
550      5. Changed type of OS.FileSys.readDir and Posix.FileSys.readdir to
551         dirstream -> string option (in accordance with Basis spec).
552      6. When generating code that counts lines, ml-lex used function
553         CharVector.foldli, taking advantage of its old interface.
554         This has been replaced with the corresponding code from
555         CharVectorSlice.  (html-lex must be re-lexed!)
556      7. BitArray in smlnj-lib/Util has been extended/modified to match the
557         new MONO_ARRAY signature.  (Do we need BitArraySlice?)
558      8. Removed temporary additions (fromInternal, toInternal) from the
559         (now obsolete) IntInf in smlnj-lib/Util.
560      9. Cleaned up structure Byte.
561     10. Added localOffset, scan, and fromString to Date (according to spec).
562         Cleaned/corrected implementation of Date.
563         (Still need to check for correctness; implement better canonicalizeDate.)
564     11. Added "scan" to signature IEEE_REAL.
565     12. Some improvements to IntInf [in particular: efficiency-hack for
566         mod and rem when second operand is 2 (for parity checks).]
567     13. Changed representation of type Time.time, using a single IntInf.int
568         value counting microseconds.  This considerably simplified the
569         implementation of structure Time.  We now support negative time
570         values; scan and fromString handle signs.
571     14. Functor PrimIO now takes two additional arguments (VectorSlice and
572         ArraySlice).
573    
574    ----------------------------------------------------------------------
575    Name: Matthias Blume (blume (at) tti - c (dot) org)
576    Date: 2003/08/28 17:00:00 CDT
577    Tag: blume-20030828-intinf
578    Description:
579    
580    This is a major update which comes with a version number bump
581    (110.42.99 -- yes, we are really close to 110.43 :-), NEW BOOTFILES,
582    and an implementation of IntInf in the Basis.
583    
584    There are a fairly large number of related changes and updates throughout
585    the system:
586    
587    Basis:
588            - Implemented IntInf.
589            - Made LargeInt a projection of IntInf (by filtering through INTEGER).
590            - Added some missing Real64 operations, most notably Real.toLargeInt.
591            - Added FixedInt as a synonym for Int32.
592    
593    compiler:
594            * Added support for a built-in intinf type.
595              - literals
596              - pattern matching
597              - conversion shortcuts (Int32.fromLarge o Int.toLarge etc.)
598              - overloading on literals and operations
599    
600            This required adding a primitive type intinf, some additional
601            primops, and implementations for several non-trivial intinf
602            operations in Core.  (The intinf type is completely abstract
603            to the compiler; all operations get delegated back to the Core.)
604    
605            * Intinf equality is handled by polyequal.  However, the compiler
606            does not print its usual warning in this case (since polyequal
607            is the right thing to do there).
608    
609            * Improved the organization of structure InlineT.
610    
611            * A word about conversion primops:
612            If conversions involving intinf do not cancel out during
613            CPS contract, then the compiler must insert calls to Core functions.
614            Since all core access must be resolved already during the FLINT
615            translate phase, it would be too late a the time of CPS contract
616            to add new Core calls.  For this reason, conversion primops
617            for intinf carry two arguments:  1. the numeric argument that
618            they are supposed to convert, and 2. the Core function that
619            can help with this conversion if necessary.  If CPS contract
620            eliminates a primop, then the associated Core function becomes
621            dead and goes away.  Intinf conversion primops that do not get
622            eliminated by CPS contract get rewritten into calls of their
623            core functions by a separate, new phase.
624    
625    interactive system:
626            - Control.Print.intinfDepth controls max length of intinf constants
627            being printed. (Analogous to Control.Print.stringDepth.)
628            - Cleanup in printutil and pputil: got rid of unused stuff and
629            duplicates; replaced some of the code with code that makes better
630            use of library functionality.
631    
632    CM:
633            Bugfix: parse-errors in init group (system/smlnj/init/init.cmi)
634            are no longer silent.
635    
636    CKIT:
637            Fixed mismatched uses of Int32 and LargeInt.  I always decided
638            in favor of LargeInt -- which is now the same as IntInf.
639            CKIT-knowledgable people should check whether this is what's
640            intended and otherwise change things back to using Int32 or
641            FixedInt.
642    
643    Throughout the code:
644            Started using IntInf.int literals and built-in operations
645            (e.g., comparison with 0) where this seems appropriate.
646    
647    
648    ----------------------------------------------------------------------
649    Name: Dave MacQueen (dbm@cs.uchicago.edu)
650    Date: 2003/08/13 11:36:00 CDT
651    Tag: dbm-20030813-mcz-merge1
652    Description:
653    
654    Merging changes from the mcz-branch development branch into trunk.
655    These changes involve replacement of the emulated old prettyprinter
656    interface with direct use of the SML/NJ Lib PP library, and fixing
657    of a couple of bugs (895, 1186) relating to error messages.  A new
658    prettyprinter for ast datatypes (Elaborator/print/ppast.{sig,sml})
659    has been added.
660    
661    ----------------------------------------------------------------------
662    Name: Matthias Blume (blume (at) tti - c (dot) org)
663    Date: 2003/08/11 15:45:00 CDT
664    Tag: blume-20030811-windows
665    Description:
666    
667    Version number bumped to 110.42.9.  NEW BOOTFILES!!!
668    
669        http://smlnj.cs.uchicago.edu/dist/working/110.42.9/
670    
671    This patch restores SML/NJ's ability to run under win32.  There are a
672    number of changes, including fixes for several bugs that had gone
673    unnoticed until now:
674    
675      - uname "CYGWIN_NT*" is recognized as win32 (This is relevant only when
676        trying to run the win32 version from within cygwin.)
677    
678      - There are a number of simple .bat scripts that substitute for their
679        corresponding Unix shell-scripts.  (See below.)
680    
681      - The internals of ml-build have been modified slightly.  The main
682        difference is that instead of calling ".link-sml" (or link-sml.bat)
683        using OS.Process.system, the ML process delegates this task back
684        to the script.  Otherwise problems arise in mixed environments such
685        as Cygwin where scripts look and work like Unix scripts, but
686        where OS.Process.system cannot run them.
687    
688      - In CM, the srcpath pickler used native pathname syntax -- which
689        is incorrect in the case of cross-compilation.  The new pickle format
690        is independent of platform-specific naming conventions.
691    
692      - Path configuration files (such as lib/pathconfig) can now choose
693        between native and standard syntax.  Placing a line of the form
694    
695            standard!
696    
697        into the file causes all subsequent paths to be interpreted using
698        CM standard pathname syntax (= Unix conventions); a line
699    
700            native!
701    
702        switches back to native style.  This was needed so that
703        path config files can be written portably, see src/system/pathconfig.
704    
705      - Runtime system:
706    
707          - win32-filesys.c:  get_file_time and set_file_time now
708            access modification time, not creation time.
709    
710          - I/O code made aware of new array representation.
711    
712          - Bug fixes in X86.prim.masm.
713    
714       - src/system/makeml made aware of win32. (For use under cygwin
715            and other Unix-environments for windows.)
716    
717       - In Basis, fixed off-by-one error in win32-io.sml (function vecF)
718         which caused BinIO.inputAll to fail consistently.
719    
720    .bat scripts:
721    
722       Windows .bat scripts assume that SMLNJ_HOME is defined.
723    
724       - sml.bat, ml-yacc.bat, ml-lex.bat:  Driver scripts for standalone
725         applications (sml, ml-yacc, ml-lex).
726       - ml-build.bat: analogous to ml-build.
727       - config\install.bat:  Analogous to config/install.sh.  This requires
728         that SMLNJ_HOME is set and that Microsoft Visual C is ready to use.
729         (nmake etc. must be on the path, and vcvars32 must have been run.)
730         Moreover, sources for ml-lex and ml-yacc need to exist under src,
731         and the bootfile hierarchy must have been unpacked under
732         sml.boot.x86-win32.
733         The script is very primitive and does a poor job at error checking.
734         It only installs the base system, ml-lex, and ml-yacc.  No other
735         libraries are being installed (i.e., you get only those that
736         are part of the compiler.)
737       - link-sml.bat:  analogous to .link-sml, but not currently used
738    
739    Unrelated bug fixes:
740    
741      - ml-nlffigen now exports structures ST_* corresponding to incomplete
742        types.
743      - Added getDevice to PP/src/pp-debug-fn.sml.  (Would not compile
744        otherwise.)
745    
746    ----------------------------------------------------------------------
747    Name: Dave MacQueen (macqueen@cs.uchicago.edu)
748    Date: 2003/06/17
749    Tag: macqueen-20030617-bug895
750    Description:
751    
752    Modified compiler/Elaborator/print/pptype.sml to fix bug 895.
753    Tag will be used for new development branch (mcz-branch) for
754    use by MacQueen, (Lucasz) Zairek, and (George) Cao at uchicago.
755    
756    ----------------------------------------------------------------------
757    Name: Matthias Blume (blume (at) tti - c (dot) org)
758    Date: 2003/05/27 16:55:00 CDT
759    Tag: blume-20030527-polyeq
760    Description:
761    
762    Tried to eliminated most cases of polymorphic equality.
763    
764    ----------------------------------------------------------------------
765    Name: Matthias Blume (blume (at) tti - c (dot) org)
766    Date: 2003/05/21 17:45:00 CDT
767    Tag: blume-20030517-complete
768    Description:
769    
770    Two changes:
771    
772      1. Added a flag for controlling whether non-exhaustive bindings will
773         be treated as errors (default is false).
774      2. Cleaned up the *entire* source tree so that CMB.make goes through
775         without a single non-exhaustive match- or bind warning.
776    
777    ----------------------------------------------------------------------
778    Name: Matthias Blume (blume (at) tti - c (dot) org)
779    Date: 2003/05/17 10:20:00 CDT
780    Tag: blume-20030517-absyn
781    Description:
782    
783    1. Added cases for IF, WHILE, ANDALSO, and ORELSE to Absyn.
784    
785       This mainly affects the quality of error messages.  However, some
786       of the code is now more straightforward than before. (Treatment of
787       the above four constructs in translate.sml is much simpler than
788       the "macro-expansion" that was going on before.  Plus, the mach-
789       compiler no longer gets invoked just to be able to compile an
790       if-expression.)
791    
792    2. The ErrorMsg.Error exception is now caught and absorbed by the
793       interactive loop.
794    
795    ----------------------------------------------------------------------
796    Name: Allen Leung
797    Date: 2003/05/16 13:05:00 CDT
798    Tag: leunga-20030516-cygwin-runtime
799    Description:
800    
801        Ported the runtime system to cygwin, which uses the unix
802    x86-unix bin files.  Missing/buggy features:
803    
804       o getnetbyname, getnetbyaddr: these functions seem to be missing in
805         the Cygwin library.
806       o Ctrl-C handling may be flaky.
807       o Windows system calls and Windows I/O are not supported.
808    
809       A new set of binfiles is located at:
810    
811         http://www.dorsai.org/~leunga/boot.x86-unix.tgz
812    
813       This is only needed for bootstrapping the cygwin version of smlnj.
814       Other x86 versions can use the existing binfiles.
815    
816    ----------------------------------------------------------------------
817    Name: Matthias Blume
818    Date: 2003/04/08 15:42:00 CDT
819    Tag: blume-20030408-listpair
820    Description:
821    
822    1. Added a target 'mlrisc' to installer.
823    
824    2. Added missing elements to structure ListPair.
825    
826    ----------------------------------------------------------------------
827    Name: Allen Leung
828    Date: 2003/01/07 10:40:00 EST
829    Tag: leunga-20030107-int-rem
830    Description:
831    
832    Fixed a bug in Int.rem(x,y) where y is a power of 2 on x86.
833    The arguments to the SUBL instruction were swapped.
834    
835    ----------------------------------------------------------------------
836    Name: Matthias Blume
837    Date: 2002/12/12 16:25:00 EST
838    Tag: blume-20021212-risc-ra
839    Description:
840    
841    Fixed a serious bug in the rewrite code for FP spilling/reloading that
842    sent the RA into an infinite loop when floating point registers get
843    spilled.  (Because of this bug, e.g., nucleic stopped compiling between
844    110.37 and 110.38.)
845    There was another set of potential problems related to the handling of
846    MLRISC annotations (but those did not yet cause real problems, apparently).
847    
848    ----------------------------------------------------------------------
849    Name: Matthias Blume
850    Date: 2002/12/06 22:40:00 EST
851    Tag: blume-20021206-cm-fileid
852    Description:
853    
854    Added a call of SrcPath.sync at the beginning of Parse.parse (in CM).
855    This fixes the problem of CM getting confused by files that suddenly
856    change their identity (e.g., by getting unlinked and recreated by some
857    text editor such as vi).  There might be a better/cheaper/cleaner way
858    of doing this, but for now this will have to do.
859    
860    ----------------------------------------------------------------------
861    Name: Matthias Blume
862    Date: 2002/10/28 09:50:00 EST
863    Tag: blume-20021028-typecheck
864    Description:
865    
866    Exported structure Typecheck from $smlnj/viscomp/core.cm.
867    
868    ----------------------------------------------------------------------
869    Name: Matthias Blume
870    Date: 2002/10/17 09:10:00 EDT
871    Tag: Release_110_42
872    Description:
873    
874    In good old tradition, there has been a slight hiccup so that we have
875    to patch 110.42 after the fact.   The old release tag has been replaced
876    (see below).
877    
878    The change solves a problem with two competing approaches the
879    configuration problem regarding MacOS 10.1 vs. MacOS 10.2 which got in
880    each other's way.
881    
882    This change only affects the runtime system code and the installer script.
883    (No new bootfiles.)
884    
885    ----------------------------------------------------------------------
886    Name: Matthias Blume
887    Date: 2002/10/16 12:00:00 EDT
888    Tag: Release_110_42_removed
889    Description:
890    
891    New working release.  New bootfiles.
892    
893    ----------------------------------------------------------------------
894    Name: Matthias Blume
895    Date: 2002/10/10 13:10:00 EDT
896    Tag: blume-20021010-ppc-divs
897    Description:
898    
899    The mltree operator DIVS must be implemented with an overflow check on
900    the PPC because the hardware indicates divide-by-zero using "overflow" as
901    well.
902    
903    ----------------------------------------------------------------------
904    Name: Matthias Blume
905    Date: 2002/07/23 11:45:00
906    Tag: blume-20020723-smlnj-home
907    Description:
908    
909    Sml now senses the SMLNJ_HOME environment variable.  If this is set,
910    then the bin dir is assumed to be in $SMLNJ_HOME/bin and (unless
911    CM_PATHCONFIG is also set), the path configuration file is assumed
912    to be in $SMLNJ_HOME/lib/pathconfig.  This way one can easily move
913    the entire tree to some other place and everything will "just work".
914    
915    (Companion commands such as ml-build and ml-makedepend also sense this
916    variable.)
917    
918    ----------------------------------------------------------------------
919    Name: Matthias Blume
920    Date: 2002/07/12 21:19:00 EDT
921    Tag: blume-20020712-liveness
922    Description:
923    
924    Exported two useful "step" functions from liveness module (MLRISC).
925    
926    ----------------------------------------------------------------------
927    Name: Matthias Blume
928    Date: 2002/07/05 16:00 EDT
929    Tag: Release_110_41
930    Description:
931    
932    New working release.  New bootfiles.
933    
934    ----------------------------------------------------------------------
935    Name: Matthias Blume
936    Date: 2002/07/05 10:25:00 EDT
937    Tag: blume-20020705-btimp
938    Description:
939    
940    Exported structure BTImp from $smlnj/viscomp/debugprof.cm so that
941    other clients can set up backtracing support.
942    
943    ----------------------------------------------------------------------
944    Name: Matthias Blume
945    Date: 2002/06/25 17:23:00 EDT
946    Tag: blume-20020625-fpmax
947    Description:
948    
949    Fixed a bug in translation of INLMAX (and INLMIN) for the floating-point
950    case.  (The sense of the isNaN test was reversed -- which made min and
951    max always return their first argument.)
952    
953    ----------------------------------------------------------------------
954    Name: Matthias Blume
955    Date: 2002/06/11
956    Tag: blume-20020611-unixpath
957    Description:
958    
959    Back-ported OS.Path.{from,to}UnixPath from idlbasis-devel branch.
960    
961    ----------------------------------------------------------------------
962    Name: Matthias Blume
963    Date: 2002/06/10 16:35:00 EDT
964    Tag: blume-20020610-ieeereal
965    Description:
966    
967    I back-ported my implementation of IEEEReal.fromString from the
968    idlbasis-devel branch so that we can test it.
969    
970    Another small change is that ppDec tries to give more information
971    than just "<sig>" in the case of functors.  However, this code is
972    broken in some mysterious way if the functor's body's signature
973    has not been declared by ascription but gets inferred from the
974    implementation.  This needs fixing...
975    
976    ----------------------------------------------------------------------
977    Name: Matthias Blume
978    Date: 2002/05/31
979    Tag: blume-20020531-btrace-mode
980    Description:
981    
982    Resurrected SMLofNJ.Internals.BTrace.mode.  (It accidentally fell by
983    the wayside when I switched over to using Controls everywhere.)
984    
985    ----------------------------------------------------------------------
986    Name: Lal George
987    Date: 2002/05/23 12:21:40 EDT
988    Tag: george-20020523-visual-labels
989    Description:
990    
991    Labels are now displayed in the graphical output to make
992    the fall-through and target blocks obvious.
993    
994    ----------------------------------------------------------------------
995    Name: Matthias Blume
996    Date: 2002/05/22 11:03:00 EDT
997    Tag: blume-20020522-shrink
998    Description:
999    
1000    John tweaked yesterday's fix for 1131 to handle an out-of-memory
1001    situation that comes up when allocating huge arrays.
1002    
1003    ----------------------------------------------------------------------
1004    Name: Matthias Blume
1005    Date: 2002/05/21 16:00:00 EDT
1006    Tag: Release_110_40
1007    Description:
1008    
1009    New working release (110.40).  New bootfiles.
1010    
1011    [Also: John Reppy fixed GC bug 1131.]
1012    
1013    ----------------------------------------------------------------------
1014    Name: Matthias Blume
1015    Date: 2002/05/21 12:35:00 EDT
1016    Tag: blume-20020521-cmdoc
1017    Description:
1018    
1019    CM documentation update.
1020    
1021    ----------------------------------------------------------------------
1022    Name: Matthias Blume
1023    Date: 2002/05/21 10:55:00 EDT
1024    Tag: blume-20020521-misc
1025    Description:
1026    
1027    - John tweaked runtime to be silent on heap export (except when
1028      GC messages are on).
1029    - I added a few more things (cross-compiling versions of CMB) to
1030      config/preloads (as suggestions).
1031    
1032    ----------------------------------------------------------------------
1033    Name: Matthias Blume
1034    Date: 2002/05/20 22:25:00 EDT
1035    Tag: blume-20020520-controls
1036    Description:
1037    
1038    - Added ControlUtil structure to control-lib.cm.
1039    - Use it throughout.
1040    - Used Controls facility to define MLRISC controls (as opposed to
1041      registering MLRISC control ref cells with Controls after the fact)
1042    - Fixed messed-up controls priorities.
1043    
1044    * Removed again all the stuff from config/preloads that one wouldn't
1045      be able to preload at the time the initial heap image is built.
1046      (Many libraries, e.g., CML, do not exist yet at this time.  The
1047       only libraries that can be preloaded via config/preloads are those
1048       that come bundled with the bootfiles.)
1049    
1050    ----------------------------------------------------------------------
1051    Name: Matthias Blume
1052    Date: 2002/05/20 10:59:00 EDT
1053    Tag: blume-20020520-preloads
1054    Description:
1055    
1056    Added a lot of commented-out suggestions for things to be included
1057    in config/preloads.
1058    
1059    ----------------------------------------------------------------------
1060    Name: Allen Leung
1061    Date: 2002/05/18 14:20:00 EDT
1062    Tag: leunga-20020518-mdl
1063    Description:
1064    
1065    o Made the mdl tool stuff compile and run again.
1066    o I've disabled all the stuff that depends on RTL specifications; they
1067      are all badly broken anyway.
1068    
1069    ----------------------------------------------------------------------
1070    Name: Matthias Blume
1071    Date: 2002/05/17 16:49:00 EDT
1072    Tag: blume-20020517-controls
1073    Description:
1074    
1075    0. John Reppy made several modifications to the SML/NJ library.
1076       In particular, there is a shiny new controls-lib.cm.
1077    
1078    1. Pushed new controls interface through compiler so that everything
1079       compiles again.
1080    
1081    2. Added FormatComb and FORMAT_COMB to the CML version of the
1082       SML/NJ library (so that CML compiles again).
1083    
1084    3. Modified init scripts because XXX_DEFAULT environment variables
1085       are no longer with us.  (Boot-time initialization is now done
1086       using the same environment variables that are also used for
1087       startup-time initialization of controls.)
1088    
1089    ----------------------------------------------------------------------
1090    Name: Lal George
1091    Date: 2002/05/15 09:20:10 EDT
1092    Tag: george-20020515-pseudo-op-decls
1093    Description:
1094    
1095            All pseudo-ops emitted before the first segment declaration
1096    such as TEXT, DATA, and BSS directives are assumed to be global
1097    declarations and are emitted first in the assembly file. This is
1098    useful in a number of situations where one has pseudo-ops that are not
1099    specific to any segment, and also works around the constraint that one
1100    cannot have client pseudo-ops in the TEXT segment.
1101    
1102            Because no segment is associated with these declarations it is
1103    an error to allocate any space or objects before the first segment
1104    directive and an exception will be raised. However, we cannot make
1105    this check for client pseudo-ops.
1106    
1107            These top level declarations are a field in the CFG graph_info.
1108    In theory you can continue to add to this field after the CFG has been
1109    built -- provided you know what you are doing;-)
1110    
1111    ----------------------------------------------------------------------
1112    Name: Matthias Blume
1113    Date: 2002/05/13 16:40:00 EDT
1114    Tag: blume-20020513-pp-etc
1115    Description:
1116    
1117    A few minor bugfixes:
1118    
1119      - Stopgap measure for bug recently reported by Elsa Gunter (ppDec).
1120        (Bogus printouts for redefined bindings still occur.  Compiler
1121        bug should no longer occur now.  We need to redo the prettyprinter
1122        from scratch.)
1123    
1124      - CM pathname printer now also adds escape sequences for ( and )
1125    
1126      - commend and docu fixes for ml-nlffi
1127    
1128    ----------------------------------------------------------------------
1129    Name: Matthias Blume
1130    Date: 2002/05/10 16:40:00 EDT
1131    Tag: blume-20020510-erg-textio
1132    Description:
1133    
1134    Applied the following bugfix provided by Emden Gansner:
1135    
1136        Output is corrupted when outputSubstr is used rather than output.
1137    
1138        The problem occurs when a substring
1139    
1140            ss = (s, dataStart, dataLen)
1141    
1142        where dataStart > 0, fills a stream buffer with avail bytes left.
1143        avail bytes of s, starting at index dataStart, are copied into the
1144        buffer, the buffer is flushed, and then the remaining dataLen-avail
1145        bytes of ss are copied into the beginning of the buffer. Instead of
1146        starting this copy at index dataStart+avail in s, the current code
1147        starts the copy at index avail.
1148    
1149        Fix:
1150        In text-io-fn.sml, change line 695 from
1151             val needsFlush = copyVec(v, avail, dataLen-avail, buf, 0)
1152        to
1153             val needsFlush = copyVec(v, dataStart+avail, dataLen-avail, buf, 0)
1154    
1155    ----------------------------------------------------------------------
1156    Name: Matthias Blume
1157    Date: 2002/04/12 13:55:00 EDT
1158    Tag: blume-20020412-assyntax
1159    Description:
1160    
1161    1. Grabbed newer assyntax.h from the XFree86 project.
1162    2. Fiddled with how to compile X86.prim.asm without warnings.
1163    3. (Very) Minor cleanup in CM.
1164    
1165    ----------------------------------------------------------------------
1166    Name: Matthias Blume
1167    Date: 2002/04/01 (no joke!) 17:07:00 EST
1168    Tag: blume-20020401-x86div
1169    Description:
1170    
1171    Added full support for div/mod/rem/quot on the x86, using the machine
1172    instruction's two results (without clumsily recomputing the remainder)
1173    directly where appropriate.
1174    
1175    Some more extensive power-of-two support was added to the x86 instruction
1176    selector (avoiding expensive divs, mods, and muls where they can be
1177    replaced with cheaper shifts and masks).  However, this sort of thing
1178    ought to be done earlier, e.g., within the CPS optimizer so that
1179    all architectures benefit from it.
1180    
1181    The compiler compiles to a fixed point, but changes might be somewhat
1182    fragile nevertheless.  Please, report any strange things that you might
1183    see wrt. div/mod/quot/rem...
1184    
1185    ----------------------------------------------------------------------
1186    Name: Matthias Blume
1187    Date: 2002/03/29 17:22:00
1188    Tag: blume-20020329-div
1189    Description:
1190    
1191    Fixed my broken div/mod logic.  Unfortunately, this means that the
1192    inline code for div/mod now has one more comparison than before.
1193    Fast paths (quotient > 0 or remainder = 0) are not affected, though.
1194    The problem was with quotient = 0, because that alone does not tell
1195    us which way the rounding went.  One then has to look at whether
1196    remainder and divisor have the same sign...  :(
1197    
1198    Anyway, I replaced the bootfiles with fresh ones...
1199    
1200    ----------------------------------------------------------------------
1201    Name: Matthias Blume
1202    Date: 2002/03/29 14:10:00 EST
1203    Tag: blume-20020329-inlprims
1204    Description:
1205    
1206    NEW BOOTFILES!!!    Version number bumped to 110.39.3.
1207    
1208    Primops have changed. This means that the bin/boot-file formats have
1209    changed as well.
1210    
1211    To make sure that there is no confusion, I made a new version.
1212    
1213    
1214    CHANGES:
1215    
1216    * removed REMT from mltree (remainder should never overflow).
1217    
1218    * added primops to deal with divisions of all flavors to the frontend
1219    
1220    * handled these primops all the way through so they map to their respective
1221      MLRISC support
1222    
1223    * used these primops in the implementation of Int, Int32, Word, Word32
1224    
1225    * removed INLDIV, INLMOD, and INLREM as they are no longer necessary
1226    
1227    * parameterized INLMIN, INLMAX, and INLABS by a numkind
1228    
1229    * translate.sml now deals with all flavors of INL{MIN,MAX,ABS}, including
1230      floating point
1231    
1232    * used INL{MIN,MAX,ABS} in the implementation of Int, Int32, Word, Word32,
1233      and Real (but Real.abs maps to a separate floating-point-only primop)
1234    
1235    
1236    TODO items:
1237    
1238    * Hacked Alpha32 instruction selection, disabling the selection of REMx
1239      instructions because the machine instruction encoder cannot handle
1240      them.  (Hppa, PPC, and Sparc instruction selection did not handle
1241      REM in the first place, and REM is supported by the x86 machine coder.)
1242    
1243    * Handle DIV and MOD with DIV_TO_NEGINF directly in the x86 instruction
1244      selection phase.  (The two can be streamlined because the hardware
1245      delivers both quotient and remainder at the same time anyway.)
1246    
1247    * Think about what to do with "valOf(Int32.minInt) div ~1" and friends.
1248      (Currently the behavior is inconsistent both across architectures and
1249      wrt. the draft Basis spec.)
1250    
1251    * Word8 should eventually be handled natively, too.
1252    
1253    * There seems to be one serious bug in mltree-gen.sml.  It appears, though,
1254      as if there currently is no execution path that could trigger it in
1255      SML/NJ.  (The assumptions underlying functions arith and promotable do not
1256      hold for things like multiplication and division.)
1257    
1258    ----------------------------------------------------------------------
1259    Name: Matthias Blume
1260    Date: 2002/03/27 16:27:00 EST
1261    Tag: blume-20020327-mlrisc-divisions
1262    Description:
1263    
1264    Added support for all four division operations (ML's div, mod, quot,
1265    and rem) to MLRISC.  In the course of doing so, I also rationalized
1266    the naming (no more annoying switch-around of DIV and QUOT), by
1267    parameterizing the operation by div_rounding_mode (which can be either
1268    DIV_TO_ZERO or DIV_TO_NEGINF).
1269    
1270    The generic MLTreeGen functor takes care of compiling all four
1271    operations down to only round-to-zero div.
1272    
1273    Missing pieces:
1274    
1275      * Doing something smarter than relying on MLTreeGen on architectures
1276        like, e.g., the x86 where hardware division delivers both quotient and
1277        remainder at the same time.  With this, the implementation of the
1278        round-to-neginf operations could be further streamlined.
1279    
1280      * Remove inlining support for div/mod/rem from the frontend and replace it
1281        with primops that get carried through to the backend.  Do this for all
1282        int and word types.
1283    
1284    ----------------------------------------------------------------------
1285    Name: Matthias Blume
1286    Date: 2002/03/25 17:25:00 EST
1287    Tag: blume-20020325-divmod
1288    Description:
1289    
1290    I improved (hopefully without breaking them) the implementation of Int.div,
1291    Int.mod, and Int.rem.   For this, the code in translate.sml now takes
1292    advantage of the following observations:
1293    
1294      Let  q = x quot y      r = x rem y
1295           d = x div  y      m = x mod y
1296    
1297    where "quot" is the round-to-zero version of integer division that
1298    hardware usually provides.  Then we have:
1299    
1300         r = x - q * y        where neither the * nor the - will overflow
1301         d = if q >= 0 orelse x = q * y then q else q - 1
1302                              where neither the * nor the - will overflow
1303         m = if q >= 0 orelse r = 0 then r else r + y
1304                              where the + will not overflow
1305    
1306    This results in substantial simplification of the generated code.
1307    The following table shows the number of CFG nodes and edges generated
1308    for
1309            fun f (x, y) = x OPER y
1310            (* with OPER \in div, mod, quot, rem *)
1311    
1312    
1313        OPER | nodes(old) | edges(old) | nodes(new) | edges(new)
1314        --------------------------------------------------------
1315         div |         24 |         39 |         12 |         16
1316         mod |         41 |         71 |         12 |         16
1317        quot |          8 |         10 |          8 |         10
1318         rem |         10 |         14 |          8 |         10
1319    
1320    
1321    ----------------------------------------------------------------------
1322    Name: Matthias Blume
1323    Date: 2002/03/25 22:06:00 EST
1324    Tag: blume-20020325-cprotobug
1325    Description:
1326    
1327    Fixed a bug in cproto (c prototype decoder).
1328    
1329    ----------------------------------------------------------------------
1330    Name: Matthias Blume
1331    Date: 2002/03/25 16:00:00 EST
1332    Tag: blume-20020325-raw-primops
1333    Description:
1334    
1335    I did some cleanup to Allen's new primop code and
1336    replaced yesterday's bootfiles with new ones.
1337    (But they are stored in the same place.)
1338    
1339    ----------------------------------------------------------------------
1340    Name: Matthias Blume
1341    Date: 2002/03/24 22:40:00 EST
1342    Tag: blume-20020324-bootfiles
1343    Description:
1344    
1345    Made the bootfiles that Allen asked for.
1346    
1347    ----------------------------------------------------------------------
1348    Name: Allen Leung
1349    Date: 2002/03/23 15:50:00 EST
1350    Tag: leunga-20020323-flint-cps-rcc-primops
1351    Description:
1352    
1353      1. Changes to FLINT primops:
1354    
1355        (* make a call to a C-function;
1356         * The primop carries C function prototype information and specifies
1357         * which of its (ML-) arguments are floating point. C prototype
1358         * information is for use by the backend, ML information is for
1359         * use by the CPS converter. *)
1360      | RAW_CCALL of { c_proto: CTypes.c_proto,
1361                       ml_args: ccall_type list,
1362                       ml_res_opt: ccall_type option,
1363                       reentrant : bool
1364                     } option
1365       (* Allocate uninitialized storage on the heap.
1366        * The record is meant to hold short-lived C objects, i.e., they
1367        * are not ML pointers.  With the tag, the representation is
1368        * the same as RECORD with tag tag_raw32 (sz=4), or tag_fblock (sz=8)
1369        *)
1370      | RAW_RECORD of {tag:bool,sz:int}
1371      and ccall_type = CCALL_INT32 | CCALL_REAL64 | CCALL_ML_PTR
1372    
1373      2.  These CPS primops are now overloaded:
1374    
1375           rawload of {kind:numkind}
1376           rawstore of {kind:numkind}
1377    
1378          The one argument form is:
1379    
1380             rawload {kind} address
1381    
1382          The two argument form is:
1383    
1384             rawload {kind} [ml object, byte-offset]
1385    
1386      3. RAW_CCALL/RCC now takes two extra arguments:
1387    
1388         a. The first is whether the C call is reentrant, i.e., whether
1389            ML state should be saved and restored.
1390         b. The second argument is a string argument specifying the name of
1391            library and the C function.
1392    
1393         These things are currently not handled in the code generator, yet.
1394    
1395      4. In CProto,
1396    
1397         An encoding type of "bool" means "ml object" and is mapped into
1398         C prototype of PTR.  Note that "bool" is different than "string",
1399         even though "string" is also mapped into PTR, because "bool"
1400         is assigned an CPS type of BOGt, while "string" is assigned INT32t.
1401    
1402      5. Pickler/unpicker
1403    
1404         Changed to handle RAW_RECORD and newest RAW_CCALL
1405    
1406      6. MLRiscGen,
1407    
1408         1. Changed to handle the new rawload/rawstore/rawrecord operators.
1409         2. Code for handling C Calls has been moved to a new module CPSCCalls,
1410            in the file CodeGen/cpscompile/cps-c-calls.sml
1411    
1412      7. Added the conditional move operator
1413    
1414             condmove of branch
1415    
1416         to cps.  Generation of this is still buggy so it is currently
1417         disabled.
1418    
1419    ----------------------------------------------------------------------
1420    Name: Lal George
1421    Date: 2002/03/22 14:18:25 EST
1422    Tag: george-20020322-cps-branch-prob
1423    Description:
1424    
1425    Implemented the Ball-Larus branch prediction-heuristics, and
1426    incorporated graphical viewers for control flow graphs.
1427    
1428    Ball-Larus Heuristics:
1429    ---------------------
1430    See the file compiler/CodeGen/cpscompile/cpsBranchProb.sml.
1431    
1432    By design it uses the Dempster-Shafer theory for combining
1433    probabilities.  For example, in the function:
1434    
1435        fun f(n,acc) = if n = 0 then acc else f(n-1, n*acc)
1436    
1437    the ball-larus heuristics predicts that the n=0 is unlikely
1438    (OH-heuristic), and the 'then' branch is unlikely because of the
1439    RH-heuristic -- giving the 'then' branch an even lower combined
1440    probability using the Dempster-Shafer theory.
1441    
1442    Finally, John Reppy's loop analysis in MLRISC, further lowers the
1443    probability of the 'then' branch because of the loop in the else
1444    branch.
1445    
1446    
1447    Graphical Viewing:
1448    ------------------
1449    I merely plugged in Allen's graphical viewers into the compiler. The
1450    additional code is not much. At the top level, saying:
1451    
1452            Control.MLRISC.getFlag "cfg-graphical-view" := true;
1453    
1454    will display the graphical view of the control flow graph just before
1455    back-patching.  daVinci must be in your path for this to work. If
1456    daVinci is not available, then the default viewer can be changed
1457    using:
1458    
1459            Control.MLRISC.getString "viewer"
1460    
1461    which can be set to "dot" or "vcg" for the corresponding viewers. Of
1462    course, these viewers must be in your path.
1463    
1464    The above will display the compilation unit at the level of clusters,
1465    many of which are small, boring, and un-interesting. Also setting:
1466    
1467            Control.MLRISC.getInt "cfg-graphical-view_size"
1468    
1469    will display clusters that are larger than the value set by the above.
1470    
1471    
1472    ----------------------------------------------------------------------
1473    Name: Matthias Blume
1474    Date: 2002/03/21 22:20:00 EST
1475    Tag: blume-20020321-kmp-bugfix
1476    Description:
1477    
1478    Changed the interface to the KMP routine in PreString and fixed
1479    a minor bug in one place where it was used.
1480    
1481    ----------------------------------------------------------------------
1482  Name: Allen Leung  Name: Allen Leung
1483  Date: 2002/03/21 20:30:00 EST  Date: 2002/03/21 20:30:00 EST
1484  Tag: leunga-20020321-cfg  Tag: leunga-20020321-cfg

Legend:
Removed from v.1158  
changed lines
  Added in v.1491

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0