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