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 646, Tue May 16 02:52:54 2000 UTC revision 1343, Wed Aug 13 17:44:22 2003 UTC
# Line 8  Line 8 
8  The form of an entry should be:  The form of an entry should be:
9    
10  Name:  Name:
11  Date:  Date: yyyy/mm/dd
12  Tag: <post-commit CVS tag>  Tag: <post-commit CVS tag>
13  Description:  Description:
14    
15    ----------------------------------------------------------------------
16    Name: Dave MacQueen (dbm@cs.uchicago.edu)
17    Date: 2003/08/13 11:36:00 CDT
18    Tag: dbm-20030813-mcz-merge1
19    Description:
20    
21    Merging changes from the mcz-branch development branch into trunk.
22    These changes involve replacement of the emulated old prettyprinter
23    interface with direct use of the SML/NJ Lib PP library, and fixing
24    of a couple of bugs (895, 1186) relating to error messages.  A new
25    prettyprinter for ast datatypes (Elaborator/print/ppast.{sig,sml})
26    has been added.
27    
28    ----------------------------------------------------------------------
29    Name: Matthias Blume (blume@tti-c.org)
30    Date: 2003/08/11 15:45:00 CDT
31    Tag: blume-20030811-windows
32    Description:
33    
34    Version number bumped to 110.42.9.  NEW BOOTFILES!!!
35    
36        http://smlnj.cs.uchicago.edu/dist/working/110.42.9/
37    
38    This patch restores SML/NJ's ability to run under win32.  There are a
39    number of changes, including fixes for several bugs that had gone
40    unnoticed until now:
41    
42      - uname "CYGWIN_NT*" is recognized as win32 (This is relevant only when
43        trying to run the win32 version from within cygwin.)
44    
45      - There are a number of simple .bat scripts that substitute for their
46        corresponding Unix shell-scripts.  (See below.)
47    
48      - The internals of ml-build have been modified slightly.  The main
49        difference is that instead of calling ".link-sml" (or link-sml.bat)
50        using OS.Process.system, the ML process delegates this task back
51        to the script.  Otherwise problems arise in mixed environments such
52        as Cygwin where scripts look and work like Unix scripts, but
53        where OS.Process.system cannot run them.
54    
55      - In CM, the srcpath pickler used native pathname syntax -- which
56        is incorrect in the case of cross-compilation.  The new pickle format
57        is independent of platform-specific naming conventions.
58    
59      - Path configuration files (such as lib/pathconfig) can now choose
60        between native and standard syntax.  Placing a line of the form
61    
62            standard!
63    
64        into the file causes all subsequent paths to be interpreted using
65        CM standard pathname syntax (= Unix conventions); a line
66    
67            native!
68    
69        switches back to native style.  This was needed so that
70        path config files can be written portably, see src/system/pathconfig.
71    
72      - Runtime system:
73    
74          - win32-filesys.c:  get_file_time and set_file_time now
75            access modification time, not creation time.
76    
77          - I/O code made aware of new array representation.
78    
79          - Bug fixes in X86.prim.masm.
80    
81       - src/system/makeml made aware of win32. (For use under cygwin
82            and other Unix-environments for windows.)
83    
84       - In Basis, fixed off-by-one error in win32-io.sml (function vecF)
85         which caused BinIO.inputAll to fail consistently.
86    
87    .bat scripts:
88    
89       Windows .bat scripts assume that SMLNJ_HOME is defined.
90    
91       - sml.bat, ml-yacc.bat, ml-lex.bat:  Driver scripts for standalone
92         applications (sml, ml-yacc, ml-lex).
93       - ml-build.bat: analogous to ml-build.
94       - config\install.bat:  Analogous to config/install.sh.  This requires
95         that SMLNJ_HOME is set and that Microsoft Visual C is ready to use.
96         (nmake etc. must be on the path, and vcvars32 must have been run.)
97         Moreover, sources for ml-lex and ml-yacc need to exist under src,
98         and the bootfile hierarchy must have been unpacked under
99         sml.boot.x86-win32.
100         The script is very primitive and does a poor job at error checking.
101         It only installs the base system, ml-lex, and ml-yacc.  No other
102         libraries are being installed (i.e., you get only those that
103         are part of the compiler.)
104       - link-sml.bat:  analogous to .link-sml, but not currently used
105    
106    Unrelated bug fixes:
107    
108      - ml-nlffigen now exports structures ST_* corresponding to incomplete
109        types.
110      - Added getDevice to PP/src/pp-debug-fn.sml.  (Would not compile
111        otherwise.)
112    
113    ----------------------------------------------------------------------
114    Name: Dave MacQueen (macqueen@cs.uchicago.edu)
115    Date: 2003/06/17
116    Tag: macqueen-20030617-bug895
117    Description:
118    
119    Modified compiler/Elaborator/print/pptype.sml to fix bug 895.
120    Tag will be used for new development branch (mcz-branch) for
121    use by MacQueen, (Lucasz) Zairek, and (George) Cao at uchicago.
122    
123    ----------------------------------------------------------------------
124    Name: Matthias Blume (blume@tti-c.org)
125    Date: 2003/05/27 16:55:00 CDT
126    Tag: blume-20030527-polyeq
127    Description:
128    
129    Tried to eliminated most cases of polymorphic equality.
130    
131    ----------------------------------------------------------------------
132    Name: Matthias Blume (blume@tti-c.org)
133    Date: 2003/05/21 17:45:00 CDT
134    Tag: blume-20030517-complete
135    Description:
136    
137    Two changes:
138    
139      1. Added a flag for controlling whether non-exhaustive bindings will
140         be treated as errors (default is false).
141      2. Cleaned up the *entire* source tree so that CMB.make goes through
142         without a single non-exhaustive match- or bind warning.
143    
144    ----------------------------------------------------------------------
145    Name: Matthias Blume (blume@tti-c.org)
146    Date: 2003/05/17 10:20:00 CDT
147    Tag: blume-20030517-absyn
148    Description:
149    
150    1. Added cases for IF, WHILE, ANDALSO, and ORELSE to Absyn.
151    
152       This mainly affects the quality of error messages.  However, some
153       of the code is now more straightforward than before. (Treatment of
154       the above four constructs in translate.sml is much simpler than
155       the "macro-expansion" that was going on before.  Plus, the mach-
156       compiler no longer gets invoked just to be able to compile an
157       if-expression.)
158    
159    2. The ErrorMsg.Error exception is now caught and absorbed by the
160       interactive loop.
161    
162    ----------------------------------------------------------------------
163    Name: Allen Leung
164    Date: 2003/05/16 13:05:00 CDT
165    Tag: leunga-20030516-cygwin-runtime
166    Description:
167    
168        Ported the runtime system to cygwin, which uses the unix
169    x86-unix bin files.  Missing/buggy features:
170    
171       o getnetbyname, getnetbyaddr: these functions seem to be missing in
172         the Cygwin library.
173       o Ctrl-C handling may be flaky.
174       o Windows system calls and Windows I/O are not supported.
175    
176       A new set of binfiles is located at:
177    
178         http://www.dorsai.org/~leunga/boot.x86-unix.tgz
179    
180       This is only needed for bootstrapping the cygwin version of smlnj.
181       Other x86 versions can use the existing binfiles.
182    
183    ----------------------------------------------------------------------
184    Name: Matthias Blume
185    Date: 2003/04/08 15:42:00 CDT
186    Tag: blume-20030408-listpair
187    Description:
188    
189    1. Added a target 'mlrisc' to installer.
190    
191    2. Added missing elements to structure ListPair.
192    
193    ----------------------------------------------------------------------
194    Name: Allen Leung
195    Date: 2003/01/07 10:40:00 EST
196    Tag: leunga-20030107-int-rem
197    Description:
198    
199    Fixed a bug in Int.rem(x,y) where y is a power of 2 on x86.
200    The arguments to the SUBL instruction were swapped.
201    
202    ----------------------------------------------------------------------
203    Name: Matthias Blume
204    Date: 2002/12/12 16:25:00 EST
205    Tag: blume-20021212-risc-ra
206    Description:
207    
208    Fixed a serious bug in the rewrite code for FP spilling/reloading that
209    sent the RA into an infinite loop when floating point registers get
210    spilled.  (Because of this bug, e.g., nucleic stopped compiling between
211    110.37 and 110.38.)
212    There was another set of potential problems related to the handling of
213    MLRISC annotations (but those did not yet cause real problems, apparently).
214    
215    ----------------------------------------------------------------------
216    Name: Matthias Blume
217    Date: 2002/12/06 22:40:00 EST
218    Tag: blume-20021206-cm-fileid
219    Description:
220    
221    Added a call of SrcPath.sync at the beginning of Parse.parse (in CM).
222    This fixes the problem of CM getting confused by files that suddenly
223    change their identity (e.g., by getting unlinked and recreated by some
224    text editor such as vi).  There might be a better/cheaper/cleaner way
225    of doing this, but for now this will have to do.
226    
227    ----------------------------------------------------------------------
228    Name: Matthias Blume
229    Date: 2002/10/28 09:50:00 EST
230    Tag: blume-20021028-typecheck
231    Description:
232    
233    Exported structure Typecheck from $smlnj/viscomp/core.cm.
234    
235    ----------------------------------------------------------------------
236    Name: Matthias Blume
237    Date: 2002/10/17 09:10:00 EDT
238    Tag: Release_110_42
239    Description:
240    
241    In good old tradition, there has been a slight hiccup so that we have
242    to patch 110.42 after the fact.   The old release tag has been replaced
243    (see below).
244    
245    The change solves a problem with two competing approaches the
246    configuration problem regarding MacOS 10.1 vs. MacOS 10.2 which got in
247    each other's way.
248    
249    This change only affects the runtime system code and the installer script.
250    (No new bootfiles.)
251    
252    ----------------------------------------------------------------------
253    Name: Matthias Blume
254    Date: 2002/10/16 12:00:00 EDT
255    Tag: Release_110_42_removed
256    Description:
257    
258    New working release.  New bootfiles.
259    
260    ----------------------------------------------------------------------
261    Name: Matthias Blume
262    Date: 2002/10/10 13:10:00 EDT
263    Tag: blume-20021010-ppc-divs
264    Description:
265    
266    The mltree operator DIVS must be implemented with an overflow check on
267    the PPC because the hardware indicates divide-by-zero using "overflow" as
268    well.
269    
270    ----------------------------------------------------------------------
271    Name: Matthias Blume
272    Date: 2002/07/23 11:45:00
273    Tag: blume-20020723-smlnj-home
274    Description:
275    
276    Sml now senses the SMLNJ_HOME environment variable.  If this is set,
277    then the bin dir is assumed to be in $SMLNJ_HOME/bin and (unless
278    CM_PATHCONFIG is also set), the path configuration file is assumed
279    to be in $SMLNJ_HOME/lib/pathconfig.  This way one can easily move
280    the entire tree to some other place and everything will "just work".
281    
282    (Companion commands such as ml-build and ml-makedepend also sense this
283    variable.)
284    
285    ----------------------------------------------------------------------
286    Name: Matthias Blume
287    Date: 2002/07/12 21:19:00 EDT
288    Tag: blume-20020712-liveness
289    Description:
290    
291    Exported two useful "step" functions from liveness module (MLRISC).
292    
293    ----------------------------------------------------------------------
294    Name: Matthias Blume
295    Date: 2002/07/05 16:00 EDT
296    Tag: Release_110_41
297    Description:
298    
299    New working release.  New bootfiles.
300    
301    ----------------------------------------------------------------------
302    Name: Matthias Blume
303    Date: 2002/07/05 10:25:00 EDT
304    Tag: blume-20020705-btimp
305    Description:
306    
307    Exported structure BTImp from $smlnj/viscomp/debugprof.cm so that
308    other clients can set up backtracing support.
309    
310    ----------------------------------------------------------------------
311    Name: Matthias Blume
312    Date: 2002/06/25 17:23:00 EDT
313    Tag: blume-20020625-fpmax
314    Description:
315    
316    Fixed a bug in translation of INLMAX (and INLMIN) for the floating-point
317    case.  (The sense of the isNaN test was reversed -- which made min and
318    max always return their first argument.)
319    
320    ----------------------------------------------------------------------
321    Name: Matthias Blume
322    Date: 2002/06/11
323    Tag: blume-20020611-unixpath
324    Description:
325    
326    Back-ported OS.Path.{from,to}UnixPath from idlbasis-devel branch.
327    
328    ----------------------------------------------------------------------
329    Name: Matthias Blume
330    Date: 2002/06/10 16:35:00 EDT
331    Tag: blume-20020610-ieeereal
332    Description:
333    
334    I back-ported my implementation of IEEEReal.fromString from the
335    idlbasis-devel branch so that we can test it.
336    
337    Another small change is that ppDec tries to give more information
338    than just "<sig>" in the case of functors.  However, this code is
339    broken in some mysterious way if the functor's body's signature
340    has not been declared by ascription but gets inferred from the
341    implementation.  This needs fixing...
342    
343    ----------------------------------------------------------------------
344    Name: Matthias Blume
345    Date: 2002/05/31
346    Tag: blume-20020531-btrace-mode
347    Description:
348    
349    Resurrected SMLofNJ.Internals.BTrace.mode.  (It accidentally fell by
350    the wayside when I switched over to using Controls everywhere.)
351    
352    ----------------------------------------------------------------------
353    Name: Lal George
354    Date: 2002/05/23 12:21:40 EDT
355    Tag: george-20020523-visual-labels
356    Description:
357    
358    Labels are now displayed in the graphical output to make
359    the fall-through and target blocks obvious.
360    
361    ----------------------------------------------------------------------
362    Name: Matthias Blume
363    Date: 2002/05/22 11:03:00 EDT
364    Tag: blume-20020522-shrink
365    Description:
366    
367    John tweaked yesterday's fix for 1131 to handle an out-of-memory
368    situation that comes up when allocating huge arrays.
369    
370    ----------------------------------------------------------------------
371    Name: Matthias Blume
372    Date: 2002/05/21 16:00:00 EDT
373    Tag: Release_110_40
374    Description:
375    
376    New working release (110.40).  New bootfiles.
377    
378    [Also: John Reppy fixed GC bug 1131.]
379    
380    ----------------------------------------------------------------------
381    Name: Matthias Blume
382    Date: 2002/05/21 12:35:00 EDT
383    Tag: blume-20020521-cmdoc
384    Description:
385    
386    CM documentation update.
387    
388    ----------------------------------------------------------------------
389    Name: Matthias Blume
390    Date: 2002/05/21 10:55:00 EDT
391    Tag: blume-20020521-misc
392    Description:
393    
394    - John tweaked runtime to be silent on heap export (except when
395      GC messages are on).
396    - I added a few more things (cross-compiling versions of CMB) to
397      config/preloads (as suggestions).
398    
399    ----------------------------------------------------------------------
400    Name: Matthias Blume
401    Date: 2002/05/20 22:25:00 EDT
402    Tag: blume-20020520-controls
403    Description:
404    
405    - Added ControlUtil structure to control-lib.cm.
406    - Use it throughout.
407    - Used Controls facility to define MLRISC controls (as opposed to
408      registering MLRISC control ref cells with Controls after the fact)
409    - Fixed messed-up controls priorities.
410    
411    * Removed again all the stuff from config/preloads that one wouldn't
412      be able to preload at the time the initial heap image is built.
413      (Many libraries, e.g., CML, do not exist yet at this time.  The
414       only libraries that can be preloaded via config/preloads are those
415       that come bundled with the bootfiles.)
416    
417    ----------------------------------------------------------------------
418    Name: Matthias Blume
419    Date: 2002/05/20 10:59:00 EDT
420    Tag: blume-20020520-preloads
421    Description:
422    
423    Added a lot of commented-out suggestions for things to be included
424    in config/preloads.
425    
426    ----------------------------------------------------------------------
427    Name: Allen Leung
428    Date: 2002/05/18 14:20:00 EDT
429    Tag: leunga-20020518-mdl
430    Description:
431    
432    o Made the mdl tool stuff compile and run again.
433    o I've disabled all the stuff that depends on RTL specifications; they
434      are all badly broken anyway.
435    
436    ----------------------------------------------------------------------
437    Name: Matthias Blume
438    Date: 2002/05/17 16:49:00 EDT
439    Tag: blume-20020517-controls
440    Description:
441    
442    0. John Reppy made several modifications to the SML/NJ library.
443       In particular, there is a shiny new controls-lib.cm.
444    
445    1. Pushed new controls interface through compiler so that everything
446       compiles again.
447    
448    2. Added FormatComb and FORMAT_COMB to the CML version of the
449       SML/NJ library (so that CML compiles again).
450    
451    3. Modified init scripts because XXX_DEFAULT environment variables
452       are no longer with us.  (Boot-time initialization is now done
453       using the same environment variables that are also used for
454       startup-time initialization of controls.)
455    
456    ----------------------------------------------------------------------
457    Name: Lal George
458    Date: 2002/05/15 09:20:10 EDT
459    Tag: george-20020515-pseudo-op-decls
460    Description:
461    
462            All pseudo-ops emitted before the first segment declaration
463    such as TEXT, DATA, and BSS directives are assumed to be global
464    declarations and are emitted first in the assembly file. This is
465    useful in a number of situations where one has pseudo-ops that are not
466    specific to any segment, and also works around the constraint that one
467    cannot have client pseudo-ops in the TEXT segment.
468    
469            Because no segment is associated with these declarations it is
470    an error to allocate any space or objects before the first segment
471    directive and an exception will be raised. However, we cannot make
472    this check for client pseudo-ops.
473    
474            These top level declarations are a field in the CFG graph_info.
475    In theory you can continue to add to this field after the CFG has been
476    built -- provided you know what you are doing;-)
477    
478    ----------------------------------------------------------------------
479    Name: Matthias Blume
480    Date: 2002/05/13 16:40:00 EDT
481    Tag: blume-20020513-pp-etc
482    Description:
483    
484    A few minor bugfixes:
485    
486      - Stopgap measure for bug recently reported by Elsa Gunter (ppDec).
487        (Bogus printouts for redefined bindings still occur.  Compiler
488        bug should no longer occur now.  We need to redo the prettyprinter
489        from scratch.)
490    
491      - CM pathname printer now also adds escape sequences for ( and )
492    
493      - commend and docu fixes for ml-nlffi
494    
495    ----------------------------------------------------------------------
496    Name: Matthias Blume
497    Date: 2002/05/10 16:40:00 EDT
498    Tag: blume-20020510-erg-textio
499    Description:
500    
501    Applied the following bugfix provided by Emden Gansner:
502    
503        Output is corrupted when outputSubstr is used rather than output.
504    
505        The problem occurs when a substring
506    
507            ss = (s, dataStart, dataLen)
508    
509        where dataStart > 0, fills a stream buffer with avail bytes left.
510        avail bytes of s, starting at index dataStart, are copied into the
511        buffer, the buffer is flushed, and then the remaining dataLen-avail
512        bytes of ss are copied into the beginning of the buffer. Instead of
513        starting this copy at index dataStart+avail in s, the current code
514        starts the copy at index avail.
515    
516        Fix:
517        In text-io-fn.sml, change line 695 from
518             val needsFlush = copyVec(v, avail, dataLen-avail, buf, 0)
519        to
520             val needsFlush = copyVec(v, dataStart+avail, dataLen-avail, buf, 0)
521    
522    ----------------------------------------------------------------------
523    Name: Matthias Blume
524    Date: 2002/04/12 13:55:00 EDT
525    Tag: blume-20020412-assyntax
526    Description:
527    
528    1. Grabbed newer assyntax.h from the XFree86 project.
529    2. Fiddled with how to compile X86.prim.asm without warnings.
530    3. (Very) Minor cleanup in CM.
531    
532    ----------------------------------------------------------------------
533    Name: Matthias Blume
534    Date: 2002/04/01 (no joke!) 17:07:00 EST
535    Tag: blume-20020401-x86div
536    Description:
537    
538    Added full support for div/mod/rem/quot on the x86, using the machine
539    instruction's two results (without clumsily recomputing the remainder)
540    directly where appropriate.
541    
542    Some more extensive power-of-two support was added to the x86 instruction
543    selector (avoiding expensive divs, mods, and muls where they can be
544    replaced with cheaper shifts and masks).  However, this sort of thing
545    ought to be done earlier, e.g., within the CPS optimizer so that
546    all architectures benefit from it.
547    
548    The compiler compiles to a fixed point, but changes might be somewhat
549    fragile nevertheless.  Please, report any strange things that you might
550    see wrt. div/mod/quot/rem...
551    
552    ----------------------------------------------------------------------
553    Name: Matthias Blume
554    Date: 2002/03/29 17:22:00
555    Tag: blume-20020329-div
556    Description:
557    
558    Fixed my broken div/mod logic.  Unfortunately, this means that the
559    inline code for div/mod now has one more comparison than before.
560    Fast paths (quotient > 0 or remainder = 0) are not affected, though.
561    The problem was with quotient = 0, because that alone does not tell
562    us which way the rounding went.  One then has to look at whether
563    remainder and divisor have the same sign...  :(
564    
565    Anyway, I replaced the bootfiles with fresh ones...
566    
567    ----------------------------------------------------------------------
568    Name: Matthias Blume
569    Date: 2002/03/29 14:10:00 EST
570    Tag: blume-20020329-inlprims
571    Description:
572    
573    NEW BOOTFILES!!!    Version number bumped to 110.39.3.
574    
575    Primops have changed. This means that the bin/boot-file formats have
576    changed as well.
577    
578    To make sure that there is no confusion, I made a new version.
579    
580    
581    CHANGES:
582    
583    * removed REMT from mltree (remainder should never overflow).
584    
585    * added primops to deal with divisions of all flavors to the frontend
586    
587    * handled these primops all the way through so they map to their respective
588      MLRISC support
589    
590    * used these primops in the implementation of Int, Int32, Word, Word32
591    
592    * removed INLDIV, INLMOD, and INLREM as they are no longer necessary
593    
594    * parameterized INLMIN, INLMAX, and INLABS by a numkind
595    
596    * translate.sml now deals with all flavors of INL{MIN,MAX,ABS}, including
597      floating point
598    
599    * used INL{MIN,MAX,ABS} in the implementation of Int, Int32, Word, Word32,
600      and Real (but Real.abs maps to a separate floating-point-only primop)
601    
602    
603    TODO items:
604    
605    * Hacked Alpha32 instruction selection, disabling the selection of REMx
606      instructions because the machine instruction encoder cannot handle
607      them.  (Hppa, PPC, and Sparc instruction selection did not handle
608      REM in the first place, and REM is supported by the x86 machine coder.)
609    
610    * Handle DIV and MOD with DIV_TO_NEGINF directly in the x86 instruction
611      selection phase.  (The two can be streamlined because the hardware
612      delivers both quotient and remainder at the same time anyway.)
613    
614    * Think about what to do with "valOf(Int32.minInt) div ~1" and friends.
615      (Currently the behavior is inconsistent both across architectures and
616      wrt. the draft Basis spec.)
617    
618    * Word8 should eventually be handled natively, too.
619    
620    * There seems to be one serious bug in mltree-gen.sml.  It appears, though,
621      as if there currently is no execution path that could trigger it in
622      SML/NJ.  (The assumptions underlying functions arith and promotable do not
623      hold for things like multiplication and division.)
624    
625    ----------------------------------------------------------------------
626    Name: Matthias Blume
627    Date: 2002/03/27 16:27:00 EST
628    Tag: blume-20020327-mlrisc-divisions
629    Description:
630    
631    Added support for all four division operations (ML's div, mod, quot,
632    and rem) to MLRISC.  In the course of doing so, I also rationalized
633    the naming (no more annoying switch-around of DIV and QUOT), by
634    parameterizing the operation by div_rounding_mode (which can be either
635    DIV_TO_ZERO or DIV_TO_NEGINF).
636    
637    The generic MLTreeGen functor takes care of compiling all four
638    operations down to only round-to-zero div.
639    
640    Missing pieces:
641    
642      * Doing something smarter than relying on MLTreeGen on architectures
643        like, e.g., the x86 where hardware division delivers both quotient and
644        remainder at the same time.  With this, the implementation of the
645        round-to-neginf operations could be further streamlined.
646    
647      * Remove inlining support for div/mod/rem from the frontend and replace it
648        with primops that get carried through to the backend.  Do this for all
649        int and word types.
650    
651    ----------------------------------------------------------------------
652    Name: Matthias Blume
653    Date: 2002/03/25 17:25:00 EST
654    Tag: blume-20020325-divmod
655    Description:
656    
657    I improved (hopefully without breaking them) the implementation of Int.div,
658    Int.mod, and Int.rem.   For this, the code in translate.sml now takes
659    advantage of the following observations:
660    
661      Let  q = x quot y      r = x rem y
662           d = x div  y      m = x mod y
663    
664    where "quot" is the round-to-zero version of integer division that
665    hardware usually provides.  Then we have:
666    
667         r = x - q * y        where neither the * nor the - will overflow
668         d = if q >= 0 orelse x = q * y then q else q - 1
669                              where neither the * nor the - will overflow
670         m = if q >= 0 orelse r = 0 then r else r + y
671                              where the + will not overflow
672    
673    This results in substantial simplification of the generated code.
674    The following table shows the number of CFG nodes and edges generated
675    for
676            fun f (x, y) = x OPER y
677            (* with OPER \in div, mod, quot, rem *)
678    
679    
680        OPER | nodes(old) | edges(old) | nodes(new) | edges(new)
681        --------------------------------------------------------
682         div |         24 |         39 |         12 |         16
683         mod |         41 |         71 |         12 |         16
684        quot |          8 |         10 |          8 |         10
685         rem |         10 |         14 |          8 |         10
686    
687    
688    ----------------------------------------------------------------------
689    Name: Matthias Blume
690    Date: 2002/03/25 22:06:00 EST
691    Tag: blume-20020325-cprotobug
692    Description:
693    
694    Fixed a bug in cproto (c prototype decoder).
695    
696    ----------------------------------------------------------------------
697    Name: Matthias Blume
698    Date: 2002/03/25 16:00:00 EST
699    Tag: blume-20020325-raw-primops
700    Description:
701    
702    I did some cleanup to Allen's new primop code and
703    replaced yesterday's bootfiles with new ones.
704    (But they are stored in the same place.)
705    
706    ----------------------------------------------------------------------
707    Name: Matthias Blume
708    Date: 2002/03/24 22:40:00 EST
709    Tag: blume-20020324-bootfiles
710    Description:
711    
712    Made the bootfiles that Allen asked for.
713    
714    ----------------------------------------------------------------------
715    Name: Allen Leung
716    Date: 2002/03/23 15:50:00 EST
717    Tag: leunga-20020323-flint-cps-rcc-primops
718    Description:
719    
720      1. Changes to FLINT primops:
721    
722        (* make a call to a C-function;
723         * The primop carries C function prototype information and specifies
724         * which of its (ML-) arguments are floating point. C prototype
725         * information is for use by the backend, ML information is for
726         * use by the CPS converter. *)
727      | RAW_CCALL of { c_proto: CTypes.c_proto,
728                       ml_args: ccall_type list,
729                       ml_res_opt: ccall_type option,
730                       reentrant : bool
731                     } option
732       (* Allocate uninitialized storage on the heap.
733        * The record is meant to hold short-lived C objects, i.e., they
734        * are not ML pointers.  With the tag, the representation is
735        * the same as RECORD with tag tag_raw32 (sz=4), or tag_fblock (sz=8)
736        *)
737      | RAW_RECORD of {tag:bool,sz:int}
738      and ccall_type = CCALL_INT32 | CCALL_REAL64 | CCALL_ML_PTR
739    
740      2.  These CPS primops are now overloaded:
741    
742           rawload of {kind:numkind}
743           rawstore of {kind:numkind}
744    
745          The one argument form is:
746    
747             rawload {kind} address
748    
749          The two argument form is:
750    
751             rawload {kind} [ml object, byte-offset]
752    
753      3. RAW_CCALL/RCC now takes two extra arguments:
754    
755         a. The first is whether the C call is reentrant, i.e., whether
756            ML state should be saved and restored.
757         b. The second argument is a string argument specifying the name of
758            library and the C function.
759    
760         These things are currently not handled in the code generator, yet.
761    
762      4. In CProto,
763    
764         An encoding type of "bool" means "ml object" and is mapped into
765         C prototype of PTR.  Note that "bool" is different than "string",
766         even though "string" is also mapped into PTR, because "bool"
767         is assigned an CPS type of BOGt, while "string" is assigned INT32t.
768    
769      5. Pickler/unpicker
770    
771         Changed to handle RAW_RECORD and newest RAW_CCALL
772    
773      6. MLRiscGen,
774    
775         1. Changed to handle the new rawload/rawstore/rawrecord operators.
776         2. Code for handling C Calls has been moved to a new module CPSCCalls,
777            in the file CodeGen/cpscompile/cps-c-calls.sml
778    
779      7. Added the conditional move operator
780    
781             condmove of branch
782    
783         to cps.  Generation of this is still buggy so it is currently
784         disabled.
785    
786    ----------------------------------------------------------------------
787    Name: Lal George
788    Date: 2002/03/22 14:18:25 EST
789    Tag: george-20020322-cps-branch-prob
790    Description:
791    
792    Implemented the Ball-Larus branch prediction-heuristics, and
793    incorporated graphical viewers for control flow graphs.
794    
795    Ball-Larus Heuristics:
796    ---------------------
797    See the file compiler/CodeGen/cpscompile/cpsBranchProb.sml.
798    
799    By design it uses the Dempster-Shafer theory for combining
800    probabilities.  For example, in the function:
801    
802        fun f(n,acc) = if n = 0 then acc else f(n-1, n*acc)
803    
804    the ball-larus heuristics predicts that the n=0 is unlikely
805    (OH-heuristic), and the 'then' branch is unlikely because of the
806    RH-heuristic -- giving the 'then' branch an even lower combined
807    probability using the Dempster-Shafer theory.
808    
809    Finally, John Reppy's loop analysis in MLRISC, further lowers the
810    probability of the 'then' branch because of the loop in the else
811    branch.
812    
813    
814    Graphical Viewing:
815    ------------------
816    I merely plugged in Allen's graphical viewers into the compiler. The
817    additional code is not much. At the top level, saying:
818    
819            Control.MLRISC.getFlag "cfg-graphical-view" := true;
820    
821    will display the graphical view of the control flow graph just before
822    back-patching.  daVinci must be in your path for this to work. If
823    daVinci is not available, then the default viewer can be changed
824    using:
825    
826            Control.MLRISC.getString "viewer"
827    
828    which can be set to "dot" or "vcg" for the corresponding viewers. Of
829    course, these viewers must be in your path.
830    
831    The above will display the compilation unit at the level of clusters,
832    many of which are small, boring, and un-interesting. Also setting:
833    
834            Control.MLRISC.getInt "cfg-graphical-view_size"
835    
836    will display clusters that are larger than the value set by the above.
837    
838    
839    ----------------------------------------------------------------------
840    Name: Matthias Blume
841    Date: 2002/03/21 22:20:00 EST
842    Tag: blume-20020321-kmp-bugfix
843    Description:
844    
845    Changed the interface to the KMP routine in PreString and fixed
846    a minor bug in one place where it was used.
847    
848    ----------------------------------------------------------------------
849    Name: Allen Leung
850    Date: 2002/03/21 20:30:00 EST
851    Tag: leunga-20020321-cfg
852    Description:
853    
854      Fixed a potential problem in cfg edge splitting.
855    
856    ----------------------------------------------------------------------
857    Name: Allen Leung
858    Date: 2002/03/21 17:15:00 EST
859    Tag: leunga-20020321-x86-fp-cfg
860    Description:
861    
862      1. Recoded the buggy parts of x86-fp.
863    
864         a. All the block reordering code has been removed.
865            We now depend on the block placement phases to do this work.
866    
867         b. Critical edge splitting code has been simplified and moved into the
868            CFG modules, as where they belong.
869    
870         Both of these were quite buggy and complex.  The code is now much, much
871         simpler.
872    
873      2. X86 backend.
874    
875         a. Added instructions for 64-bit support.  Instruction selection for
876            64-bit has not been committed, however, since that
877            requires changes to MLTREE which haven't been approved by
878            Lal and John.
879    
880         b. Added support for FUCOMI and FUCOMIP when generating code for
881            PentiumPro and above.  We only generate these instructions in
882            the fast-fp mode.
883    
884         c. Added cases for JP and JNP in X86FreqProps.
885    
886      3. CFG
887    
888         CFG now has a bunch of methods for edge splitting and merging.
889    
890      4. Machine description.
891    
892         John's simplification of MLTREE_BASIS.fcond broke a few machine
893         description things:
894    
895         rtl-build.{sig,sml} and hppa.mdl fixed.
896    
897         NOTE: the machine description stuff in the repository is still broken.
898               Again, I can't put my fixes in because that involves
899               changes to MLTREE.
900    
901    ----------------------------------------------------------------------
902    Name: Matthias Blume
903    Date: 2002/03/20 15:55:00 EST
904    Tag: blume-20020320-kmp
905    Description:
906    
907    Implemented Knuth-Morris-Pratt string matching in PreString and used
908    it for String.isSubstring, Substring.isSubstring, and
909    Substring.position.
910    
911    (Might need some stress-testing.  Simple examples worked fine.)
912    
913    ----------------------------------------------------------------------
914    Name: Matthias Blume
915    Date: 2002/03/19 16:37:00 EST
916    Tag: blume-20020319-witnesses
917    Description:
918    
919    Added a structure C.W and functions convert/Ptr.convert to ml-nlffi-lib.
920    
921    This implements a generic mechanism for changing constness qualifiers
922    anywhere within big C types without resorting to outright "casts".
923    (So far, functions such as C.rw/C.ro or C.Ptr.rw/C.Ptr.ro only let you
924    modify the constness at the outermost level.)
925    The implementation of "convert" is based on the idea of "witness"
926    values -- values that are not used by the operation but whose types
927    "testify" to their applicability.  On the implementation side, "convert"
928    is simply a projection (returning its second curried argument).  With
929    cross-module inlining, it should not result in any machine code being
930    generated.
931    
932    ----------------------------------------------------------------------
933    Name: Matthias Blume
934    Date: 2002/03/15 16:40:00 EST
935    Tag: blume-20020315-basis
936    Description:
937    
938    Provided (preliminary?) implementations for
939    
940      {String,Substring}.{concatWith,isSuffix,isSubstring}
941    
942    and
943    
944      Substring.full
945    
946    Those are in the Basis spec but they were missing in SML/NJ.
947    
948    ----------------------------------------------------------------------
949    Name: Matthias Blume
950    Date: 2002/03/14 21:30:00 EST
951    Tag: blume-20020314-controls
952    Description:
953    
954    Controls:
955    ---------
956    
957    1. Factored out the recently-added Controls : CONTROLS stuff and put
958       it into its own library $/controls-lib.cm.  The source tree for
959       this is under src/smlnj-lib/Controls.
960    
961    2. Changed the names of types and functions in this interface, so they
962       make a bit more "sense":
963    
964          module -> registry
965          'a registry -> 'a group
966    
967    3. The interface now deals in ref cells only.  The getter/setter interface
968       is (mostly) gone.
969    
970    4. Added a function that lets one register an already-existing ref cell.
971    
972    5. Made the corresponding modifications to the rest of the code so that
973       everything compiles again.
974    
975    6. Changed the implementation of Controls.MLRISC back to something closer
976       to the original.  In particular, this module (and therefore MLRISC)
977       does not depend on Controls.  There now is some link-time code in
978       int-sys.sml that registers the MLRISC controls with the Controls
979       module.
980    
981    CM:
982    ---
983    
984      * One can now specify the lambda-split aggressiveness in init.cmi.
985    
986    ----------------------------------------------------------------------
987    Name: Allen Leung
988    Date: 2002/03/13 17:30:00 EST
989    Tag: leunga-20020313-x86-fp-unary
990    Description:
991    
992    Bug fix for:
993    
994    > leunga@weaselbane:~/Yale/tmp/sml-dist{21} bin/sml
995    > Standard ML of New Jersey v110.39.1 [FLINT v1.5], March 08, 2002
996    > - fun f(x,(y,z)) = Real.~ y;
997    > [autoloading]
998    > [autoloading done]
999    >       fchsl   (%eax), 184(%esp)
1000    > Error: MLRisc bug: X86MCEmitter.emitInstr
1001    >
1002    > uncaught exception Error
1003    >   raised at: ../MLRISC/control/mlriscErrormsg.sml:16.14-16.19
1004    
1005    The problem was that the code generator did not generate any fp registers
1006    in this case, and the ra didn't know that it needed to run the X86FP phase to
1007    translate the pseudo fp instruction.   This only happened with unary fp
1008    operators in certain situations.
1009    
1010    ----------------------------------------------------------------------
1011    Name: Matthias Blume
1012    Date: 2002/03/13 14:00:00 EST
1013    Tag: blume-20020313-overload-etc
1014    Description:
1015    
1016    1. Added _overload as a synonym for overload for backward compatibility.
1017       (Control.overloadKW must be true for either version to be accepted.)
1018    
1019    2. Fixed bug in install script that caused more things to be installed
1020       than what was requested in config/targets.
1021    
1022    3. Made CM aware of the (_)overload construct so that autoloading
1023       works.
1024    
1025    ----------------------------------------------------------------------
1026    Name: Matthias Blume
1027    Date: 2002/03/12 22:03:00 EST
1028    Tag: blume-20020312-url
1029    Description:
1030    
1031    Forgot to update BOOT and srcarchiveurl.
1032    
1033    ----------------------------------------------------------------------
1034    Name: Matthias Blume
1035    Date: 2002/03/12 17:30:00 EST
1036    Tag: blume-20020312-version110392
1037    Description:
1038    
1039    Yet another version number bump (because of small changes to the
1040    binfile format).  Version number is now 110.39.2.  NEW BOOTFILES!
1041    
1042    Changes:
1043    
1044      The new pid generation scheme described a few weeks ago was overly
1045      complicated.  I implemented a new mechanism that is simpler and
1046      provides a bit more "stability":  Once CM has seen a compilation
1047      unit, it keeps its identity constant (as long as you do not delete
1048      those crucial CM/GUID/* files).  This means that when you change
1049      an interface, compile, then go back to the old interface, and
1050      compile again, you arrive at the original pid.
1051    
1052      There now also is a mechanism that instructs CM to use the plain
1053      environment hash as a module's pid (effectively making its GUID
1054      the empty string).  For this, "noguid" must be specified as an
1055      option to the .sml file in question within its .cm file.
1056      This is most useful for code that is being generated by tools such
1057      as ml-nlffigen (because during development programmers tend to
1058      erase the tool's entire output directory tree including CM's cached
1059      GUIDs).  "noguid" is somewhat dangerous (since it can be used to locally
1060      revert to the old, broken behavior of SML/NJ, but in specific cases
1061      where there is no danger of interface confusion, its use is ok
1062      (I think).
1063    
1064      ml-nlffigen by default generates "noguid" annotations.  They can be
1065      turned off by specifying -guid in its command line.
1066    
1067    ----------------------------------------------------------------------
1068    Name: Lal George
1069    Date: 2002/03/12 12 14:42:36 EST
1070    Tag: george-20020312-frequency-computation
1071    Description:
1072    
1073    Integrated jump chaining and static block frequency into the
1074    compiler. More details and numbers later.
1075    
1076    ----------------------------------------------------------------------
1077    Name: Lal George
1078    Date: 2002/03/11 11 22:38:53 EST
1079    Tag: george-20020311-jump-chain-elim
1080    Description:
1081    
1082    Tested the jump chain elimination on all architectures (except the
1083    hppa).  This is on by default right now and is profitable for the
1084    alpha and x86, however, it may not be profitable for the sparc and ppc
1085    when compiling the compiler.
1086    
1087    The gc test will typically jump to a label at the end of the cluster,
1088    where there is another jump to an external cluster containing the actual
1089    code to invoke gc. This is to allow factoring of common gc invocation
1090    sequences. That is to say, we generate:
1091    
1092            f:
1093               testgc
1094               ja   L1      % jump if above to L1
1095    
1096            L1:
1097               jmp L2
1098    
1099    
1100    After jump chain elimination the 'ja L1' instructions is converted to
1101    'ja L2'. On the sparc and ppc, many of the 'ja L2' instructions may end
1102    up being implemented in their long form (if L2 is far away) using:
1103    
1104            jbe     L3      % jump if below or equal to L3
1105            jmp     L2
1106         L3:
1107            ...
1108    
1109    
1110    For large compilation units L2  may be far away.
1111    
1112    
1113    ----------------------------------------------------------------------
1114    Name: Matthias Blume
1115    Date: 2002/03/11 13:30:00 EST
1116    Tag: blume-20020311-mltreeeval
1117    Description:
1118    
1119    A functor parameter was missing.
1120    
1121    ----------------------------------------------------------------------
1122    Name: Allen Leung
1123    Date: 2002/03/11 10:30:00 EST
1124    Tag: leunga-20020311-runtime-string0
1125    Description:
1126    
1127       The representation of the empty string now points to a
1128    legal null terminated C string instead of unit.  It is now possible
1129    to convert an ML string into C string with InlineT.CharVector.getData.
1130    This compiles into one single machine instruction.
1131    
1132    ----------------------------------------------------------------------
1133    Name: Allen Leung
1134    Date: 2002/03/10 23:55:00 EST
1135    Tag: leunga-20020310-x86-call
1136    Description:
1137    
1138       Added machine generation for CALL instruction (relative displacement mode)
1139    
1140    ----------------------------------------------------------------------
1141    Name: Matthias Blume
1142    Date: 2002/03/08 16:05:00
1143    Tag: blume-20020308-entrypoints
1144    Description:
1145    
1146    Version number bumped to 110.39.1.  NEW BOOTFILES!
1147    
1148    Entrypoints: non-zero offset into a code object where execution should begin.
1149    
1150    - Added the notion of an entrypoint to CodeObj.
1151    - Added reading/writing of entrypoint info to Binfile.
1152    - Made runtime system bootloader aware of entrypoints.
1153    - Use the address of the label of the first function given to mlriscGen
1154      as the entrypoint.  This address is currently always 0, but it will
1155      not be 0 once we turn on block placement.
1156    - Removed the linkage cluster code (which was The Other Way(tm) of dealing
1157      with entry points) from mlriscGen.
1158    
1159    ----------------------------------------------------------------------
1160    Name: Allen Leung
1161    Date: 2002/03/07 20:45:00 EST
1162    Tag: leunga-20020307-x86-cmov
1163    Description:
1164    
1165       Bug fixes for CMOVcc on x86.
1166    
1167       1. Added machine code generation for CMOVcc
1168       2. CMOVcc is now generated in preference over SETcc on PentiumPro or above.
1169       3. CMOVcc cannot have an immediate operand as argument.
1170    
1171    ----------------------------------------------------------------------
1172    Name: Matthias Blume
1173    Date: 2002/03/07 16:15:00 EST
1174    Tag: blume-20020307-controls
1175    Description:
1176    
1177    This is a very large but mostly boring patch which makes (almost)
1178    every tuneable compiler knob (i.e., pretty much everything under
1179    Control.* plus a few other things) configurable via both the command
1180    line and environment variables in the style CM did its configuration
1181    until now.
1182    
1183    Try starting sml with '-h' (or, if you are brave, '-H')
1184    
1185    To this end, I added a structure Controls : CONTROLS to smlnj-lib.cm which
1186    implements the underlying generic mechanism.
1187    
1188    The interface to some of the existing such facilities has changed somewhat.
1189    For example, the MLRiscControl module now provides mkFoo instead of getFoo.
1190    (The getFoo interface is still there for backward-compatibility, but its
1191    use is deprecated.)
1192    
1193    The ml-build script passes -Cxxx=yyy command-line arguments through so
1194    that one can now twiddle the compiler settings when using this "batch"
1195    compiler.
1196    
1197    TODO items:
1198    
1199    We should go through and throw out all controls that are no longer
1200    connected to anything.  Moreover, we should go through and provide
1201    meaningful (and correct!) documentation strings for those controls
1202    that still are connected.
1203    
1204    Currently, multiple calls to Controls.new are accepted (only the first
1205    has any effect).  Eventually we should make sure that every control
1206    is being made (via Controls.new) exactly once.  Future access can then
1207    be done using Controls.acc.
1208    
1209    Finally, it would probably be a good idea to use the getter-setter
1210    interface to controls rather than ref cells.  For the time being, both
1211    styles are provided by the Controls module, but getter-setter pairs are
1212    better if thread-safety is of any concern because they can be wrapped.
1213    
1214    *****************************************
1215    
1216    One bug fix: The function blockPlacement in three of the MLRISC
1217    backpatch files used to be hard-wired to one of two possibilities at
1218    link time (according to the value of the placementFlag).  But (I
1219    think) it should rather sense the flag every time.
1220    
1221    *****************************************
1222    
1223    Other assorted changes (by other people who did not supply a HISTORY entry):
1224    
1225    1. the cross-module inliner now works much better (Monnier)
1226    2. representation of weights, frequencies, and probabilities in MLRISC
1227       changed in preparation of using those for weighted block placement
1228       (Reppy, George)
1229    
1230    ----------------------------------------------------------------------
1231    Name: Lal George
1232    Date: 2002/03/07 14:44:24 EST 2002
1233    Tag: george-20020307-weighted-block-placement
1234    
1235    Tested the weighted block placement optimization on all architectures
1236    (except the hppa) using AMPL to generate the block and edge frequencies.
1237    Changes were required in the machine properties to correctly
1238    categorize trap instructions. There is an MLRISC flag
1239    "weighted-block-placement" that can be used to enable weighted block
1240    placement, but this will be ineffective without block/edge
1241    frequencies (coming soon).
1242    
1243    
1244    ----------------------------------------------------------------------
1245    Name: Lal George
1246    Date: 2002/03/05 17:24:48 EST
1247    Tag: george-20020305-linkage-cluster
1248    
1249    In order to support the block placement optimization, a new cluster
1250    is generated as the very first cluster (called the linkage cluster).
1251    It contains a single jump to the 'real' entry point for the compilation
1252    unit. Block placement has no effect on the linkage cluster itself, but
1253    all the other clusters  have full freedom in the manner in which they
1254    reorder blocks or functions.
1255    
1256    On the x86 the typical linkage code that is generated is:
1257       ----------------------
1258            .align 2
1259       L0:
1260            addl    $L1-L0, 72(%esp)
1261            jmp     L1
1262    
1263    
1264            .align  2
1265       L1:
1266       ----------------------
1267    
1268    72(%esp) is the memory location for the stdlink register. This
1269    must contain the address of the CPS function being called. In the
1270    above example, it contains the address of  L0; before
1271    calling L1 (the real entry point for the compilation unit), it
1272    must contain the address for L1, and hence
1273    
1274            addl $L1-L0, 72(%esp)
1275    
1276    I have tested this on all architectures except the hppa.The increase
1277    in code size is of course negligible
1278    
1279    ----------------------------------------------------------------------
1280    Name: Allen Leung
1281    Date: 2002/03/03 13:20:00 EST
1282    Tag: leunga-20020303-mlrisc-tools
1283    
1284      Added #[ ... ] expressions to mlrisc tools
1285    
1286    ----------------------------------------------------------------------
1287    Name: Matthias Blume
1288    Date: 2002/02/27 12:29:00 EST
1289    Tag: blume-20020227-cdebug
1290    Description:
1291    
1292    - made types in structure C and C_Debug to be equal
1293    - got rid of code duplication (c-int.sml vs. c-int-debug.sml)
1294    - there no longer is a C_Int_Debug (C_Debug is directly derived from C)
1295    
1296    ----------------------------------------------------------------------
1297    Name: Matthias Blume
1298    Date: 2002/02/26 12:00:00 EST
1299    Tag: blume-20020226-ffi
1300    Description:
1301    
1302    1. Fixed a minor bug in CM's "noweb" tool:
1303       If numbering is turned off, then truly don't number (i.e., do not
1304       supply the -L option to noweb).  The previous behavior was to supply
1305       -L'' -- which caused noweb to use the "default" line numbering scheme.
1306       Thanks to Chris Richards for pointing this out (and supplying the fix).
1307    
1308    2. Once again, I reworked some aspects of the FFI:
1309    
1310       A. The incomplete/complete type business:
1311    
1312       - Signatures POINTER_TO_INCOMPLETE_TYPE and accompanying functors are
1313         gone!
1314       - ML types representing an incomplete type are now *equal* to
1315         ML types representing their corresponding complete types (just like
1316         in C).  This is still safe because ml-nlffigen will not generate
1317         RTTI for incomplete types, nor will it generate functions that
1318         require access to such RTTI.   But when ML code generated from both
1319         incomplete and complete versions of the C type meet, the ML types
1320         are trivially interoperable.
1321    
1322         NOTE:  These changes restore the full generality of the translation
1323         (which was previously lost when I eliminated functorization)!
1324    
1325       B. Enum types:
1326    
1327       - Structure C now has a type constructor "enum" that is similar to
1328         how the "su" constructor works.  However, "enum" is not a phantom
1329         type because each "T enum" has values (and is isomorphic to
1330         MLRep.Signed.int).
1331       - There are generic access operations for enum objects (using
1332         MLRep.Signed.int).
1333       - ml-nlffigen will generate a structure E_foo for each "enum foo".
1334         * The structure contains the definition of type "mlrep" (the ML-side
1335         representation type of the enum).  Normally, mlrep is the same
1336         as "MLRep.Signed.int", but if ml-nlffigen was invoked with "-ec",
1337         then mlrep will be defined as a datatype -- thus facilitating
1338         pattern matching on mlrep values.
1339         ("-ec" will be suppressed if there are duplicate values in an
1340          enumeration.)
1341         * Constructors ("-ec") or values (no "-ec") e_xxx of type mlrep
1342         will be generated for each C enum constant xxx.
1343         * Conversion functions m2i and i2m convert between mlrep and
1344         MLRep.Signed.int.  (Without "-ec", these functions are identities.)
1345         * Coversion functions c and ml convert between mlrep and "tag enum".
1346         * Access functions (get/set) fetch and store mlrep values.
1347       - By default (unless ml-nlffigen was invoked with "-nocollect"), unnamed
1348         enumerations are merged into one single enumeration represented by
1349         structure E_'.
1350    
1351    ----------------------------------------------------------------------
1352    Name: Allen Leung
1353    Date: 2002/02/25 04:45:00 EST
1354    Tag: leunga-20020225-cps-spill
1355    
1356    This is a new implementation of the CPS spill phase.
1357    The new phase is in the new file compiler/CodeGen/cpscompile/spill-new.sml
1358    In case of problems, replace it with the old file spill.sml
1359    
1360    The current compiler runs into some serious performance problems when
1361    constructing a large record.  This can happen when we try to compile a
1362    structure with many items.  Even a very simple structure like the following
1363    makes the compiler slow down.
1364    
1365        structure Foo = struct
1366           val x_1 = 0w1 : Word32.int
1367           val x_2 = 0w2 : Word32.int
1368           val x_3 = 0w3 : Word32.int
1369           ...
1370           val x_N = 0wN : Word32.int
1371        end
1372    
1373    The following table shows the compile time, from N=1000 to N=4000,
1374    with the old compiler:
1375    
1376    N
1377    1000   CPS 100 spill                           0.04u  0.00s  0.00g
1378           MLRISC ra                               0.06u  0.00s  0.05g
1379              (spills = 0 reloads = 0)
1380           TOTAL                                   0.63u  0.07s  0.21g
1381    
1382    1100   CPS 100 spill                           8.25u  0.32s  0.64g
1383           MLRISC ra                               5.68u  0.59s  3.93g
1384              (spills = 0 reloads = 0)
1385           TOTAL                                   14.71u  0.99s  4.81g
1386    
1387    1500   CPS 100 spill                           58.55u  2.34s  1.74g
1388           MLRISC ra                               5.54u  0.65s  3.91g
1389              (spills = 543 reloads = 1082)
1390           TOTAL                                   65.40u  3.13s  6.00g
1391    
1392    2000   CPS 100 spill                           126.69u  4.84s  3.08g
1393           MLRISC ra                               0.80u  0.10s  0.55g
1394              (spills = 42 reloads = 84)
1395           TOTAL                                   129.42u  5.10s  4.13g
1396    
1397    3000   CPS 100 spill                           675.59u  19.03s  11.64g
1398           MLRISC ra                               2.69u  0.27s  1.38g
1399              (spills = 62 reloads = 124)
1400           TOTAL                                   682.48u  19.61s  13.99g
1401    
1402    4000   CPS 100 spill                           2362.82u  56.28s  43.60g
1403           MLRISC ra                               4.96u  0.27s  2.72g
1404              (spills = 85 reloads = 170)
1405           TOTAL                                   2375.26u  57.21s  48.00g
1406    
1407    As you can see the old cps spill module suffers from some serious
1408    performance problem.  But since I cannot decipher the old code fully,
1409    instead of patching the problems up, I'm reimplementing it
1410    with a different algorithm.  The new code is more modular,
1411    smaller when compiled, and substantially faster
1412    (O(n log n) time and O(n) space).  Timing of the new spill module:
1413    
1414    4000  CPS 100 spill                           0.02u  0.00s  0.00g
1415          MLRISC ra                               0.25u  0.02s  0.15g
1416             (spills=1 reloads=3)
1417          TOTAL                                   7.74u  0.34s  1.62g
1418    
1419    Implementation details:
1420    
1421    As far as I can tell, the purpose of the CPS spill module is to make sure the
1422    number of live variables at any program point (the bandwidth)
1423    does not exceed a certain limit, which is determined by the
1424    size of the spill area.
1425    
1426    When the bandwidth is too large, we decrease the register pressure by
1427    packing live variables into spill records.  How we achieve this is
1428    completely different than what we did in the old code.
1429    
1430    First, there is something about the MLRiscGen code generator
1431    that we should be aware of:
1432    
1433    o MLRiscGen performs code motion!
1434    
1435       In particular, it will move floating point computations and
1436       address computations involving only the heap pointer to
1437       their use sites (if there is only a single use).
1438       What this means is that if we have a CPS record construction
1439       statement
1440    
1441           RECORD(k,vl,w,e)
1442    
1443       we should never count the new record address w as live if w
1444       has only one use (which is often the case).
1445    
1446       We should do something similar to floating point, but the transformation
1447       there is much more complex, so I won't deal with that.
1448    
1449    Secondly, there are now two new cps primops at our disposal:
1450    
1451     1. rawrecord of record_kind option
1452        This pure operator allocates some uninitialized storage from the heap.
1453        There are two forms:
1454    
1455         rawrecord NONE [INT n]  allocates a tagless record of length n
1456         rawrecord (SOME rk) [INT n] allocates a tagged record of length n
1457                                     and initializes the tag.
1458    
1459     2. rawupdate of cty
1460          rawupdate cty (v,i,x)
1461          Assigns to x to the ith component of record v.
1462          The storelist is not updated.
1463    
1464    We use these new primops for both spilling and increment record construction.
1465    
1466     1. Spilling.
1467    
1468        This is implemented with a linear scan algorithm (but generalized
1469        to trees).  The algorithm will create a single spill record at the
1470        beginning of the cps function and use rawupdate to spill to it,
1471        and SELECT or SELp to reload from it.  So both spills and reloads
1472        are fine-grain operations.  In contrast, in the old algorithm
1473        "spills" have to be bundled together in records.
1474    
1475        Ideally, we should sink the spill record construction to where
1476        it is needed.  We can even split the spill record into multiple ones
1477        at the places where they are needed.  But CPS is not a good
1478        representation for global code motion, so I'll keep it simple and
1479        am not attempting this.
1480    
1481     2. Incremental record construction (aka record splitting).
1482    
1483        Long records with many component values which are simulatenously live
1484        (recall that single use record addresses are not considered to
1485         be live) are constructed with rawrecord and rawupdate.
1486        We allocate space on the heap with rawrecord first, then gradually
1487        fill it in with rawupdate.  This is the technique suggested to me
1488        by Matthias.
1489    
1490        Some restrictions on when this is applicable:
1491        1. It is not a VECTOR record.  The code generator currently does not handle
1492           this case. VECTOR record uses double indirection like arrays.
1493        2. All the record component values are defined in the same "basic block"
1494           as the record constructor.  This is to prevent speculative
1495           record construction.
1496    
1497    ----------------------------------------------------------------------
1498    Name: Allen Leung
1499    Date: 2002/02/22 01:02:00 EST
1500    Tag: leunga-20020222-mlrisc-tools
1501    
1502    Minor bug fixes in the parser and rewriter
1503    
1504    ----------------------------------------------------------------------
1505    Name: Allen Leung
1506    Date: 2002/02/21 20:20:00 EST
1507    Tag: leunga-20020221-peephole
1508    
1509    Regenerated the peephole files.  Some contained typos in the specification
1510    and some didn't compile because of pretty printing bugs in the old version
1511    of 'nowhere'.
1512    
1513    ----------------------------------------------------------------------
1514    Name: Allen Leung
1515    Date: 2002/02/19 20:20:00 EST
1516    Tag: leunga-20020219-mlrisc-tools
1517    Description:
1518    
1519       Minor bug fixes to the mlrisc-tools library:
1520    
1521       1.  Fixed up parsing colon suffixed keywords
1522       2.  Added the ability to shut the error messages up
1523       3.  Reimplemented the pretty printer and fixed up/improved
1524           the pretty printing of handle and -> types.
1525       4.  Fixed up generation of literal symbols in the nowhere tool.
1526       5.  Added some SML keywords to to sml.sty
1527    
1528    ----------------------------------------------------------------------
1529    Name: Matthias Blume
1530    Date: 2002/02/19 16:20:00 EST
1531    Tag: blume-20020219-cmffi
1532    Description:
1533    
1534    A wild mix of changes, some minor, some major:
1535    
1536    * All C FFI-related libraries are now anchored under $c:
1537        $/c.cm      --> $c/c.cm
1538        $/c-int.cm  --> $c/internals/c-int.cm
1539        $/memory.cm --> $c/memory/memory.cm
1540    
1541    * "make" tool (in CM) now treats its argument pathname slightly
1542      differently:
1543        1. If the native expansion is an absolute name, then before invoking
1544           the "make" command on it, CM will apply OS.Path.mkRelative
1545           (with relativeTo = OS.FileSys.getDir()) to it.
1546        2. The argument will be passed through to subsequent phases of CM
1547           processing without "going native".  In particular, if the argument
1548           was an anchored path, then "make" will not lose track of that anchor.
1549    
1550    * Compiler backends now "know" their respective C calling conventions
1551      instead of having to be told about it by ml-nlffigen.  This relieves
1552      ml-nlffigen from one of its burdens.
1553    
1554    * The X86Backend has been split into X86CCallBackend and X86StdCallBackend.
1555    
1556    * Export C_DEBUG and C_Debug from $c/c.cm.
1557    
1558    * C type encoding in ml-nlffi-lib has been improved to model the conceptual
1559      subtyping relationship between incomplete pointers and their complete
1560      counterparts.  For this, ('t, 'c) ptr has been changed to 'o ptr --
1561      with the convention of instantiating 'o with ('t, 'c) obj whenever
1562      the pointer target type is complete.  In the incomplete case, 'o
1563      will be instantiated with some "'c iobj" -- a type obtained by
1564      using one of the functors PointerToIncompleteType or PointerToCompleteType.
1565    
1566      Operations that work on both incomplete and complete pointer types are
1567      typed as taking an 'o ptr while operations that require the target to
1568      be known are typed as taking some ('t, 'c) obj ptr.
1569    
1570      voidptr is now a bit "more concrete", namely "type voidptr = void ptr'"
1571      where void is an eqtype without any values.  This makes it possible
1572      to work on voidptr values using functions meant to operate on light
1573      incomplete pointers.
1574    
1575    * As a result of the above, signature POINTER_TO_INCOMPLETE_TYPE has
1576      been vastly simplified.
1577    
1578    ----------------------------------------------------------------------
1579    Name: Matthias Blume
1580    Date: 2002/02/19 10:48:00 EST
1581    Tag: blume-20020219-pqfix
1582    Description:
1583    
1584    Applied Chris Okasaki's bug fix for priority queues.
1585    
1586    ----------------------------------------------------------------------
1587    Name: Matthias Blume
1588    Date: 2002/02/15 17:05:00
1589    Tag: Release_110_39
1590    Description:
1591    
1592    Last-minute retagging is becoming a tradition... :-(
1593    
1594    This is the working release 110.39.
1595    
1596    ----------------------------------------------------------------------
1597    Name: Matthias Blume
1598    Date: 2002/02/15 16:00:00 EST
1599    Tag: Release_110_39-orig
1600    Description:
1601    
1602    Working release 110.39.  New bootfiles.
1603    
1604    (Update: There was a small bug in the installer so it wouldn't work
1605    with all shells.  So I retagged. -Matthias)
1606    
1607    ----------------------------------------------------------------------
1608    Name: Matthias Blume
1609    Date: 2002/02/15 14:17:00 EST
1610    Tag: blume-20020215-showbindings
1611    Description:
1612    
1613    Added EnvRef.listBoundSymbols and CM.State.showBindings.  Especially
1614    the latter can be useful for exploring what bindings are available at
1615    the interactive prompt.  (The first function returns only the list
1616    of symbols that are really bound, the second prints those but also the
1617    ones that CM's autoloading mechanism knows about.)
1618    
1619    ----------------------------------------------------------------------
1620    Name: Matthias Blume
1621    Date: 2002/02/15 12:08:00 EST
1622    Tag: blume-20020215-iptrs
1623    Description:
1624    
1625    Two improvements to ml-nlffigen:
1626    
1627      1. Write files only if they do not exist or if their current contents
1628         do not coincide with what's being written.  (That is, avoid messing
1629         with the time stamps unless absolutely necessary.)
1630    
1631      2. Implement a "repository" mechanism for generated files related
1632         to "incomplete pointer types".   See the README file for details.
1633    
1634    ----------------------------------------------------------------------
1635    Name: Matthias Blume
1636    Date: 2002/02/14 11:50:00 EST
1637    Tag: blume-20020214-quote
1638    Description:
1639    
1640    Added a type 't t_' to tag.sml (in ml-nlffi-lib.cm).  This is required
1641    because of the new and improved tag generation scheme.  (Thanks to Allen
1642    Leung for pointing it out.)
1643    
1644    ----------------------------------------------------------------------
1645    Name: Lal George
1646    Date: 2002/02/14 09:55:27 EST 2002
1647    Tag: george-20020214-isabelle-bug
1648    Description:
1649    
1650    Fixed the MLRISC bug sent by Markus Wenzel regarding the compilation
1651    of Isabelle on the x86.
1652    
1653    From Allen:
1654    -----------
1655     I've found the problem:
1656    
1657         in ra-core.sml, I use the counter "blocked" to keep track of the
1658         true number of elements in the freeze queue.  When the counter goes
1659         to zero, I skip examining the queue.  But I've messed up the
1660         bookkeeping in combine():
1661    
1662             else ();
1663             case !ucol of
1664               PSEUDO => (if !cntv > 0 then
1665                     (if !cntu > 0 then blocked := !blocked - 1 else ();
1666                                        ^^^^^^^^^^^^^^^^^^^^^^^
1667                      moveu := mergeMoveList(!movev, !moveu)
1668                     )
1669                  else ();
1670    
1671         combine() is called to coalesce two nodes u and v.
1672         I think I was thinking that if the move counts of u and v are both
1673         greater than zero then after they are coalesced then one node is
1674         removed from the freeze queue.  Apparently I was thinking that
1675         both u and v are of low degree, but that's clearly not necessarily true.
1676    
1677    
1678    02/12/2002:
1679        Here's the patch.  HOL now compiles.
1680    
1681        I don't know how this impact on performance (compile
1682        time or runtime).  This bug caused the RA (especially on the x86)
1683        to go thru the potential spill phase when there are still nodes on the
1684        freeze queue.
1685    
1686    
1687    
1688    
1689    ----------------------------------------------------------------------
1690    Name: Matthias Blume
1691    Date: 2002/02/13 22:40:00 EST
1692    Tag: blume-20020213-fptr-rtti
1693    Description:
1694    
1695    Fixed a bug in ml-nlffigen that was introduced with one of the previous
1696    updates.
1697    
1698    ----------------------------------------------------------------------
1699    Name: Matthias Blume
1700    Date: 2002/02/13 16:41:00 EST
1701    Tag: blume-20020213-cmlpq
1702    Description:
1703    
1704    Added new priority queue export symbols (which have just been added to
1705    smlnj-lib.cm) to CML's version of smlnj-lib.cm.  (Otherwise CML would
1706    not compile and the installer would choke.)
1707    
1708    ----------------------------------------------------------------------
1709    Name: Matthias Blume
1710    Date: 2002/02/13 16:15:00 EST
1711    Tag: blume-20020213-various
1712    Description:
1713    
1714    1. More tweaks to ml-nlffigen:
1715    
1716       - better internal datastructures (resulting in slight speedup)
1717       - "-match" option requires exact match
1718       - "localized" gensym counters (untagged structs/unions nested within
1719         other structs/unions or within typedefs get a fresh counter; their
1720         tag will be prefixed by a concatenation of their parents' tags)
1721       - bug fixes (related to calculation of transitive closure of types
1722         to be included in the output)
1723    
1724    2. Minor Basis updates:
1725    
1726       - added implementations for List.collate and Option.app
1727    
1728    ----------------------------------------------------------------------
1729    Name: Matthias Blume
1730    Date: 2002/02/11 15:55:00 EST
1731    Tag: blume-20020211-gensym
1732    Description:
1733    
1734    Added a "-gensym" option to command line of ml-nlffigen.  This can be
1735    used to specify a "stem" -- a string that is inserted in all "gensym'd"
1736    names (ML structure names that correspond to unnamed C structs, unions,
1737    and enums), so that separate runs of ml-nlffigen do not clash.
1738    
1739    ----------------------------------------------------------------------
1740    Name: Matthias Blume
1741    Date: 2002/02/11 12:05:00 EST
1742    Tag: blume-20020211-gensml
1743    Description:
1744    
1745    A quick fix for a problem with GenSML (in the pgraph-util library):
1746    Make generation of toplevel "local" optional.  (Strictly speaking,
1747    signature definitions within "local" are not legal SML.)
1748    
1749    Other than that: updates to INSTALL and cm/TODO.
1750    
1751    ----------------------------------------------------------------------
1752    Name: Matthias Blume
1753    Date: 2002/02/08 15:00:00 EST
1754    Tag: blume-20020208-uniquepid
1755    Description:
1756    
1757    0. Version number has been bumped to 110.38.1.  NEW BOOTFILES!!!
1758    
1759    1. The installer (config/install.sh) has gotten smarter:
1760    
1761         - Configuration options are a bit easier to specify now
1762           (in config/targets).
1763         - Bug in recognizing .tar.bz2 files fixed.
1764         - Installer automatically resolves dependencies between
1765           configuration options (e.g., if you ask for eXene, you will
1766           also get cml -- regardless whether you asked for it or not).
1767         - Installer can run in "quieter mode" by setting the environment
1768           variable INSTALL_QUIETLY to "true".  "Quieter" does not mean
1769           "completely silent", though.
1770         - Build HashCons library as part of smlnj-lib.
1771    
1772    2. A new scheme for assigning persistent identifiers to compilation
1773       units (and, by extension, to types etc.) has been put into place.
1774       This fixes a long-standing bug where types and even dynamic values
1775       can get internally confused, thereby compromising type safety
1776       (abstraction) and dynamic correctness.  See
1777    
1778         http://cm.bell-labs.com/cm/cs/who/blume/pid-confusion.tgz
1779    
1780       for an example of how things could go wrong until now.
1781    
1782       The downside of the new scheme is that pids are not quite as
1783       persistent as they used to be: CM will generate a fresh pid
1784       for every compilation unit that it thinks it sees for the first
1785       time.  That means that if you compile starting from a clean, fresh
1786       source tree at two different times, you end up with different
1787       binaries.
1788    
1789       Cutoff recompilation, however, has not been compromised because
1790       CM keeps pid information in special caches between runs.
1791    
1792    ----------------------------------------------------------------------
1793    Name: Lal George
1794    Date: 2002/02/07 15:34:13 EST 2002
1795    Tag: <none>
1796    Description:
1797    
1798    Compilers that generate assembly code may produce  global labels
1799    whose value is resolved at link time. The various peephole optimization
1800    modules did not take this in account.
1801    
1802    TODO. The Labels.addrOf function should really return an option
1803    type so that clients are forced to deal with this issue, rather
1804    than an exception being raised.
1805    
1806    ----------------------------------------------------------------------
1807    Name: Lal George
1808    Date: 2002/02/06 13:55:02 EST
1809    Tag: george-20020206-ra-breakup
1810    Description:
1811    
1812    1. A bug fix from Allen.
1813    
1814        A typo causes extra fstp %st(0)'s to be generated at compensation
1815        edges, which might cause stack underflow traps at runtime.  This
1816        occurs in fft where there are extraneous fstps right before the 'into'
1817        trap instruction (in this case they are harmless since none of the
1818        integers overflow.)
1819    
1820    2. Pulled out various utility modules that were embedded in the modules
1821       of the register allocator. I need these modules for other purposes, but
1822       they are not complete enough to put into a library (just yet).
1823    ----------------------------------------------------------------------
1824    Name: Matthias Blume
1825    Date: 2002/01/31 16:05:00 EST
1826    Tag: blume-20020131-sparc-ccalls
1827    Description:
1828    
1829    1. C-calls on Sparc needlessly allocated a huge chunk (96 bytes)
1830       of extra stack space by mistake.  Fixed.
1831    
1832    2. Bug in logic of handling of command-line options in ml-nlffigen fixed.
1833    
1834    ----------------------------------------------------------------------
1835    Name: Allen Leung
1836    Date: 2002/01/30
1837    Tag: leunga-20020130-nowhere-bug-fix
1838    Description:
1839    
1840       MLRISC bug fixes:
1841       1. Fixed a bindings computation bug in the 'nowhere' program generator tool.
1842       2. MachineInt.fromString was negating its value.
1843    
1844    ----------------------------------------------------------------------
1845    Name: Matthias Blume
1846    Date: 2002/01/29
1847    Tag: blume-20020129-INSTALL
1848    Description:
1849    
1850    - Added somewhat detailed installation instructions (file INSTALL).
1851    - Fixed curl-detection bug in config/install.sh.
1852    - It is now possible to select the URL getter using the URLGETTER
1853      environment variable:
1854    
1855          not set / "unknown"      --> automatic detection (script tries wget,
1856                                       curl, and lynx)
1857          "wget" / "curl" / "lynx" --> use the specified program (script "knows"
1858                                       how to properly invoke them)
1859          other                    --> use $URLGETTER directly, it must take
1860                                       precisely two command-line arguments
1861                                       (source URL and destination file name)
1862    
1863    ----------------------------------------------------------------------
1864    Name: Matthias Blume
1865    Date: 2002/01/28
1866    Tag: blume-20020128-sparc-ccalls
1867    Description:
1868    
1869    - Fixed problem with calculation of "used" registers in sparc-c-calls.
1870    - Make use of the allocParam argument in sparc-c-calls.
1871    
1872    ----------------------------------------------------------------------
1873    Name: Matthias Blume
1874    Date: 2002/01/28
1875    Tag: blume-20020128-allocParam
1876    Description:
1877    
1878    John Reppy:  Changes c-calls API to accept client-callback for
1879    allocating extra stack space.
1880    me: Corresponding changes to mlriscGen (using a dummy argument that
1881        does not change the current behavior).
1882    
1883    ----------------------------------------------------------------------
1884    Name: Matthias Blume
1885    Date: 2002/01/28 12:00:00
1886    Tag: Release_110_38
1887    Description:
1888    
1889    This time for real!!!
1890    
1891    ----------------------------------------------------------------------
1892    Name: Matthias Blume
1893    Date: 2002/01/28 10:56:00 EST
1894    Tag: blume-20020128-retraction
1895    Description:
1896    
1897    0. Retracted earlier 110.38.  (The Release_110_38 tag has been replaced
1898       with blume-Release_110_38-retracted.)
1899    
1900    1. Fixed a problem with incorrect rounding modes in real64.sml.
1901       (Thanks to Andrew Mccreight <andrew.mccreight@yale.edu>.)
1902    
1903    2. A bug in ml-nlffigen related to the handling of unnamed structs, unions,
1904       and enums fixed.  The naming of corresponding ML identifiers should
1905       now be consistent again.
1906    
1907    ----------------------------------------------------------------------
1908    Name: Allen Leung
1909    Date: 2002/01/27
1910    Tag: leunga-20020127-nowhere
1911    Description:
1912    
1913       Added a target called nowhere in the configuration scripts.
1914       Enabling this will build the MLRISC 'nowhere' tool (for translating
1915       programs with where-clauses into legal SML code) during installation.
1916    
1917    ----------------------------------------------------------------------
1918    Name: Matthias Blume
1919    Date: 2002/01/25 21:27:00 EST
1920    Tag: blume-Release_110_38-retracted
1921    Description:
1922    
1923    Call it a (working) release!  Version is 110.38. Bootfiles are ready.
1924    
1925    README will be added later.
1926    
1927    !!! NOTE:  Re-tagged as blume-Release_110_38-retracted. Original tag
1928    (Release_110_38) removed.  Reason: Last-minute bug fixes.
1929    
1930    ----------------------------------------------------------------------
1931    Name: Matthias Blume
1932    Date: 2002/01/25
1933    Tag: blume-20020125-ffi
1934    Description:
1935    
1936    A large number of tweaks and improvements to ml-nlffi-lib and
1937    ml-nlffigen:
1938    
1939       - ML represenation types have been streamlined
1940       - getter and setter functions work with concrete values, not abstract
1941         ones where possible
1942       - ml-nlffigen command line more flexible (see README file there)
1943       - some bugs have been fixed (hopefully)
1944    
1945    ----------------------------------------------------------------------
1946    Name: Lal George
1947    Date: 2002/01/24
1948    Tag: george-20020124-risc-ra-interface
1949    Description:
1950    
1951       There is a dramatic simplification in the interface to the
1952       register allocator for RISC architectures as a result of making
1953       parallel copy instructions explicit.
1954    
1955    ----------------------------------------------------------------------
1956    Name: Matthias Blume
1957    Date: 2002/01/22
1958    Tag: blume-20020122-x86-ccalls
1959    Description:
1960    
1961    Bug fix for c-calls on x86 (having to do with how char- and
1962    short-arguments are being handled).
1963    
1964    ----------------------------------------------------------------------
1965    Name: Matthias Blume
1966    Date: 2002/01/21
1967    Tag: blume-20020121-ff
1968    Description:
1969    
1970    Another day of fiddling with the FFI...
1971    
1972    1. Bug fix/workaround:  CKIT does not complain about negative array
1973       dimensions, so ml-nlffigen has to guard itself against this possibility.
1974       (Otherwise a negative dimension would send it into an infinite loop.)
1975    
1976    2. Some of the abstract types (light objects, light pointers, most "base"
1977       types) in structure C are now eqtypes.
1978    
1979    3. Added constructors and test functions for NULL function pointers.
1980    
1981    ----------------------------------------------------------------------
1982    Name: Matthias Blume
1983    Date: 2002/01/18
1984    Tag: blume-20020118-ready-for-new-release
1985    Description:
1986    
1987    Made config/srcarchiveurl point to a new place.  (Will provide boot
1988    files shortly.)
1989    
1990    Maybe we christen this to be 110.38?
1991    
1992    ----------------------------------------------------------------------
1993    Name: Matthias Blume
1994    Date: 2002/01/18
1995    Tag: blume-20020118-more-ffifiddle
1996    Description:
1997    
1998    Today's FFI fiddling:
1999    
2000      - Provided a structure CGetSet with "convenient" versions of C.Get.* and
2001        C.Set.* that use concrete (MLRep.*) arguments and results instead
2002        of abstract ones.
2003    
2004      - Provided word-style bit operations etc. for "int" representation
2005        types in MLRep.S<Foo>Bitops where <Foo> ranges over Char, Int, Short,
2006        and Long.
2007    
2008    ----------------------------------------------------------------------
2009    Name: Matthias Blume
2010    Date: 2002/01/18
2011    Tag: blume-20020118-use-x86-fp
2012    Description:
2013    
2014    Now that x86-fast-fp seems to be working, I turned it back on again
2015    by default.  (Seems to work fine now, even with the FFI.)
2016    
2017    Other than that, I added some documentation about the FFI to
2018    src/ml-nlffigen/README and updated the FFI test examples in
2019    src/ml-nlffi-lib/Tests/*.
2020    
2021    ----------------------------------------------------------------------
2022    Name: Allen Leung
2023    Date: 2002/01/17
2024    Tag: leunga-20020117-x86-fast-fp-call
2025    Description:
2026    
2027       1. Fixed a problem with handling return fp values when x86's fast fp
2028          mode is turned on.
2029    
2030       2. Minor pretty printing fix for cellset.  Print %st(0) as %st(0) instead
2031          of %f32.
2032    
2033       3. Added a constructor INT32lit to the ast of MLRISC tools.
2034    
2035    ----------------------------------------------------------------------
2036    Name: Matthias Blume
2037    Date: 2002/01/16
2038    Tag: blume-20020116-ffifiddle
2039    Description:
2040    
2041    More fiddling with the FFI interface:
2042    
2043     - Make constness 'c instead of rw wherever possible.  This eliminates
2044       the need for certain explicit coercions.  (However, due to ML's
2045       value polymorphism, there will still be many cases where explicit
2046       coercions are necessary.  Phantom types are not the whole answer
2047       to modeling a subtyping relationship in ML.)
2048    
2049     - ro/rw coersions for pointers added.  (Avoids the detour through */&.)
2050    
2051     - "printf" test example added to src/ml-nlffi-lib/Tests.  (Demonstrates
2052       clumsy workaround for varargs problem.)
2053    
2054    ----------------------------------------------------------------------
2055    Name: Lal George
2056    Date: 2002/01/15
2057    Tag: <none>
2058    Description:
2059    
2060    1. Since COPY instructions are no longer native to the architecture,
2061       a generic functor can be used to implement the expandCopies function.
2062    
2063    2. Allowed EXPORT and IMPORT pseudo-op declarations to appear inside a
2064       TEXT segment.
2065    
2066    ----------------------------------------------------------------------
2067    Name: Matthias Blume
2068    Date: 2002/01/15
2069    Tag: blume-20020115-ffiupdates
2070    Description:
2071    
2072    1. Fix for bug resulting in single-precision float values being returned
2073       incorrectly from FFI calls.
2074    
2075    2. Small modifications to C FFI API:
2076    
2077        - memory-allocation routines return straight objects (no options)
2078          and raise an exception in out-of-memory situations
2079        - unsafe extensions to cast between function pointers and pointers
2080          from/to ints
2081        - added structure C_Debug as an alternative to structure C where
2082          pointer-dereferencing (|*| and |*!) always check for null-pointers
2083        - added open_lib' to DynLinkage;  open_lib' works like open_lib
2084          but also takes a (possibly empty) list of existing library handles
2085          that the current library depends on
2086    
2087    ----------------------------------------------------------------------
2088    Name: Matthias Blume
2089    Date: 2002/01/10
2090    Tag: blume-20020110-newffigen
2091    Description:
2092    
2093    1. Updates to portable graph code.
2094    
2095    2. Major update to ml-nlffigen and ml-nlffi-lib.  Things are much
2096       more scalable now so that even huge interfaces such as the one
2097       for GTK compile in finite time and space. :-)
2098       See src/ml-nlffigen/README for details on what's new.
2099    
2100    ----------------------------------------------------------------------
2101    Name: Lal George
2102    Date: 2001/01/09 14:31:35 EST 2002
2103    Tag: george-20011206-rm-native-copy
2104    Description:
2105    
2106            Removed the native COPY and FCOPY instructions
2107            from all the architectures and replaced it with the
2108            explicit COPY instruction from the previous commit.
2109    
2110            It is now possible to simplify many of the optimizations
2111            modules that manipulate copies. This has not been
2112            done in this change.
2113    
2114    ----------------------------------------------------------------------
2115    Name: Lal George
2116    Date: 2001/12/06 16:50:13 EST 2001
2117    Tag: george-20011206-mlrisc-instruction
2118    Description:
2119    
2120    Changed the representation of instructions from being fully abstract
2121    to being partially concrete. That is to say:
2122    
2123      from
2124            type instruction
2125    
2126      to
2127            type instr                              (* machine instruction *)
2128    
2129            datatype instruction =
2130                LIVE of {regs: C.cellset, spilled: C.cellset}
2131              | KILL of {regs: C.cellset, spilled: C.cellset}
2132              | COPYXXX of {k: CB.cellkind, dst: CB.cell list, src: CB.cell list}
2133              | ANNOTATION of {i: instruction, a: Annotations.annotation}
2134              | INSTR of instr
2135    
2136    This makes the handling of certain special instructions that appear on
2137    all architectures easier and uniform.
2138    
2139    LIVE and KILL say that a list of registers are live or killed at the
2140    program point where they appear. No spill code is generated when an
2141    element of the 'regs' field is spilled, but the register is moved to
2142    the 'spilled' (which is present, more for debugging than anything else).
2143    
2144    LIVE replaces the (now deprecated) DEFFREG instruction on the alpha.
2145    We used to generate:
2146    
2147            DEFFREG f1
2148            f1 := f2 + f3
2149            trapb
2150    
2151    but now generate:
2152    
2153            f1 := f2 + f3
2154            trapb
2155            LIVE {regs=[f1,f2,f3], spilled=[]}
2156    
2157    Furthermore, the DEFFREG (hack) required that all floating point instruction
2158    use all registers mentioned in the instruction. Therefore f1 := f2 + f3,
2159    defines f1 and uses [f1,f2,f3]! This hack is no longer required resulting
2160    in a cleaner alpha implementation. (Hopefully, intel will not get rid of
2161    this architecture).
2162    
2163    COPYXXX is intended to replace the parallel COPY and FCOPY  available on
2164    all the architectures. This will result in further simplification of the
2165    register allocator that must be aware of them for coalescing purposes, and
2166    will also simplify certain aspects of the machine description that provides
2167    callbacks related to parallel copies.
2168    
2169    ANNOTATION should be obvious, and now INSTR represents the honest to God
2170    machine instruction set!
2171    
2172    The <arch>/instructions/<arch>Instr.sml files define certain utility
2173    functions for making porting easier -- essentially converting upper case
2174    to lower case. All machine instructions (of type instr) are in upper case,
2175    and the lower case form generates an MLRISC instruction. For example on
2176    the alpha we have:
2177    
2178      datatype instr =
2179         LDA of {r:cell, b:cell, d:operand}
2180       | ...
2181    
2182      val lda : {r:cell, b:cell, d:operand} -> instruction
2183        ...
2184    
2185    where lda is just (INSTR o LDA), etc.
2186    
2187    ----------------------------------------------------------------------
2188    Name: Matthias Blume
2189    Date: 2001/11/22 21:40:00 EST
2190    Tag: Release_110_37
2191    Description:
2192    
2193    Release 110.37.  This time for real.
2194    
2195    ----------------------------------------------------------------------
2196    Name: Matthias Blume
2197    Date: 2001/11/21 16:35:00 EST
2198    Tag: blume-20011121-foot-in-mouth
2199    Description:
2200    
2201    Removed the "Release_110_37" tag because of a serious bug.
2202    This will be re-tagged once the bug is fixed.
2203    
2204    ----------------------------------------------------------------------
2205    Name: Matthias Blume
2206    Date: 2001/11/21 16:14:00 EST
2207    Tag: blume-20011121-forgottenfile
2208    Description:
2209    
2210    Forgot to add a file.  (Just a .tex-file -- part of
2211    the CM manual source.)
2212    
2213    ----------------------------------------------------------------------
2214    Name: Matthias Blume
2215    Date: 2001/11/21 16:10:00 EST
2216    Tag: blume-20011121-invalid_110_37
2217    Description:
2218    
2219    Note: I removed the original tag "Release_110_37" from this commit
2220          because we found a serious bug in all non-x86 backends.
2221          - Matthias
2222    
2223    1. Modifications to the SML/NJ code generator and to the runtime system
2224       so that code object name strings are directly inserted into code
2225       objects at code generation time.  The only business the runtime system
2226       has with this is now to read the name strings on occasions.
2227       (The encoding of the name string has also changed somewhat.)
2228    
2229    2. CM now implements a simple "set calculus" for specifying export lists.
2230       In particular, it is now possible to refer to the export lists of
2231       other libraries/groups/sources and form unions as well as differences.
2232       See the latest CM manual for details.
2233    
2234    3. An separate notion of "proxy" libraries has again be eliminated from
2235       CM's model.  (Proxy libraries are now simply a special case of using
2236       the export list calculus.)
2237    
2238    4. Some of the existing libraries now take advantage of the new set
2239       calculus.
2240       (Notice that not all libraries have been converted because some
2241       of the existing .cm-files are supposed to be backward compatible
2242       with 110.0.x.)
2243    
2244    5. Some cleanup in stand-alone programs.  (Don't use "exnMessage" -- use
2245       "General.exnMessage"!  The former relies on a certain hook to be
2246       initialized, and that often does not happen in the stand-alone case.)
2247    
2248    ----------------------------------------------------------------------
2249    Name: Lal George
2250    Date: 2001/11/21  13:56:18 EST
2251    Tag: george-2001121-pseudo-ops
2252    Description:
2253    
2254      Implemented a complete redesign of MLRISC pseudo-ops. Now there
2255      ought to never be any question of incompatabilities with
2256      pseudo-op syntax expected by host assemblers.
2257    
2258      For now, only modules supporting GAS syntax are implemented
2259      but more should follow, such as MASM, and vendor assembler
2260      syntax, e.g. IBM as, Sun as, etc.
2261    
2262    ----------------------------------------------------------------------
2263    Name: Matthias Blume
2264    Date: 2001/11/14 11:52:00 EST
2265    Tag: blume-20011114-srcname
2266    Description:
2267    
2268    1. Routed the name of the current source file to mlriscgen where it
2269       should be directly emitted into the code object.  (This last part
2270       is yet to be done.)
2271    
2272    2. Some cleanup of the pgraph code to make it match the proposal that
2273       I put out the other day.  (The proposal notwithstanding, things are
2274       still in flux here.)
2275    
2276    ----------------------------------------------------------------------
2277    Name: Lal George
2278    Date: 2001/11/14 09:44:04 EST
2279    Tag:
2280    Description:
2281    
2282      Fix for a backpatching bug reported by Allen.
2283    
2284      Because the boundary between short and long span-dependent
2285      instructions is +/- 128, there are an astounding number of
2286      span-dependent instructions whose size is over estimated.
2287    
2288      Allen came up with the idea of letting the size of span
2289      dependent instructions be non-monotonic, for a maxIter
2290      number of times, after which the size must be monotonically
2291      increasing.
2292    
2293      This table shows the number of span-dependent instructions
2294      whose size was over-estimated as a function of maxIter, for the
2295      file Parse/parse/ml.grm.sml:
2296    
2297         maxIter            # of instructions:
2298            10                      687
2299            20                      438
2300            30                      198
2301            40                        0
2302    
2303      In compiling the compiler, there is no significant difference in
2304      compilation speed between maxIter=10 and maxIter=40. Actually,
2305      my measurements showed that maxIter=40 was a tad faster than
2306      maxIter=10! Also 96% of the  files in the compiler reach a fix
2307      point within 13 iterations, so fixing maxIter at 40, while high,
2308      is okay.
2309    
2310    ----------------------------------------------------------------------
2311    Name: Matthias Blume
2312    Date: 2001/10/31 15:25:00 EST
2313    Tag: blume-20011031-pgraph
2314    Description:
2315    
2316    CKIT:
2317    * Changed the "Function" constructor of type Ast.ctype to carry optional
2318      argument identifiers.
2319    * Changed the return type of TypeUtil.getFunction accordingly.
2320    * Type equality ignores the argument names.
2321    * TypeUtil.composite tries to preserve argument names but gives up quickly
2322      if there is a mismatch.
2323    
2324    installation script:
2325    * attempts to use "curl" if available (unless "wget" is available as well)
2326    
2327    CM:
2328    * has an experimental implementation of "portable graphs" which I will
2329      soon propose as an implementation-independent library format
2330    * there are also new libraries $/pgraph.cm and $/pgraph-util.cm
2331    
2332    NLFFI-LIB:
2333    * some cleanup (all cosmetic)
2334    
2335    NLFFIGEN:
2336    * temporarily disabled the mechanism that suppresses ML output for
2337      C definitions whose identifiers start with an underscore character
2338    * generate val bindings for enum constants
2339    * user can request that only one style (light or heavy) is being used;
2340      default is to use both (command-line arguments: -heavy and -light)
2341    * fixed bug in handling of function types involving incomplete pointers
2342    * generate ML entry points that take record arguments (i.e., using
2343      named arguments) for C functions that have a prototype with named
2344      arguments
2345      (see changes to CKIT)
2346    
2347    ----------------------------------------------------------------------
2348    Name: Allen Leung
2349    Date: 2001/10/27 20:34:00 EDT
2350    Tag: leunga-20011027-x86-fast-fp-call
2351    Description:
2352    
2353       Fixed the bug described in blume-20010920-slowfp.
2354    
2355       The fix involves
2356          1. generating FCOPYs in FSTP in ia32-svid
2357          2. marking a CALL with the appropriate annotation
2358    
2359    ----------------------------------------------------------------------
2360    Name: Matthias Blume
2361    Date: 2001/10/16 11:32:00 EDT
2362    Tag: blume-20011016-netbsd
2363    Description:
2364    
2365    Underscore patch from Chris Richards (fixing problem with compiling
2366    runtime system under recent NetBSD).
2367    
2368    ----------------------------------------------------------------------
2369    Name: Allen Leung
2370    Date: 2001/10/12 17:18:32 EDT 2001
2371    Tag: leung-20011012-x86-printflowgraph
2372    Description:
2373    
2374    X86RA now uses a valid (instead of dummy) PrintFlowgraph module.
2375    
2376    ----------------------------------------------------------------------
2377    Name: Lal George
2378    Date: 2001/10/11 23:51:34 EDT
2379    Tag: george-20011011-too-many-instrs
2380    Description:
2381    
2382    The representation of a program point never expected to see more
2383    than 65536 instructions in a basic block!
2384    
2385    ----------------------------------------------------------------------
2386    Name: Lal George
2387    Date: 2001/10/09 09:41:37 EDT
2388    Tag: george-20011008-mlrisc-labels
2389    Description:
2390    
2391    Changed the machine description files to support printing of
2392    local and global labels in assembly code, based on host assembler
2393    conventions.
2394    
2395    ----------------------------------------------------------------------
2396    Name: Matthias Blume
2397    Date: 2001/09/25 15:25:00 EDT
2398    Tag: blume-20010925-exninfo
2399    Description:
2400    
2401    I provided a non-hook implementation of exnName (at the toplevel) and
2402    made the "dummy" implementation of exnMessage (at the toplevel) more
2403    useful: if nothing gets "hooked in", then at least you are going to
2404    see the exception name and a message indicating why you don't see more.
2405    
2406    [For the time being, programs that need exnMessage and want to use
2407    ml-build should either use General.exnMessage (strongly recommended) or
2408    refer to structure General at some other point so that CM sees a
2409    static dependency.]
2410    
2411    [Similar remarks go for "print" and "use":  If you want to use their
2412    functionality in stand-alone programs generated by ml-build, then use
2413    TextIO.output and Backend.Interact.useFile (from $smlnj/compiler.cm).]
2414    
2415    ----------------------------------------------------------------------
2416    Name: Matthias Blume
2417    Date: 2001/09/20 17:28:00 EDT
2418    Tag: blume-20010920-slowfp
2419    Description:
2420    
2421    Allen says that x86-fast-fp is not safe yet, so I turned it off again...
2422    
2423    ----------------------------------------------------------------------
2424    Name: Matthias Blume
2425    Date: 2001/09/20 17:20:00 EDT
2426    Tag: blume-20010920-canonicalpaths
2427    Description:
2428    
2429    0. Updated the BOOT file (something that I forgot to do earlier).
2430    
2431    1. Small internal change to CM so that it avoids "/../" in filenames
2432       as much as possible (but only where it is safe).
2433    
2434    2. Changed config/_run-sml (resulting in a changed bin/.run-sml) so
2435       that arguments that contain delimiters are passed through correctly.
2436       This change also means that all "special" arguments of the form
2437       @SMLxxx... must come first.
2438    
2439    3. Changed install script to put relative anchor names for tool commands
2440       into pathconfig.
2441    
2442    ----------------------------------------------------------------------
2443    Name: Matthias Blume
2444    Date: 2001/09/18 15:35:00 EDT
2445    Tag: blume-20010918-readme11036
2446    Description:
2447    
2448    Added README files.
2449    
2450    ----------------------------------------------------------------------
2451    Name: Matthias Blume
2452    Date: 2001/09/18 11:45:00 EDT
2453    Tag: Release_110_36 (retag)
2454    Description:
2455    
2456    Fixed mistake in config/preloads. Retagged as 110.36.
2457    
2458    ----------------------------------------------------------------------
2459    Name: Matthias Blume
2460    Date: 2001/09/18 09:40:00 EDT
2461    Tag: Release_110_36_orig (tag changed)
2462    Description:
2463    
2464    New version (110.36).  New bootfiles.
2465    
2466    ----------------------------------------------------------------------
2467    Name: Matthias Blume
2468    Date: 2001/09/14 16:15:00 EDT
2469    Tag: blume-20010914-x86fastfp
2470    Description:
2471    
2472    John committed some changes that Allen made, in particular a (hopefully)
2473    correctly working version of the x86-fp module.
2474    
2475    I changed the default setting of the Control.MLRISC.getFlag "x86-fast-fp"
2476    flag to "true".  Everything seems to compile to a fixpoint ok, and
2477    "mandelbrot" speeds up by about 15%.
2478    
2479    ----------------------------------------------------------------------
2480    Name: Matthias Blume
2481    Date: 2001/09/13 11:20:00 EDT
2482    Tag: blume-20010913-minimal
2483    Description:
2484    
2485    1. Stefan Monnier's patch to fix a miscompilation problem that
2486       was brought to light by John Reppy's work on Moby.
2487    
2488    2. Implemented a minimal "structure Compiler" that contains just
2489       "version" and "architecture".  The minimal version will be
2490       available when the full version is not.  This is for backward-
2491       compatibility with code that wants to test Compiler.version.
2492    
2493    ----------------------------------------------------------------------
2494    Name: Matthias Blume
2495    Date: 2001/08/28 14:03:00 EDT
2496    Tag: blume-20010828-ml-lex
2497    Description:
2498    
2499    Fix for bug 1581, received from Neophytos Michael.
2500    
2501    ----------------------------------------------------------------------
2502    Name: Matthias Blume
2503    Date: 2001/08/27 11:20:00 EDT
2504    Tag: blume-20010827-readme11035
2505    Description:
2506    
2507    Fleshed out the README file for 110.35.
2508    
2509    ----------------------------------------------------------------------
2510    Name: Matthias Blume
2511    Date: 2001/08/24 17:10:00 EDT
2512    Tag: Release_110_35
2513    Description:
2514    
2515    New version number (110.35).  New bootfiles.
2516    
2517    ----------------------------------------------------------------------
2518    Name: Lal George
2519    Date: 2001/08/24 13:47:18 EDT 2001
2520    Tag: george-20010824-MLRISC-graphs
2521    Description:
2522    
2523     removed clusters from MLRISC completely and replaced with graphs.
2524    
2525    ----------------------------------------------------------------------
2526    Name: Matthias Blume
2527    Date: 2001/08/23 17:50:00 EDT
2528    Tag: blume-20010823-toplevel
2529    Description:
2530    
2531    - some reorganization of the code that implements various kinds of
2532      environments in the compiler (static, dynamic, symbolic, combined)
2533    - re-implemented the EnvRef module so that evalStream works properly
2534      (if the stream contains references to "use", "CM.make", etc.)
2535    - cleaned up evalloop.sml and interact.sml (but they need more cleaning)
2536    
2537    ----------------------------------------------------------------------
2538    Name: Matthias Blume
2539    Date: 2001/08/20 15:50 EDT
2540    Tag: blume20010820-slipup
2541    Description:
2542    
2543    I forgot to commit a few files.  Here they are...
2544    
2545    ----------------------------------------------------------------------
2546    Name: Matthias Blume
2547    Date: 2001/08/20 15:35:00 EDT
2548    Tag: blume-20010820-debugprof
2549    Description:
2550    
2551    !!!! NEW BOOTFILES !!!!
2552    
2553    This is another round of reorganizing the compiler sources.  This
2554    time the main goal was to factor out all the "instrumentation"
2555    passes (for profiling and backtracing) into their own library.
2556    The difficulty was to do it in such a way that it does not depend
2557    on elaborate.cm but only on elabdata.cm.
2558    
2559    Therefore there have been further changes to both elaborate.cm and
2560    elabdata.cm -- more "generic" things have been moved from the former
2561    to the latter.  As a result, I was forced to split the assignment
2562    of numbers indicating "primtyc"s into two portions: SML-generic and
2563    SML/NJ-specific.  Since it would have been awkward to maintain,
2564    I bit the bullet and actually _changed_ the mapping between these
2565    numbers and primtycs.  The bottom line of this is that you need
2566    a new set of bin- and bootfiles.
2567    
2568    I have built new bootfiles for all architectures, so doing a fresh
2569    checkout and config/install.sh should be all you need.
2570    
2571    The newly created library's name is
2572    
2573        $smlnj/viscomp/debugprof.cm
2574    
2575    and its sources live under
2576    
2577        src/compiler/DebugProf
2578    
2579    ----------------------------------------------------------------------
2580    Name: Matthias Blume
2581    Date: 2001/08/15 17:15:00 EDT
2582    Tag: blume-20010815-compreorg
2583    Description:
2584    
2585    This is a first cut at reorganizing the CM libraries that make up the
2586    core of the compiler.  The idea is to separate out pieces that could
2587    be used independently by tools, e.g., the parser, the typechecker, etc.
2588    
2589    The current status is a step in this direction, but it is not quite
2590    satisfactory yet.  Expect more changes in the future.
2591    
2592    Here is the current (new) organization...
2593    
2594        What used to be $smlnj/viscomp/core.cm is now divided into
2595        six CM libraries:
2596    
2597             $smlnj/viscomp/basics.cm
2598                           /parser.cm
2599                           /elabdata.cm
2600                           /elaborate.cm
2601                           /execute.cm
2602                           /core.cm
2603    
2604        The CM files for these libraries live under src/system/smlnj/viscomp.
2605        All these libraries are proxy libraries that contain precisely
2606        one CM library component.  Here are the locations of the components
2607        (all within the src/compiler tree):
2608    
2609             Basics/basics.cm
2610             Parse/parser.cm
2611             ElabData/elabdata.cm
2612             Elaborator/elaborate.cm
2613             Execution/execute.cm
2614             core.cm
2615    
2616         [This organization is the same that has been used already
2617         for a while for the architecture-specific parts of the visible
2618         compiler and for the old version of core.cm.]
2619    
2620         As you will notice, many source files have been moved from their
2621         respective original locations to a new home in one of the above
2622         subtrees.
2623    
2624         The division of labor between the new libraries is the following:
2625    
2626             basics.cm:
2627                - Simple, basic definitions that pertain to many (or all) of
2628                  the other libraries.
2629             parser.cm:
2630                - The SML parser, producing output of type Ast.dec.
2631                - The type family for Ast is also defined and exported here.
2632             elabdata.cm:
2633                - The datatypes that describe input and output of the elaborator.
2634                  This includes types, absyn, and static environments.
2635             elaborator.cm:
2636                - The SML/NJ type checker and elaborator.
2637                  This maps an Ast.dec (with a given static environment) to
2638                  an Absyn.dec (with a new static environment).
2639                - This libraries implements certain modules that used to be
2640                  structures as functors (to remove dependencies on FLINT).
2641             execute.cm:
2642                - Everything having to do with executing binary code objects.
2643                - Dynamic environments.
2644             core.cm:
2645                - SML/NJ-specific instantiations of the elaborator and MLRISC.
2646                - Top-level modules.
2647                - FLINT (this should eventually become its own library)
2648    
2649    Notes:
2650    
2651    I am not 100% happy with the way I separated the elaborator (and its
2652    data structures) from FLINT.  Two instances of the same problem:
2653    
2654        1. Data structures contain certain fields that carry FLINT-specific
2655           information.  I hacked around this using exn and the property list
2656           module from smlnj-lib.  But the fact that there are middle-end
2657           specific fields around at all is a bit annoying.
2658    
2659        2. The elaborator calculates certain FLINT-related information.  I tried
2660           to make this as abstract as I could using functorization, but, again,
2661           the fact that the elaborator has to perform calculations on behalf
2662           of the middle-end at all is not nice.
2663    
2664        3. Having to used exn and property lists is unfortunate because it
2665           weakens type checking.  The other alternative (parameterizing
2666           nearly *everything*) is not appealing, though.
2667    
2668    I removed the "rebinding =" warning hack because due to the new organization
2669    it was awkward to maintain it.  As a result, the compiler now issues some of
2670    these warnings when compiling init.cmi during bootstrap compilation. On
2671    the plus side, you also get a warning when you do, for example:
2672       val op = = Int32.+
2673    which was not the case up to now.
2674    
2675    I placed "assign" and "deref" into the _Core structure so that the
2676    code that deals with the "lazy" keyword can find them there.  This
2677    removes the need for having access to the primitive environment
2678    during elaboration.
2679    
2680    ----------------------------------------------------------------------
2681    Name: Matthias Blume
2682    Date: 2001/08/13
2683    Tag: blume-20010813-closures
2684    Description:
2685    
2686    This fix was sent to us by Zhong Shao.  It is supposed to improve the
2687    performance of certain loops by avoiding needless closure allocation.
2688    
2689    ----------------------------------------------------------------------
2690    Name: Lal George
2691    Date: 2001/07/31 10:03:23 EDT 2001
2692    Tag: george-20010731-x86-fmalloc
2693    Description: Fixed bug in x86 calls
2694    
2695        There was a bug where call instructions would mysteriously
2696        vanish. The call instruction had to be one that returned
2697        a floating point value.
2698    
2699    ----------------------------------------------------------------------
2700    Name: Lal George
2701    Date: 2001/07/19 16:36:29 EDT 2001
2702    Tag: george-20010719-simple-cells
2703    Description:
2704    
2705    I have dramatically simplified the interface for CELLS in MLRISC.
2706    
2707    In summary, the cells interface is broken up into three parts:
2708    
2709      1. CellsBasis : CELLS_BASIS
2710    
2711            CellsBasis is a top level structure and common for all
2712            architectures.  it contains the definitions of basic datatypes
2713            and utility  functions over these types.
2714    
2715      2. functor Cells() : CELLS
2716    
2717            Cells generates an interface for CELLS that incorporates the
2718            specific resources on the target architecture, such as the
2719            presence of special register classes, their number and size,
2720            and various useful substructures.
2721    
2722      3. <ARCH>CELLS
2723    
2724            e.g. SparcCells: SPARCCELLS
2725    
2726            <ARCH>CELLS usually contains additional bindings for special
2727            registers  on the architecture, such as:
2728    
2729                    val r0 : cell           (* register zero *)
2730                    val y : cell            (* Y register *)
2731                    val psr : cell          (* processor status register *)
2732                    ...
2733    
2734            The structure returned by applying the Cells functor is opened
2735            in this interface.
2736    
2737    The main implication of all this is that the datatypes for cells is
2738    split between CellsBasis and CELLS -- a fairly simple change for user
2739    code.
2740    
2741    In the old scheme the CELLS interface had a definitional binding of
2742    the form:
2743    
2744            signature CELLS = sig
2745    
2746               structure CellsBasis = CellsBasis
2747    
2748               ...
2749    
2750            end
2751    
2752    With all the sharing constraints that goes on in MLRISC, this old
2753    design  quickly leads to errors such as:
2754    
2755            "structure definition spec inside of sharing ... "
2756    
2757    
2758    and appears to require an unacceptable amount of sharing and where
2759    constraint hackery.
2760    
2761    I think this error message (the interaction of definitional specs and
2762    sharing) requires more explanation on our web page.
2763    
2764    ----------------------------------------------------------------------
2765    Name: Matthias Blume
2766    Date: 2001/07/19 15:00:00 EDT
2767    Tag: blume-20010719-libreorg
2768    Description:
2769    
2770    This update puts together a fairly extensive but straightforward change
2771    to the way the libraries that implement the interactive system are
2772    organized:
2773    
2774       The biggest change is the elimination of structure Compiler.  As a
2775       replacement for this structure, there is now a CM library
2776       (known as $smlnj/compiler.cm or $smlnj/compiler/current.cm)
2777       that exports all the substructures of the original structure Compiler
2778       directly.  So instead of saying Compiler.Foo.bar one now simply
2779       says Foo.bar.  (The CM libraries actually export a collection of
2780       structures that is richer than the collection of substructures of
2781       structure Compiler.)
2782    
2783       To make the transition smooth, there is a separate library called
2784       $smlnj/compiler/compiler.cm which puts together and exports the
2785       original structure Compiler (or at least something very close to it).
2786    
2787       There are five members of the original structure Compiler
2788       that are not exported directly but which instead became members
2789       of a new structure Backend (described by signature BACKEND).  These are:
2790       structure Profile (: PROFILE), structure Compile (: COMPILE), structure
2791       Interact (: INTERACT), structure Machine (: MACHINE), and val
2792       architecture (: string).
2793    
2794       Structure Compiler.Version has become structure CompilerVersion.
2795    
2796       Cross-compilers for alpha32, hppa, ppc, sparc, and x86 are provided
2797       by $smlnj/compiler/<arch>.cm where <arch> is alpha32, hppa, ppc, sparc,
2798       or x86, respectively.
2799       Each of these exports the same frontend structures that
2800       $smlnj/compiler.cm exports.  But they do not have a structure Backend
2801       and instead export some structure <Arch>Backend where <Arch> is Alpha32,
2802       Hppa, PPC, Sparc, or X86, respectively.
2803    
2804       Library $smlnj/compiler/all.cm exports the union of the exports of
2805       $smlnj/compiler/<arch>.cm
2806    
2807       There are no structures <Arch>Compiler anymore, use
2808       $smlnj/compiler/<arch>.cm instead.
2809    
2810       Library host-compiler-0.cm is gone.  Instead, the internal library
2811       that instantiates CM is now called cm0.cm.  Selection of the host
2812       compiler (backend) is no longer done here but. (Responsibility for it
2813       now lies with $smlnj/compiler/current.cm.  This seems to be more
2814       logical.)
2815    
2816       Many individual files have been moved or renamed.  Some files have
2817       been split into multiple files, and some "dead" files have been deleted.
2818    
2819    Aside from these changes to library organization, there are also changes
2820    to the way the code itself is organized:
2821    
2822       Structure Binfile has been re-implemented in such a way that it no
2823       longer needs any knowledge of the compiler.  It exclusively deals
2824       with the details of binfile layout.  It no longer invokes the
2825       compiler (for the purpose of creating new prospective binfile
2826       content), and it no longer has any knowledge of how to interpret
2827       pickles.
2828    
2829       Structure Compile (: COMPILE) has been stripped down to the bare
2830       essentials of compilation.  It no longer deals with linking/execution.
2831       The interface has been cleaned up considerably.
2832    
2833       Utility routines for dealing with linking and execution have been
2834       moved into their own substructures.
2835    
2836       (The ultimate goal of these changes is to provide a light-weight
2837       binfile loader/linker (at least for, e.g., stable libraries) that
2838       does not require CM or the compiler to be present.)
2839    
2840    CM documentation has been updated to reflect the changes to library
2841    organization.
2842    
2843    ----------------------------------------------------------------------
2844    Name: Matthias Blume
2845    Date: 2001/07/10 17:30:00 EDT
2846    Tag: Release_110_34
2847    Description:
2848    
2849    Minor tweak to 110.34 (re-tagged):
2850    
2851      - README.html file added to CVS repository
2852      - runtime compiles properly under FreeBSD 3.X and 4.X
2853    
2854    ----------------------------------------------------------------------
2855    Name: Matthias Blume
2856    Date: 2001/07/10 17:30:00 EDT
2857    Tag: Release_110_34
2858    Description:
2859    
2860    New version number (110.34). New bootfiles.
2861    
2862    ----------------------------------------------------------------------
2863    Name: Matthias Blume
2864    Date: 2001/07/09 16:00:00 EDT
2865    Tag: blume-20010709-more-varargs
2866    Description:
2867    
2868    I changed the handling of varargs in ml-nlffigen again:
2869    The ellipsis ... will now simply be ignored (with an accompanying warning).
2870    
2871    The immediate effect is that you can actually call a varargs function
2872    from ML -- but you can't actually supply any arguments beyond the ones
2873    specified explicitly.  (For example, you can call printf with its format
2874    string, but you cannot pass additional arguments.)
2875    
2876    This behavior is only marginally more useful than the one before, but
2877    it has the advantage that a function or, more importantly, a function
2878    type never gets dropped on the floor, thus avoiding follow-up problems with
2879    other types that refer to the offending one.
2880    
2881    ----------------------------------------------------------------------
2882    Name: Matthias Blume
2883    Date: 2001/07/09 11:25:00 EDT
2884    Tag: blume-20010709-varargs
2885    Description:
2886    
2887    1. ckit-lib.cm now exports structure Error
2888    2. ml-nlffigen reports occurences of "..." (i.e., varargs function types)
2889       with a warning accompanied by a source location.  Moreover, it
2890       merely skips the offending function or type and proceeds with the
2891       rest of its work.u  As a result, one can safely feed C code containing
2892       "..." to ml-nlffigen.
2893    3. There are some internal improvements to CM, providing slightly
2894       more general string substitutions in the tools subsystem.
2895    
2896    ----------------------------------------------------------------------
2897    Name: Matthias Blume
2898    Date: 2001/06/27 15:10:00 EDT
2899    Tag: blume-20010627-concur
2900    Description:
2901    
2902    Fixed a small bug in CM's handling of parallel compilation.
2903    (You could observe the bug by Control-C-interrupting an ordinary
2904    CMB.make or CM.stabilize and then attaching some compile servers.
2905    The result was that all of a sudden the previously interrupted
2906    compilation would continue on its own.  This was because of
2907    an over-optimization: CM did not bother to clean out certain queues
2908    when no servers were attached "anyway", resulting in the contents
2909    of these queues to grab control when new servers did get attached.)
2910    
2911    There is also another minor update to the CM manual.
2912    
2913    ----------------------------------------------------------------------
2914    Name: Matthias Blume
2915    Date: 2001/06/26 16:15:00 EDT
2916    Tag: blume-20010626-cmdoc
2917    Description:
2918    
2919    Minor typo fixed in CM manual (syntax diagram for libraries).
2920    
2921    ----------------------------------------------------------------------
2922    Name: Matthias Blume
2923    Date: 2001/06/25 22:55:00 EDT
2924    Tag: blume-20010625-x86pc
2925    Description:
2926    
2927    Fixed a nasty bug in the X86 assembly code that caused signal
2928    handlers to fail (crash) randomly.
2929    
2930    ----------------------------------------------------------------------
2931    Name: Matthias Blume
2932    Date: 2001/06/25 12:05:00 EDT
2933    Tag: blume-20010625-nlffigen
2934    Description:
2935    
2936    This update fixes a number of minor bugs in ml-nlffigen as reported by
2937    Nick Carter <nbc@andrew.cmu.edu>.
2938    
2939      1. Silly but ok typedefs of the form "typedef void myvoid;" are now accepted.
2940      2. Default names for generated files are now derived from the name of
2941         the C file *without its directory*.  In particular, this causes generated
2942         files to be placed locally even if the C file is in some system directory.
2943      3. Default names for generated signatures and structures are also derived
2944         from the C file name without its directory.  This avoids silly things
2945         like "structure GL/GL".
2946         (Other silly names are still possible because ml-nlffigen does not do
2947          a thorough check of whether generated names are legal ML identifiers.
2948          When in doubt, use command line arguments to force particular names.)
2949    
2950    ----------------------------------------------------------------------
2951    Name: Matthias Blume
2952    Date: 2001/06/21 12:25:00 EDT
2953    Tag: blume-20010621-eXene
2954    Description:
2955    
2956    eXene now compiles and (sort of) works again.
2957    
2958    The library name (for version > 110.33) is $/eXene.cm.
2959    
2960    I also added an new example in src/eXene/examples/nbody.  See the
2961    README file there for details.
2962    
2963    ----------------------------------------------------------------------
2964    Name: Matthias Blume
2965    Date: 2001/06/20 16:40:00 EDT
2966    Tag: blume-20010620-cml
2967    Description:
2968    
2969    CML now compiles and works again.
2970    
2971    Libraries (for version > 110.33):
2972    
2973      $cml/cml.cm            Main CML library.
2974      $cml/basis.cm          CML's version of $/basis.cm.
2975      $cml/cml-internal.cm   Internal helper library.
2976      $cml/core-cml.cm       Internal helper library.
2977      $cml-lib/trace-cml.cm  Tracing facility.
2978      $cml-lib/smlnj-lib.cm  CML's version of $/smlnj-lib.cm
2979    
2980    The installer (config/install.sh) has been taught how to properly
2981    install this stuff.
2982    
2983    ----------------------------------------------------------------------
2984    Name: Matthias Blume
2985    Date: 2001/06/19 17:55:00 EDT
2986    Tag: blume-20010619-instantiate
2987    Description:
2988    
2989    This un-breaks the fix for bug 1432.
2990    (The bug was originally fixed in 110.9 but I broke it again some
2991    time after that.)
2992    
2993    ----------------------------------------------------------------------
2994    Name: Matthias Blume
2995    Date: 2001/06/19 17:25:00 EDT
2996    Tag: blume-20010619-signals
2997    Description:
2998    
2999    This should (hopefully) fix the long-standing signal handling bug.
3000    (The runtime system was constructing a continuation record with an
3001    incorrect descriptor which would cause the GC to drop data on the floor...)
3002    
3003    ----------------------------------------------------------------------
3004    Name: Matthias Blume
3005    Date: 2001/06/15 15:05:00 EDT
3006    Tag: blume-20010615-moresparc
3007    Description:
3008    
3009    Here is a short late-hour update related to Sparc c-calls:
3010    
3011     -- made handling of double-word arguments a bit smarter
3012    
3013     -- instruction selection phase tries to collapse certain clumsily
3014        constructed ML-Trees; typical example:
3015    
3016            ADD(ty,ADD(_,e,LI d1),LI d2)  ->  ADD(ty,e,LI(d1+d2))
3017    
3018        This currently has no further impact on SML/NJ since mlriscGen does
3019        not seem to generate such patterns in the first place, and c-calls
3020        (which did generate them in the beginning) has meanwhile been fixed
3021        so as to avoid them as well.
3022    
3023    ----------------------------------------------------------------------
3024    Name: Matthias Blume
3025    Date: 2001/06/15 15:05:00 EDT
3026    Tag: blume-20010615-sparc
3027    Description:
3028    
3029    The purpose of this update is to provide an implementation of NLFFI
3030    on Sparc machines.
3031    
3032    Here are the changes in detail:
3033    
3034       * src/MLRISC/sparc/c-calls/sparc-c-calls.sml is a new file containing
3035       the Sparc implementation of the c-calls API.
3036       * The Sparc backend of SML/NJ has been modified to uniformely use %fp
3037       for accessing the ML frame.  Thus, we have a real frame pointer and
3038       can freely modify %sp without need for an omit-frame-ptr phase.
3039       The vfp logic in src/compiler/CodeGen/* has been changed to accomodate
3040       this case.
3041       * ml-nlffigen has been taught to produce code for different architectures
3042       and calling conventions.
3043       * In a way similar to what was done in the x86 case, the Sparc
3044       backend uses its own specific extension to mltree.  (For example,
3045       it needs to be able to generate UNIMP instructions which are part
3046       of the calling convention.)
3047       * ml-nlffi-lib was reorganized to make it more modular (in particular,
3048       to make it easier to plug in new machine- and os-dependent parts).
3049    
3050    There are some other fairly unrelated bug fixes and cleanups as well:
3051    
3052       * I further hacked the .cm files for MLRISC tools (like MDLGen) so
3053       that they properly share their libraries with existing SML/NJ libraries.
3054       * I fixed a minor cosmetic bug in CM, supressing certain spurious
3055       follow-up error messages.
3056       * Updates to CM/CMB documentation.
3057    
3058    TODO items:
3059    
3060       * MLRISC should use a different register as its asmTemp on the Sparc.
3061         (The current %o2 is a really bad choice because it is part of the
3062         calling conventions, so things might interfere in unexpected ways.)
3063    
3064    ----------------------------------------------------------------------
3065    Name: Matthias Blume
3066    Date: 2001/06/07
3067    Tag: blume-20010607-calls
3068    Description:
3069    
3070    A number of internal changes related to C calls and calling conventions:
3071    
3072    1. ML-Tree CALL statements now carry a "pops" field.  It indicates the
3073       number of bytes popped implicitly (by the callee).  In most cases
3074       this field is 0 but on x86/win32 it is some non-zero value.  This
3075       is information provided for the benefit of the "omit-frameptr" pass.
3076    2. The CALL instruction on the x86 carries a similar "pops" field.
3077       The instruction selection phase copies its value from the ML-Tree
3078       CALL statement.
3079    3. On all other architectures, the instruction selection phase checks
3080       whether "pops=0" and complains if not.
3081    4. The c-calls implementation for x86 now accepts two calling conventions:
3082       "ccall" and "stdcall".  When "ccall" is selected, the caller cleans
3083       up after the call and pops is set to 0.  For "stdcall", the caller
3084       does nothing, leaving the cleanup to the callee; pops is set to
3085       the number of bytes that were pushed onto the stack.
3086    5. The cproto decoder (compiler/Semant/types/cproto.sml) now can
3087       distinguish between "ccall" and "stdcall".
3088    6. The UNIMP instruction has been added to the supported Sparc instruction
3089       set. (This is needed for implementing the official C calling convention
3090       on this architecture.)
3091    7. I fixed some of the .cm files under src/MLRISC/Tools to make them
3092       work with the latest CM.
3093    
3094    ----------------------------------------------------------------------
3095    Name: Matthias Blume
3096    Date: 2001/06/05 15:10:00 EDT
3097    Tag: blume-20010605-cm-index
3098    Description:
3099    
3100    0. The "lambdasplit" parameter for class "sml" in CM has been documented.
3101    
3102    1. CM can now generate "index files".  These are human-readable files
3103       that list on a per-.cm-file basis each toplevel symbol defined or
3104       imported.  The location of the index file for
3105       <p>/<d>.cm is <p>/CM/INDEX/<d>.cm.
3106       To enable index-file generation, set CM.Control.generate_index to true
3107       or export an environment-symbol: export CM_GENERATE_INDEX=true.
3108    
3109       The CM manual has been updated accordingly.
3110    
3111    2. I made some slight modifications to the c-calls API in MLRISC.
3112    
3113         a) There is now a callback to support saving/restoring of
3114            dedicated but caller-save registers around the actual call
3115            instruction.
3116         b) One can optionally specify a comment-annotation for the
3117            call instruction.
3118    
3119    3. SML/NJ (mlriscGen.sml) uses this new API for the rawccall primop.
3120       (For example, the comment annotation shows the C prototype of
3121        the function being called.)
3122    
3123    ----------------------------------------------------------------------
3124    Name: Matthias Blume
3125    Date: 2001/06/01 13:30:00 EDT
3126    Tag: blume-20010601-nlffi-cleanup
3127    Description:
3128    
3129    This is mostly a cleanup of MLFFI stuff:
3130    
3131       - some signature files have been put into a more exposed place
3132       - the ugly 'f type parameter is gone (simplifies types tremendously!)
3133       - ml-nlffigen changed accordingly
3134       - tutorial updated
3135    
3136    Other changes:
3137    
3138       - author's affiliation in CM manual(s) updated
3139       - some more recognized keywords added to Allen's sml.sty
3140    
3141    ----------------------------------------------------------------------
3142    Name: Matthias Blume
3143    Date: 2001/05/25 15:30:00 EDT
3144    Tag: blume-20010525-iptr
3145    Description:
3146    
3147      - put the official 110.33-README (as it appears on the ftp server) under
3148        CVS
3149      - fixed a small bug related to incomplete pointer types in
3150        ml-nlffigen
3151      - small cosmetic change to the ml-nlffi-lib's "arr" type constructor
3152        (it does not need the 'f type parameter)
3153    
3154    ----------------------------------------------------------------------
3155    Name: Matthias Blume
3156    Date: 2001/05/23 14:30:00 EDT
3157    Tag: Release_110_33
3158    Description:
3159    
3160    New version number (110.33).  New bootfiles.
3161    
3162    ----------------------------------------------------------------------
3163    Name: Matthias Blume
3164    Date: 2001/05/22 18:06:00 EDT
3165    Tag: blume-20010522-targets
3166    Description:
3167    
3168    Made install.sh use file config/targets.customized if it exists, falling
3169    back to config/targets if it doesn't.  This way one can have a customized
3170    version of the targets file without touching the "real thing", thus
3171    eliminating the constant fear of accidentally checking something bogus
3172    back into the CVS repository...  (File config/targets.customized must
3173    not be added to the repository!)
3174    
3175    ----------------------------------------------------------------------
3176    Name: Matthias Blume
3177    Date: 2001/05/22 16:30:00 EDT
3178    Tag: blume-20010522-minitut
3179    Description:
3180    
3181    1. Bug fix in ml-nlffigen; now (hopefully) correctly handling
3182       struct returns.
3183    2. Added src/ml-nlffi-lib/Doc/mini-tutorial.txt.  This is some very
3184       incomplete, preliminary documentation for NLFFI.
3185    
3186    ----------------------------------------------------------------------
3187    Name: Matthias Blume
3188    Date: 2001/05/14 11:30:00 EDT
3189    Tag: blume-20010514-script
3190    Description:
3191    
3192    Some bugs in install script fixed.
3193    
3194    In addition to that I also made a slight change to the NLFFI API:
3195    Functors generated by ml-nlffigen now take the dynamic library as a
3196    straight functor argument, not as a suspended one.  (The original
3197    functor code used to force the suspension right away anyway, so there
3198    was nothing gained by this complication of the interface.)
3199    
3200    ----------------------------------------------------------------------
3201    Name: Matthias Blume
3202    Date: 2001/05/11 14:35:00 EDT
3203    Tag: blume-20010511-ml-nlffi
3204    Description:
3205    
3206    I finally took the plunge and added my new FFI code to the main
3207    repository.  For x86-linux it is now ready for prime-time.
3208    
3209    There are two new subdirectories of "src":
3210    
3211      - ml-nlffi-lib:
3212           The utility library for programs using the FFI interface.
3213           Here is the implementation of $/c.cm and its associated low-level
3214           partners $/c-int.cm and $/memory.cm.
3215      - ml-nlffigen:
3216           A stand-alone program for generating ML glue code from C source
3217           code.
3218    
3219    Building ml-nlffigen requires $/ckit-lib.cm.
3220    
3221    The config/install.sh script has been updates to do the Right Thing
3222    (hopefully).
3223    
3224    Notice that the source tree for the C-Kit will not be put under "src"
3225    but directly under the installation root directory.  (This is the
3226    structure that currently exists on the CVS server when you check out
3227    module "sml".)  Fortunately, config/install.sh knows about this oddity.
3228    
3229    Bugs: No documentation yet.
3230    
3231    ----------------------------------------------------------------------
3232    Name: Matthias Blume
3233    Date: 2001/05/09 16:35:00 EDT
3234    Tag: blume-20010509-cpscontract
3235    Description:
3236    
3237    Fixed a bug in the accounting code in cpsopt/contract.sml.  (The
3238    wrapper/unwrapper elimination did not decrement usage counts and some
3239    dead variables got overlooked by the dead-up logic.)
3240    
3241    ----------------------------------------------------------------------
3242    Name: Lal George
3243    Date: 2001/05/08  17:26:09 EDT
3244    Tag: george-20010508-omit-frameptr
3245    Description:
3246    
3247    Changes to implement the omit-frame-pointer optimization to support
3248    raw C calls. For now, there is only support on the Intel x86, but
3249    other architectures will follow as more experience is gained with this.
3250    
3251    
3252    ----------------------------------------------------------------------
3253    Name: Matthias Blume
3254    Date: 2001/05/07 14:40:00 EDT
3255    Tag: blume-20010507-proxies
3256    Description:
3257    
3258    I made into "proxy libraries" all libraries that qualify for such a
3259    change.  (A qualifying library is a library that has another library or
3260    groups as its sole member and repeats that member's export list
3261    verbatim.  A proxy library avoids this repetition by omitting its export
3262    list, effectively inheriting the list that its (only) member exports.
3263    See the CM manual for more explanation.)
3264    The main effect is that explicit export lists for these libraries
3265    do not have to be kepts in sync, making maintenance a bit easier.
3266    
3267    I also added copyright notices to many .cm-files.
3268    
3269    Last but not least, I made a new set of bootfiles.
3270    
3271    ----------------------------------------------------------------------
3272    Name: Matthias Blume
3273    Date: 2001/05/04 17:00:00 EDT
3274    Tag: blume-20010504-cm-lsplit
3275    Description:
3276    
3277    0. John merged pending changes to $/smlnj-lib.cm
3278    
3279    1. Allen's previous change accidentally backed out of one of Lal's
3280       earlier changes.  I undid this mistake (re-introducing Lal's change).
3281    
3282    2. I used the new topOrder' function from graph-scc.sml (from $/smlnj-lib.cm)
3283       within the compiler where applicable.  There is some code simplification
3284       because of that.
3285    
3286    3. The "split" phase (in FLINT) is now part of the default list of phases.
3287       Compiler.Control.LambdaSplitting.* can be used to globally control the
3288       lambda-splitting (cross-module-inlining) engine.  In addition to that,
3289       it can now also be controlled on a per-source basis: CM has been taught
3290       a new tool parameter applicable to ML source files.
3291    
3292       - To turn lambda-splitting off completely:
3293            local open Compiler.Control.LambdaSplitting in
3294                val _ = set Off
3295            end
3296       - To make "no lambda-splitting" the global default (but allow per-source
3297         overriding); this is the initial setting:
3298            local open Compiler.Control.LambdaSplitting in
3299                val _ = set (Default NONE)
3300            end
3301       - To make "lambda-splitting with aggressiveness a" the global default
3302         (and allow per-source overriding):
3303            local open Compiler.Control.LambdaSplitting in
3304                val _ = set (Default (SOME a))
3305            end
3306    
3307       - To turn lambda-splitting off for a given ML souce file (say: a.sml)
3308         write (in the respective .cm-file):
3309            a.sml (lambdasplitting:off)
3310       - To turn lambda-splitting for a.sml on with minimal aggressiveness:
3311            a.sml (lambdasplitting:on)
3312       - To turn lambda-splitting for a.sml on with aggressiveness <a> (where
3313         <a> is a decimal non-negative integer):
3314            a.sml (lambdasplitting:<a>)
3315       - To turn lambda-splitting for a.sml on with maximal aggressiveness:
3316            a.sml (lambdasplitting:infinity)
3317       - To use the global default for a.sml:
3318            a.sml (lambdasplitting:default)
3319         or simply
3320            a.sml
3321    
3322    ----------------------------------------------------------------------
3323    Name: Allen Leung
3324    Date: 2001/05/04 01:57:00 EDT
3325    Tag: leunga-20010504-sync
3326    Description:
3327    
3328      MLRISC features.
3329    
3330      1. Fix to CMPXCHG instructions.
3331      2. Changed RA interface to allow annotations in callbacks.
3332      3. Added a new method to the stream interface to allow annotations updates.
3333    
3334    ----------------------------------------------------------------------
3335    Name: Matthias Blume
3336    Date: 2001/05/01 11:45:00 EDT
3337    Tag: blume-20010501-pcedittmp
3338    Description:
3339    
3340    Changed install.sh to use the current working directory instead of
3341    /usr/tmp for a temporary file (pcedittmp).  The previous choice
3342    of /usr/tmp caused trouble with MacOS X because of file premission
3343    problems.
3344    
3345    ----------------------------------------------------------------------
3346    Name: Matthias Blume
3347    Date: 2001/04/20 11:10:00 EDT
3348    Tag: blume-20010420-inMLflag
3349    Description:
3350    
3351     - added vp_limitPtrMask to vproc-state.h
3352       (for use by the raw-C-calls mechanism to implement proper interrupt
3353        handling)
3354     - made the ML compiler aware of various data-structure offsets so it
3355       can generate code for accessing the vp_inML flag and vp_limitPtrMask
3356     - tweaked mlriscGen.sml to have it emit interrupt-handling code for
3357       raw C-calls
3358    
3359    ----------------------------------------------------------------------
3360    Name: Lal George
3361    Date: 2001/04/20 09:15:28 EDT
3362    Tag: george-20010420-macosX
3363    Description:
3364    
3365     - Changes to port to Mac OS X; Darwin.
3366    
3367     - In the process I found that sqrt was broken on the PPC, because the
3368       fsqrt instruction is not implemented.
3369    
3370    ----------------------------------------------------------------------
3371    Name: Matthias Blume
3372    Date: 2001/04/18 12:45:00 EDT
3373    Tag: blume-20010418-ccalls
3374    Description:
3375    
3376     - fixed two off-by-4 errors in the x86-specific c-calls implementation
3377       (this bug prevented structure arguments containing pointers from being
3378        passed correctly)
3379     - changed the raw-C-call code in mlriscGen.sml in such a way that
3380       structure arguments are represented as a pointer to the beginning
3381       of the structure (instead of having a series of synthesized arguments,
3382       one for each structure member)
3383    
3384     - made makeml script's verbosity level configurable via environment
3385       variable (MAKEML_VERBOSITY)
3386    
3387     - eliminated placeholder implementations for f32l, w16s, i16s, and f32s
3388       in rawmem-x86.sml; we are now using the real thing
3389    
3390    ----------------------------------------------------------------------
3391    Name: Matthias Blume
3392    Date: 2001/03/22 16:25:00 EST
3393    Tag: blume-20010322-bootfiles
3394    Description:
3395    
3396    Created a new set of bootfiles (for your automatic installation convenience).
3397    
3398    ----------------------------------------------------------------------
3399    Name: Matthias Blume
3400    Date: 2001/03/22 15:10:00 EST
3401    Tag: blume-20010322-rawmem-parcm
3402    Description:
3403    
3404    1. All "raw memory access" primitives for the new FFI are implemented now
3405       (at least on the x86).
3406    2. Some further cleanup of CM's parallel make mechanism.
3407    
3408    ----------------------------------------------------------------------
3409    Name: Matthias Blume
3410    Date: 2001/03/19 17:53:00 EST
3411    Tag: blume-20010319-parallel
3412    Description:
3413    
3414    Parallel make (using compile servers) now works again.
3415    
3416    To this end, CM.stabilize and CMB.make have been modified to work in
3417    two passes when compile servers are attached:
3418       1. Compile everything, do not perform stabilization; this pass
3419          uses compile servers
3420       2. Stabilize everything; this pass does not use compile servers
3421    If there are no compile servers, the two passes are combined into one
3422    (as before).  Splitting the passes increases the inherent parallelism
3423    in the dependency graph because the entire graph including all
3424    libraries is available at the same time.  This, in turn, improves
3425    server utilization.  The downside is that the master process will
3426    have to do some extra work after compilation is done (because for
3427    technical reasons it must re-read all the binfiles during stabilization).
3428    
3429    ----------------------------------------------------------------------
3430    Name: Matthias Blume
3431    Date: 2001/03/16 12:22:00 EST
3432    Tag: blume-20010316-bootfiles
3433    Description:
3434    
3435    Created a new set of bootfiles (for your automatic installation convenience).
3436    
3437    ----------------------------------------------------------------------
3438    Name: Matthias Blume
3439    Date: 2001/03/16 11:00:00 EST
3440    Tag: blume-20010316-MLTREE-fixup
3441    Description:
3442    
3443    This is a minor fixup for an (untagged) earlier commit by Allen.
3444    (A file was missing).
3445    
3446    ----------------------------------------------------------------------
3447    Name: Allen Leung
3448    Date: Mon Mar  5 18:54:57 EST 2001
3449    Tag: leunga-20010305-cut-support
3450    
3451    1. New support for alternative control-flow in MLTREE.
3452       Currently we support
3453    
3454          FLOW_TO(CALL ...., [k1,...,kn])
3455    
3456       This is needed for 'cuts to' in C-- and try/handle-like constructs
3457       in Moby
3458    
3459       New assembler flag "asm-show-cutsto" to turn on control-flow debugging.
3460    
3461    2. Register Allocator
3462    
3463       Changes in interface [from Fermin, John]
3464    
3465    3. Alpha 8-bit SLL support [Fermin]
3466    
3467    4. All architectures
3468    
3469       A new module (ClusterExpandCopies) for expanding parallel copies.
3470    
3471    ----------------------------------------------------------------------
3472    Name: Allen Leung
3473    Date: 2001/02/27 23:07:00 EST
3474    Tag: leunga-20010227-minor-stuff
3475    
3476    1. Alpha bug fix for CMOVNE
3477    2. Handle mltree COND(..,FCMP ...,...)
3478    3. Bug fix in simplifier
3479    
3480    ----------------------------------------------------------------------
3481    Name: Matthias Blume
3482    Date: 2001/01/30 17:50:00 EST
3483    Tag: blume-20010130-sync
3484    Description:
3485    
3486    This is just a minor update to sync my devel branch with the main brach.
3487    The only visible change is the addition of some README files.
3488    
3489    ----------------------------------------------------------------------
3490    Name: Matthias Blume
3491    Date: 2001/01/12 23:30:00 JST
3492    Tag: blume-20010112-bootfiles
3493    Description:
3494    
3495    Made a new set of bootfiles that goes with the current state of the
3496    repository.
3497    
3498    ----------------------------------------------------------------------
3499    Name: Matthias Blume
3500    Date: 2001/01/12 21:20:00 JST
3501    Tag: blume-20010112-sync
3502    Description:
3503    
3504    I am just flushing out some minor changes that had accumulated in
3505    my private branch in order to sync with the main tree.  (This is
3506    mainly because I had CVS trouble when trying to merge _into_ my
3507    private branch.)
3508    
3509    Most people should be completely unaffected by this.
3510    
3511    ----------------------------------------------------------------------
3512    Name: Allen Leung
3513    Date: Thu Jan 11 21:03:00 EST 2001
3514    Tag: leunga-20010111-labexp=mltree
3515    Description:
3516    
3517    1.  Removed the type LabelExp and replace it by MLTree.
3518    2.  Rewritten mltree-simplify with the pattern matcher tool.
3519    3.  There were some bugs in alpha code generator which would break
3520        64-bit code generation.
3521    4.  Redo the tools to generate code with the
3522    5.  The CM files in MLRISC (and in src/system/smlnj/MLRISC)
3523        are now generated by perl scripts.
3524    
3525    ----------------------------------------------------------------------
3526    Name: Matthias Blume
3527    Date: 2001/01/10 21:55:00 JST
3528    Tag: blume-20010110-rcc
3529    Description:
3530    
3531    The RCC stuff now seems to work (but only on the x86).
3532    This required hacking of the c-calls interface (and -implementation) in
3533    MLRISC.
3534    
3535    Normal compiler users should be unaffected.
3536    
3537    ----------------------------------------------------------------------
3538    Name: Matthias Blume
3539    Date: 2001/01/09 01:20:00 JST
3540    Tag: blume-20010109-rcc
3541    Description:
3542    
3543    This is a fairly big patch, flushing out a large number of pending
3544    changes that I made to my development copy over the last couple of days.
3545    
3546    Of practical relevance at this moment is a workaround for a pickling
3547    bug that Allen ran into the other day.  The cause of the bug itself is
3548    still unknown and it might be hard to fix it properly, but the
3549    workaround has some merits of its own (namely somewhat reducing pickling
3550    overhead for certain libraries).  Therefore, I think this solution should
3551    be satisfactory at this time.
3552    
3553    The rest of the changes (i.e., the vast majority) has to do with my
3554    ongoing efforts of providing direct support for C function calls from
3555    ML.  At the moment there is a new primop "RAW_CCALL", typing magic
3556    in types/cproto.sml (invoked from FLINT/trans/translate.sml), a new
3557    case in the FLINT CPS datatype (RCC), changes to cps/convert.sml to
3558    translate uses of RAW_CCALL into RCC, and changes to mlriscGen.sml to
3559    handle RCC.
3560    
3561    The last part (the changes to mlriscGen.sml) are still known to be
3562    wrong on the x86 and not implemented on all other architectures.  But
3563    the infrastructure is in place. I had to change a few functor
3564    signatures in the backend to be able to route the CCalls interface
3565    from MLRISC there, and I had to specialize the mltree type (on the
3566    x86) to include the necessary extensions. (The extensions themselves
3567    were already there and redy to go in MLRISC/x86).
3568    
3569    Everything should be very happy as soon as someone helps me with
3570    mlriscGen.sml...
3571    
3572    In any case, nothing of this should matter to anyone as long as the
3573    new primop is not being used (which is going to be the case unless you
3574    find it where I hid it :). The rest of the compiler is completely
3575    unaffected.
3576    
3577    ----------------------------------------------------------------------
3578    Name: Matthias Blume
3579    Date: 2001/01/05 00:30:00 JST
3580    Tag: blume-20010105-primops
3581    Description:
3582    
3583    Added some experimental support for work that I am doing right now.
3584    These changes mostly concern added primops, but there is also a new
3585    experimental C library in the runtime system (but currently not enabled
3586    anywhere except on Linux/X86).
3587    
3588    In the course of adding primops (and playing with them), I discovered that
3589    Zhong's INL_PRIM hack (no type info for certain primops) was, in fact, badly
3590    broken.  (Zhong was very right he labeled this stuff as "major gross hack".)
3591    To recover, I made type information in INL_PRIM mandatory and changed
3592    prim.sml as well as built-in.sml accordingly.  The InLine structure now
3593    has complete, correct type information (i.e., no bottom types).
3594    
3595    Since all these changes mean that we need new binfiles, I also bumped the
3596    version number to 110.32.1.
3597    
3598    ----------------------------------------------------------------------
3599    Name: Matthias Blume
3600    Date: 2000/12/30 22:10:00 JST
3601    Tag: blume-20001230-various
3602    Description:
3603    
3604    Added proxy libraries for MLRISC and let MLRISC libraries refer
3605    to each other using path anchors.  (See CM manual for explanation.)
3606    
3607    Updated CM documentation.
3608    
3609    Fixed some bugs in CM.
3610    
3611    Implemented "proxy" libraries (= syntactic sugar for CM).
3612    
3613    Added "-quiet" option to makeml and changed runtime system accordingly.
3614    
3615    Added cleanup handler for exportML to reset timers and compiler stats.
3616    
3617    ----------------------------------------------------------------------