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 1053, Wed Feb 6 19:11:13 2002 UTC revision 1343, Wed Aug 13 17:44:22 2003 UTC
# Line 13  Line 13 
13  Description:  Description:
14    
15  ----------------------------------------------------------------------  ----------------------------------------------------------------------
16    Name: Dave MacQueen (dbm@cs.uchicago.edu)
17    Date: 2003/08/13 11:36:00 CDT
18    Tag: dbm-20030813-mcz-merge1
19    Description:
20    
21    Merging changes from the mcz-branch development branch into trunk.
22    These changes involve replacement of the emulated old prettyprinter
23    interface with direct use of the SML/NJ Lib PP library, and fixing
24    of a couple of bugs (895, 1186) relating to error messages.  A new
25    prettyprinter for ast datatypes (Elaborator/print/ppast.{sig,sml})
26    has been added.
27    
28    ----------------------------------------------------------------------
29    Name: Matthias Blume (blume@tti-c.org)
30    Date: 2003/08/11 15:45:00 CDT
31    Tag: blume-20030811-windows
32    Description:
33    
34    Version number bumped to 110.42.9.  NEW BOOTFILES!!!
35    
36        http://smlnj.cs.uchicago.edu/dist/working/110.42.9/
37    
38    This patch restores SML/NJ's ability to run under win32.  There are a
39    number of changes, including fixes for several bugs that had gone
40    unnoticed until now:
41    
42      - uname "CYGWIN_NT*" is recognized as win32 (This is relevant only when
43        trying to run the win32 version from within cygwin.)
44    
45      - There are a number of simple .bat scripts that substitute for their
46        corresponding Unix shell-scripts.  (See below.)
47    
48      - The internals of ml-build have been modified slightly.  The main
49        difference is that instead of calling ".link-sml" (or link-sml.bat)
50        using OS.Process.system, the ML process delegates this task back
51        to the script.  Otherwise problems arise in mixed environments such
52        as Cygwin where scripts look and work like Unix scripts, but
53        where OS.Process.system cannot run them.
54    
55      - In CM, the srcpath pickler used native pathname syntax -- which
56        is incorrect in the case of cross-compilation.  The new pickle format
57        is independent of platform-specific naming conventions.
58    
59      - Path configuration files (such as lib/pathconfig) can now choose
60        between native and standard syntax.  Placing a line of the form
61    
62            standard!
63    
64        into the file causes all subsequent paths to be interpreted using
65        CM standard pathname syntax (= Unix conventions); a line
66    
67            native!
68    
69        switches back to native style.  This was needed so that
70        path config files can be written portably, see src/system/pathconfig.
71    
72      - Runtime system:
73    
74          - win32-filesys.c:  get_file_time and set_file_time now
75            access modification time, not creation time.
76    
77          - I/O code made aware of new array representation.
78    
79          - Bug fixes in X86.prim.masm.
80    
81       - src/system/makeml made aware of win32. (For use under cygwin
82            and other Unix-environments for windows.)
83    
84       - In Basis, fixed off-by-one error in win32-io.sml (function vecF)
85         which caused BinIO.inputAll to fail consistently.
86    
87    .bat scripts:
88    
89       Windows .bat scripts assume that SMLNJ_HOME is defined.
90    
91       - sml.bat, ml-yacc.bat, ml-lex.bat:  Driver scripts for standalone
92         applications (sml, ml-yacc, ml-lex).
93       - ml-build.bat: analogous to ml-build.
94       - config\install.bat:  Analogous to config/install.sh.  This requires
95         that SMLNJ_HOME is set and that Microsoft Visual C is ready to use.
96         (nmake etc. must be on the path, and vcvars32 must have been run.)
97         Moreover, sources for ml-lex and ml-yacc need to exist under src,
98         and the bootfile hierarchy must have been unpacked under
99         sml.boot.x86-win32.
100         The script is very primitive and does a poor job at error checking.
101         It only installs the base system, ml-lex, and ml-yacc.  No other
102         libraries are being installed (i.e., you get only those that
103         are part of the compiler.)
104       - link-sml.bat:  analogous to .link-sml, but not currently used
105    
106    Unrelated bug fixes:
107    
108      - ml-nlffigen now exports structures ST_* corresponding to incomplete
109        types.
110      - Added getDevice to PP/src/pp-debug-fn.sml.  (Would not compile
111        otherwise.)
112    
113    ----------------------------------------------------------------------
114    Name: Dave MacQueen (macqueen@cs.uchicago.edu)
115    Date: 2003/06/17
116    Tag: macqueen-20030617-bug895
117    Description:
118    
119    Modified compiler/Elaborator/print/pptype.sml to fix bug 895.
120    Tag will be used for new development branch (mcz-branch) for
121    use by MacQueen, (Lucasz) Zairek, and (George) Cao at uchicago.
122    
123    ----------------------------------------------------------------------
124    Name: Matthias Blume (blume@tti-c.org)
125    Date: 2003/05/27 16:55:00 CDT
126    Tag: blume-20030527-polyeq
127    Description:
128    
129    Tried to eliminated most cases of polymorphic equality.
130    
131    ----------------------------------------------------------------------
132    Name: Matthias Blume (blume@tti-c.org)
133    Date: 2003/05/21 17:45:00 CDT
134    Tag: blume-20030517-complete
135    Description:
136    
137    Two changes:
138    
139      1. Added a flag for controlling whether non-exhaustive bindings will
140         be treated as errors (default is false).
141      2. Cleaned up the *entire* source tree so that CMB.make goes through
142         without a single non-exhaustive match- or bind warning.
143    
144    ----------------------------------------------------------------------
145    Name: Matthias Blume (blume@tti-c.org)
146    Date: 2003/05/17 10:20:00 CDT
147    Tag: blume-20030517-absyn
148    Description:
149    
150    1. Added cases for IF, WHILE, ANDALSO, and ORELSE to Absyn.
151    
152       This mainly affects the quality of error messages.  However, some
153       of the code is now more straightforward than before. (Treatment of
154       the above four constructs in translate.sml is much simpler than
155       the "macro-expansion" that was going on before.  Plus, the mach-
156       compiler no longer gets invoked just to be able to compile an
157       if-expression.)
158    
159    2. The ErrorMsg.Error exception is now caught and absorbed by the
160       interactive loop.
161    
162    ----------------------------------------------------------------------
163    Name: Allen Leung
164    Date: 2003/05/16 13:05:00 CDT
165    Tag: leunga-20030516-cygwin-runtime
166    Description:
167    
168        Ported the runtime system to cygwin, which uses the unix
169    x86-unix bin files.  Missing/buggy features:
170    
171       o getnetbyname, getnetbyaddr: these functions seem to be missing in
172         the Cygwin library.
173       o Ctrl-C handling may be flaky.
174       o Windows system calls and Windows I/O are not supported.
175    
176       A new set of binfiles is located at:
177    
178         http://www.dorsai.org/~leunga/boot.x86-unix.tgz
179    
180       This is only needed for bootstrapping the cygwin version of smlnj.
181       Other x86 versions can use the existing binfiles.
182    
183    ----------------------------------------------------------------------
184    Name: Matthias Blume
185    Date: 2003/04/08 15:42:00 CDT
186    Tag: blume-20030408-listpair
187    Description:
188    
189    1. Added a target 'mlrisc' to installer.
190    
191    2. Added missing elements to structure ListPair.
192    
193    ----------------------------------------------------------------------
194    Name: Allen Leung
195    Date: 2003/01/07 10:40:00 EST
196    Tag: leunga-20030107-int-rem
197    Description:
198    
199    Fixed a bug in Int.rem(x,y) where y is a power of 2 on x86.
200    The arguments to the SUBL instruction were swapped.
201    
202    ----------------------------------------------------------------------
203    Name: Matthias Blume
204    Date: 2002/12/12 16:25:00 EST
205    Tag: blume-20021212-risc-ra
206    Description:
207    
208    Fixed a serious bug in the rewrite code for FP spilling/reloading that
209    sent the RA into an infinite loop when floating point registers get
210    spilled.  (Because of this bug, e.g., nucleic stopped compiling between
211    110.37 and 110.38.)
212    There was another set of potential problems related to the handling of
213    MLRISC annotations (but those did not yet cause real problems, apparently).
214    
215    ----------------------------------------------------------------------
216    Name: Matthias Blume
217    Date: 2002/12/06 22:40:00 EST
218    Tag: blume-20021206-cm-fileid
219    Description:
220    
221    Added a call of SrcPath.sync at the beginning of Parse.parse (in CM).
222    This fixes the problem of CM getting confused by files that suddenly
223    change their identity (e.g., by getting unlinked and recreated by some
224    text editor such as vi).  There might be a better/cheaper/cleaner way
225    of doing this, but for now this will have to do.
226    
227    ----------------------------------------------------------------------
228    Name: Matthias Blume
229    Date: 2002/10/28 09:50:00 EST
230    Tag: blume-20021028-typecheck
231    Description:
232    
233    Exported structure Typecheck from $smlnj/viscomp/core.cm.
234    
235    ----------------------------------------------------------------------
236    Name: Matthias Blume
237    Date: 2002/10/17 09:10:00 EDT
238    Tag: Release_110_42
239    Description:
240    
241    In good old tradition, there has been a slight hiccup so that we have
242    to patch 110.42 after the fact.   The old release tag has been replaced
243    (see below).
244    
245    The change solves a problem with two competing approaches the
246    configuration problem regarding MacOS 10.1 vs. MacOS 10.2 which got in
247    each other's way.
248    
249    This change only affects the runtime system code and the installer script.
250    (No new bootfiles.)
251    
252    ----------------------------------------------------------------------
253    Name: Matthias Blume
254    Date: 2002/10/16 12:00:00 EDT
255    Tag: Release_110_42_removed
256    Description:
257    
258    New working release.  New bootfiles.
259    
260    ----------------------------------------------------------------------
261    Name: Matthias Blume
262    Date: 2002/10/10 13:10:00 EDT
263    Tag: blume-20021010-ppc-divs
264    Description:
265    
266    The mltree operator DIVS must be implemented with an overflow check on
267    the PPC because the hardware indicates divide-by-zero using "overflow" as
268    well.
269    
270    ----------------------------------------------------------------------
271    Name: Matthias Blume
272    Date: 2002/07/23 11:45:00
273    Tag: blume-20020723-smlnj-home
274    Description:
275    
276    Sml now senses the SMLNJ_HOME environment variable.  If this is set,
277    then the bin dir is assumed to be in $SMLNJ_HOME/bin and (unless
278    CM_PATHCONFIG is also set), the path configuration file is assumed
279    to be in $SMLNJ_HOME/lib/pathconfig.  This way one can easily move
280    the entire tree to some other place and everything will "just work".
281    
282    (Companion commands such as ml-build and ml-makedepend also sense this
283    variable.)
284    
285    ----------------------------------------------------------------------
286    Name: Matthias Blume
287    Date: 2002/07/12 21:19:00 EDT
288    Tag: blume-20020712-liveness
289    Description:
290    
291    Exported two useful "step" functions from liveness module (MLRISC).
292    
293    ----------------------------------------------------------------------
294    Name: Matthias Blume
295    Date: 2002/07/05 16:00 EDT
296    Tag: Release_110_41
297    Description:
298    
299    New working release.  New bootfiles.
300    
301    ----------------------------------------------------------------------
302    Name: Matthias Blume
303    Date: 2002/07/05 10:25:00 EDT
304    Tag: blume-20020705-btimp
305    Description:
306    
307    Exported structure BTImp from $smlnj/viscomp/debugprof.cm so that
308    other clients can set up backtracing support.
309    
310    ----------------------------------------------------------------------
311    Name: Matthias Blume
312    Date: 2002/06/25 17:23:00 EDT
313    Tag: blume-20020625-fpmax
314    Description:
315    
316    Fixed a bug in translation of INLMAX (and INLMIN) for the floating-point
317    case.  (The sense of the isNaN test was reversed -- which made min and
318    max always return their first argument.)
319    
320    ----------------------------------------------------------------------
321    Name: Matthias Blume
322    Date: 2002/06/11
323    Tag: blume-20020611-unixpath
324    Description:
325    
326    Back-ported OS.Path.{from,to}UnixPath from idlbasis-devel branch.
327    
328    ----------------------------------------------------------------------
329    Name: Matthias Blume
330    Date: 2002/06/10 16:35:00 EDT
331    Tag: blume-20020610-ieeereal
332    Description:
333    
334    I back-ported my implementation of IEEEReal.fromString from the
335    idlbasis-devel branch so that we can test it.
336    
337    Another small change is that ppDec tries to give more information
338    than just "<sig>" in the case of functors.  However, this code is
339    broken in some mysterious way if the functor's body's signature
340    has not been declared by ascription but gets inferred from the
341    implementation.  This needs fixing...
342    
343    ----------------------------------------------------------------------
344    Name: Matthias Blume
345    Date: 2002/05/31
346    Tag: blume-20020531-btrace-mode
347    Description:
348    
349    Resurrected SMLofNJ.Internals.BTrace.mode.  (It accidentally fell by
350    the wayside when I switched over to using Controls everywhere.)
351    
352    ----------------------------------------------------------------------
353    Name: Lal George
354    Date: 2002/05/23 12:21:40 EDT
355    Tag: george-20020523-visual-labels
356    Description:
357    
358    Labels are now displayed in the graphical output to make
359    the fall-through and target blocks obvious.
360    
361    ----------------------------------------------------------------------
362    Name: Matthias Blume
363    Date: 2002/05/22 11:03:00 EDT
364    Tag: blume-20020522-shrink
365    Description:
366    
367    John tweaked yesterday's fix for 1131 to handle an out-of-memory
368    situation that comes up when allocating huge arrays.
369    
370    ----------------------------------------------------------------------
371    Name: Matthias Blume
372    Date: 2002/05/21 16:00:00 EDT
373    Tag: Release_110_40
374    Description:
375    
376    New working release (110.40).  New bootfiles.
377    
378    [Also: John Reppy fixed GC bug 1131.]
379    
380    ----------------------------------------------------------------------
381    Name: Matthias Blume
382    Date: 2002/05/21 12:35:00 EDT
383    Tag: blume-20020521-cmdoc
384    Description:
385    
386    CM documentation update.
387    
388    ----------------------------------------------------------------------
389    Name: Matthias Blume
390    Date: 2002/05/21 10:55:00 EDT
391    Tag: blume-20020521-misc
392    Description:
393    
394    - John tweaked runtime to be silent on heap export (except when
395      GC messages are on).
396    - I added a few more things (cross-compiling versions of CMB) to
397      config/preloads (as suggestions).
398    
399    ----------------------------------------------------------------------
400    Name: Matthias Blume
401    Date: 2002/05/20 22:25:00 EDT
402    Tag: blume-20020520-controls
403    Description:
404    
405    - Added ControlUtil structure to control-lib.cm.
406    - Use it throughout.
407    - Used Controls facility to define MLRISC controls (as opposed to
408      registering MLRISC control ref cells with Controls after the fact)
409    - Fixed messed-up controls priorities.
410    
411    * Removed again all the stuff from config/preloads that one wouldn't
412      be able to preload at the time the initial heap image is built.
413      (Many libraries, e.g., CML, do not exist yet at this time.  The
414       only libraries that can be preloaded via config/preloads are those
415       that come bundled with the bootfiles.)
416    
417    ----------------------------------------------------------------------
418    Name: Matthias Blume
419    Date: 2002/05/20 10:59:00 EDT
420    Tag: blume-20020520-preloads
421    Description:
422    
423    Added a lot of commented-out suggestions for things to be included
424    in config/preloads.
425    
426    ----------------------------------------------------------------------
427    Name: Allen Leung
428    Date: 2002/05/18 14:20:00 EDT
429    Tag: leunga-20020518-mdl
430    Description:
431    
432    o Made the mdl tool stuff compile and run again.
433    o I've disabled all the stuff that depends on RTL specifications; they
434      are all badly broken anyway.
435    
436    ----------------------------------------------------------------------
437    Name: Matthias Blume
438    Date: 2002/05/17 16:49:00 EDT
439    Tag: blume-20020517-controls
440    Description:
441    
442    0. John Reppy made several modifications to the SML/NJ library.
443       In particular, there is a shiny new controls-lib.cm.
444    
445    1. Pushed new controls interface through compiler so that everything
446       compiles again.
447    
448    2. Added FormatComb and FORMAT_COMB to the CML version of the
449       SML/NJ library (so that CML compiles again).
450    
451    3. Modified init scripts because XXX_DEFAULT environment variables
452       are no longer with us.  (Boot-time initialization is now done
453       using the same environment variables that are also used for
454       startup-time initialization of controls.)
455    
456    ----------------------------------------------------------------------
457    Name: Lal George
458    Date: 2002/05/15 09:20:10 EDT
459    Tag: george-20020515-pseudo-op-decls
460    Description:
461    
462            All pseudo-ops emitted before the first segment declaration
463    such as TEXT, DATA, and BSS directives are assumed to be global
464    declarations and are emitted first in the assembly file. This is
465    useful in a number of situations where one has pseudo-ops that are not
466    specific to any segment, and also works around the constraint that one
467    cannot have client pseudo-ops in the TEXT segment.
468    
469            Because no segment is associated with these declarations it is
470    an error to allocate any space or objects before the first segment
471    directive and an exception will be raised. However, we cannot make
472    this check for client pseudo-ops.
473    
474            These top level declarations are a field in the CFG graph_info.
475    In theory you can continue to add to this field after the CFG has been
476    built -- provided you know what you are doing;-)
477    
478    ----------------------------------------------------------------------
479    Name: Matthias Blume
480    Date: 2002/05/13 16:40:00 EDT
481    Tag: blume-20020513-pp-etc
482    Description:
483    
484    A few minor bugfixes:
485    
486      - Stopgap measure for bug recently reported by Elsa Gunter (ppDec).
487        (Bogus printouts for redefined bindings still occur.  Compiler
488        bug should no longer occur now.  We need to redo the prettyprinter
489        from scratch.)
490    
491      - CM pathname printer now also adds escape sequences for ( and )
492    
493      - commend and docu fixes for ml-nlffi
494    
495    ----------------------------------------------------------------------
496    Name: Matthias Blume
497    Date: 2002/05/10 16:40:00 EDT
498    Tag: blume-20020510-erg-textio
499    Description:
500    
501    Applied the following bugfix provided by Emden Gansner:
502    
503        Output is corrupted when outputSubstr is used rather than output.
504    
505        The problem occurs when a substring
506    
507            ss = (s, dataStart, dataLen)
508    
509        where dataStart > 0, fills a stream buffer with avail bytes left.
510        avail bytes of s, starting at index dataStart, are copied into the
511        buffer, the buffer is flushed, and then the remaining dataLen-avail
512        bytes of ss are copied into the beginning of the buffer. Instead of
513        starting this copy at index dataStart+avail in s, the current code
514        starts the copy at index avail.
515    
516        Fix:
517        In text-io-fn.sml, change line 695 from
518             val needsFlush = copyVec(v, avail, dataLen-avail, buf, 0)
519        to
520             val needsFlush = copyVec(v, dataStart+avail, dataLen-avail, buf, 0)
521    
522    ----------------------------------------------------------------------
523    Name: Matthias Blume
524    Date: 2002/04/12 13:55:00 EDT
525    Tag: blume-20020412-assyntax
526    Description:
527    
528    1. Grabbed newer assyntax.h from the XFree86 project.
529    2. Fiddled with how to compile X86.prim.asm without warnings.
530    3. (Very) Minor cleanup in CM.
531    
532    ----------------------------------------------------------------------
533    Name: Matthias Blume
534    Date: 2002/04/01 (no joke!) 17:07:00 EST
535    Tag: blume-20020401-x86div
536    Description:
537    
538    Added full support for div/mod/rem/quot on the x86, using the machine
539    instruction's two results (without clumsily recomputing the remainder)
540    directly where appropriate.
541    
542    Some more extensive power-of-two support was added to the x86 instruction
543    selector (avoiding expensive divs, mods, and muls where they can be
544    replaced with cheaper shifts and masks).  However, this sort of thing
545    ought to be done earlier, e.g., within the CPS optimizer so that
546    all architectures benefit from it.
547    
548    The compiler compiles to a fixed point, but changes might be somewhat
549    fragile nevertheless.  Please, report any strange things that you might
550    see wrt. div/mod/quot/rem...
551    
552    ----------------------------------------------------------------------
553    Name: Matthias Blume
554    Date: 2002/03/29 17:22:00
555    Tag: blume-20020329-div
556    Description:
557    
558    Fixed my broken div/mod logic.  Unfortunately, this means that the
559    inline code for div/mod now has one more comparison than before.
560    Fast paths (quotient > 0 or remainder = 0) are not affected, though.
561    The problem was with quotient = 0, because that alone does not tell
562    us which way the rounding went.  One then has to look at whether
563    remainder and divisor have the same sign...  :(
564    
565    Anyway, I replaced the bootfiles with fresh ones...
566    
567    ----------------------------------------------------------------------
568    Name: Matthias Blume
569    Date: 2002/03/29 14:10:00 EST
570    Tag: blume-20020329-inlprims
571    Description:
572    
573    NEW BOOTFILES!!!    Version number bumped to 110.39.3.
574    
575    Primops have changed. This means that the bin/boot-file formats have
576    changed as well.
577    
578    To make sure that there is no confusion, I made a new version.
579    
580    
581    CHANGES:
582    
583    * removed REMT from mltree (remainder should never overflow).
584    
585    * added primops to deal with divisions of all flavors to the frontend
586    
587    * handled these primops all the way through so they map to their respective
588      MLRISC support
589    
590    * used these primops in the implementation of Int, Int32, Word, Word32
591    
592    * removed INLDIV, INLMOD, and INLREM as they are no longer necessary
593    
594    * parameterized INLMIN, INLMAX, and INLABS by a numkind
595    
596    * translate.sml now deals with all flavors of INL{MIN,MAX,ABS}, including
597      floating point
598    
599    * used INL{MIN,MAX,ABS} in the implementation of Int, Int32, Word, Word32,
600      and Real (but Real.abs maps to a separate floating-point-only primop)
601    
602    
603    TODO items:
604    
605    * Hacked Alpha32 instruction selection, disabling the selection of REMx
606      instructions because the machine instruction encoder cannot handle
607      them.  (Hppa, PPC, and Sparc instruction selection did not handle
608      REM in the first place, and REM is supported by the x86 machine coder.)
609    
610    * Handle DIV and MOD with DIV_TO_NEGINF directly in the x86 instruction
611      selection phase.  (The two can be streamlined because the hardware
612      delivers both quotient and remainder at the same time anyway.)
613    
614    * Think about what to do with "valOf(Int32.minInt) div ~1" and friends.
615      (Currently the behavior is inconsistent both across architectures and
616      wrt. the draft Basis spec.)
617    
618    * Word8 should eventually be handled natively, too.
619    
620    * There seems to be one serious bug in mltree-gen.sml.  It appears, though,
621      as if there currently is no execution path that could trigger it in
622      SML/NJ.  (The assumptions underlying functions arith and promotable do not
623      hold for things like multiplication and division.)
624    
625    ----------------------------------------------------------------------
626    Name: Matthias Blume
627    Date: 2002/03/27 16:27:00 EST
628    Tag: blume-20020327-mlrisc-divisions
629    Description:
630    
631    Added support for all four division operations (ML's div, mod, quot,
632    and rem) to MLRISC.  In the course of doing so, I also rationalized
633    the naming (no more annoying switch-around of DIV and QUOT), by
634    parameterizing the operation by div_rounding_mode (which can be either
635    DIV_TO_ZERO or DIV_TO_NEGINF).
636    
637    The generic MLTreeGen functor takes care of compiling all four
638    operations down to only round-to-zero div.
639    
640    Missing pieces:
641    
642      * Doing something smarter than relying on MLTreeGen on architectures
643        like, e.g., the x86 where hardware division delivers both quotient and
644        remainder at the same time.  With this, the implementation of the
645        round-to-neginf operations could be further streamlined.
646    
647      * Remove inlining support for div/mod/rem from the frontend and replace it
648        with primops that get carried through to the backend.  Do this for all
649        int and word types.
650    
651    ----------------------------------------------------------------------
652    Name: Matthias Blume
653    Date: 2002/03/25 17:25:00 EST
654    Tag: blume-20020325-divmod
655    Description:
656    
657    I improved (hopefully without breaking them) the implementation of Int.div,
658    Int.mod, and Int.rem.   For this, the code in translate.sml now takes
659    advantage of the following observations:
660    
661      Let  q = x quot y      r = x rem y
662           d = x div  y      m = x mod y
663    
664    where "quot" is the round-to-zero version of integer division that
665    hardware usually provides.  Then we have:
666    
667         r = x - q * y        where neither the * nor the - will overflow
668         d = if q >= 0 orelse x = q * y then q else q - 1
669                              where neither the * nor the - will overflow
670         m = if q >= 0 orelse r = 0 then r else r + y
671                              where the + will not overflow
672    
673    This results in substantial simplification of the generated code.
674    The following table shows the number of CFG nodes and edges generated
675    for
676            fun f (x, y) = x OPER y
677            (* with OPER \in div, mod, quot, rem *)
678    
679    
680        OPER | nodes(old) | edges(old) | nodes(new) | edges(new)
681        --------------------------------------------------------
682         div |         24 |         39 |         12 |         16
683         mod |         41 |         71 |         12 |         16
684        quot |          8 |         10 |          8 |         10
685         rem |         10 |         14 |          8 |         10
686    
687    
688    ----------------------------------------------------------------------
689    Name: Matthias Blume
690    Date: 2002/03/25 22:06:00 EST
691    Tag: blume-20020325-cprotobug
692    Description:
693    
694    Fixed a bug in cproto (c prototype decoder).
695    
696    ----------------------------------------------------------------------
697    Name: Matthias Blume
698    Date: 2002/03/25 16:00:00 EST
699    Tag: blume-20020325-raw-primops
700    Description:
701    
702    I did some cleanup to Allen's new primop code and
703    replaced yesterday's bootfiles with new ones.
704    (But they are stored in the same place.)
705    
706    ----------------------------------------------------------------------
707    Name: Matthias Blume
708    Date: 2002/03/24 22:40:00 EST
709    Tag: blume-20020324-bootfiles
710    Description:
711    
712    Made the bootfiles that Allen asked for.
713    
714    ----------------------------------------------------------------------
715    Name: Allen Leung
716    Date: 2002/03/23 15:50:00 EST
717    Tag: leunga-20020323-flint-cps-rcc-primops
718    Description:
719    
720      1. Changes to FLINT primops:
721    
722        (* make a call to a C-function;
723         * The primop carries C function prototype information and specifies
724         * which of its (ML-) arguments are floating point. C prototype
725         * information is for use by the backend, ML information is for
726         * use by the CPS converter. *)
727      | RAW_CCALL of { c_proto: CTypes.c_proto,
728                       ml_args: ccall_type list,
729                       ml_res_opt: ccall_type option,
730                       reentrant : bool
731                     } option
732       (* Allocate uninitialized storage on the heap.
733        * The record is meant to hold short-lived C objects, i.e., they
734        * are not ML pointers.  With the tag, the representation is
735        * the same as RECORD with tag tag_raw32 (sz=4), or tag_fblock (sz=8)
736        *)
737      | RAW_RECORD of {tag:bool,sz:int}
738      and ccall_type = CCALL_INT32 | CCALL_REAL64 | CCALL_ML_PTR
739    
740      2.  These CPS primops are now overloaded:
741    
742           rawload of {kind:numkind}
743           rawstore of {kind:numkind}
744    
745          The one argument form is:
746    
747             rawload {kind} address
748    
749          The two argument form is:
750    
751             rawload {kind} [ml object, byte-offset]
752    
753      3. RAW_CCALL/RCC now takes two extra arguments:
754    
755         a. The first is whether the C call is reentrant, i.e., whether
756            ML state should be saved and restored.
757         b. The second argument is a string argument specifying the name of
758            library and the C function.
759    
760         These things are currently not handled in the code generator, yet.
761    
762      4. In CProto,
763    
764         An encoding type of "bool" means "ml object" and is mapped into
765         C prototype of PTR.  Note that "bool" is different than "string",
766         even though "string" is also mapped into PTR, because "bool"
767         is assigned an CPS type of BOGt, while "string" is assigned INT32t.
768    
769      5. Pickler/unpicker
770    
771         Changed to handle RAW_RECORD and newest RAW_CCALL
772    
773      6. MLRiscGen,
774    
775         1. Changed to handle the new rawload/rawstore/rawrecord operators.
776         2. Code for handling C Calls has been moved to a new module CPSCCalls,
777            in the file CodeGen/cpscompile/cps-c-calls.sml
778    
779      7. Added the conditional move operator
780    
781             condmove of branch
782    
783         to cps.  Generation of this is still buggy so it is currently
784         disabled.
785    
786    ----------------------------------------------------------------------
787    Name: Lal George
788    Date: 2002/03/22 14:18:25 EST
789    Tag: george-20020322-cps-branch-prob
790    Description:
791    
792    Implemented the Ball-Larus branch prediction-heuristics, and
793    incorporated graphical viewers for control flow graphs.
794    
795    Ball-Larus Heuristics:
796    ---------------------
797    See the file compiler/CodeGen/cpscompile/cpsBranchProb.sml.
798    
799    By design it uses the Dempster-Shafer theory for combining
800    probabilities.  For example, in the function:
801    
802        fun f(n,acc) = if n = 0 then acc else f(n-1, n*acc)
803    
804    the ball-larus heuristics predicts that the n=0 is unlikely
805    (OH-heuristic), and the 'then' branch is unlikely because of the
806    RH-heuristic -- giving the 'then' branch an even lower combined
807    probability using the Dempster-Shafer theory.
808    
809    Finally, John Reppy's loop analysis in MLRISC, further lowers the
810    probability of the 'then' branch because of the loop in the else
811    branch.
812    
813    
814    Graphical Viewing:
815    ------------------
816    I merely plugged in Allen's graphical viewers into the compiler. The
817    additional code is not much. At the top level, saying:
818    
819            Control.MLRISC.getFlag "cfg-graphical-view" := true;
820    
821    will display the graphical view of the control flow graph just before
822    back-patching.  daVinci must be in your path for this to work. If
823    daVinci is not available, then the default viewer can be changed
824    using:
825    
826            Control.MLRISC.getString "viewer"
827    
828    which can be set to "dot" or "vcg" for the corresponding viewers. Of
829    course, these viewers must be in your path.
830    
831    The above will display the compilation unit at the level of clusters,
832    many of which are small, boring, and un-interesting. Also setting:
833    
834            Control.MLRISC.getInt "cfg-graphical-view_size"
835    
836    will display clusters that are larger than the value set by the above.
837    
838    
839    ----------------------------------------------------------------------
840    Name: Matthias Blume
841    Date: 2002/03/21 22:20:00 EST
842    Tag: blume-20020321-kmp-bugfix
843    Description:
844    
845    Changed the interface to the KMP routine in PreString and fixed
846    a minor bug in one place where it was used.
847    
848    ----------------------------------------------------------------------
849    Name: Allen Leung
850    Date: 2002/03/21 20:30:00 EST
851    Tag: leunga-20020321-cfg
852    Description:
853    
854      Fixed a potential problem in cfg edge splitting.
855    
856    ----------------------------------------------------------------------
857    Name: Allen Leung
858    Date: 2002/03/21 17:15:00 EST
859    Tag: leunga-20020321-x86-fp-cfg
860    Description:
861    
862      1. Recoded the buggy parts of x86-fp.
863    
864         a. All the block reordering code has been removed.
865            We now depend on the block placement phases to do this work.
866    
867         b. Critical edge splitting code has been simplified and moved into the
868            CFG modules, as where they belong.
869    
870         Both of these were quite buggy and complex.  The code is now much, much
871         simpler.
872    
873      2. X86 backend.
874    
875         a. Added instructions for 64-bit support.  Instruction selection for
876            64-bit has not been committed, however, since that
877            requires changes to MLTREE which haven't been approved by
878            Lal and John.
879    
880         b. Added support for FUCOMI and FUCOMIP when generating code for
881            PentiumPro and above.  We only generate these instructions in
882            the fast-fp mode.
883    
884         c. Added cases for JP and JNP in X86FreqProps.
885    
886      3. CFG
887    
888         CFG now has a bunch of methods for edge splitting and merging.
889    
890      4. Machine description.
891    
892         John's simplification of MLTREE_BASIS.fcond broke a few machine
893         description things:
894    
895         rtl-build.{sig,sml} and hppa.mdl fixed.
896    
897         NOTE: the machine description stuff in the repository is still broken.
898               Again, I can't put my fixes in because that involves
899               changes to MLTREE.
900    
901    ----------------------------------------------------------------------
902    Name: Matthias Blume
903    Date: 2002/03/20 15:55:00 EST
904    Tag: blume-20020320-kmp
905    Description:
906    
907    Implemented Knuth-Morris-Pratt string matching in PreString and used
908    it for String.isSubstring, Substring.isSubstring, and
909    Substring.position.
910    
911    (Might need some stress-testing.  Simple examples worked fine.)
912    
913    ----------------------------------------------------------------------
914    Name: Matthias Blume
915    Date: 2002/03/19 16:37:00 EST
916    Tag: blume-20020319-witnesses
917    Description:
918    
919    Added a structure C.W and functions convert/Ptr.convert to ml-nlffi-lib.
920    
921    This implements a generic mechanism for changing constness qualifiers
922    anywhere within big C types without resorting to outright "casts".
923    (So far, functions such as C.rw/C.ro or C.Ptr.rw/C.Ptr.ro only let you
924    modify the constness at the outermost level.)
925    The implementation of "convert" is based on the idea of "witness"
926    values -- values that are not used by the operation but whose types
927    "testify" to their applicability.  On the implementation side, "convert"
928    is simply a projection (returning its second curried argument).  With
929    cross-module inlining, it should not result in any machine code being
930    generated.
931    
932    ----------------------------------------------------------------------
933    Name: Matthias Blume
934    Date: 2002/03/15 16:40:00 EST
935    Tag: blume-20020315-basis
936    Description:
937    
938    Provided (preliminary?) implementations for
939    
940      {String,Substring}.{concatWith,isSuffix,isSubstring}
941    
942    and
943    
944      Substring.full
945    
946    Those are in the Basis spec but they were missing in SML/NJ.
947    
948    ----------------------------------------------------------------------
949    Name: Matthias Blume
950    Date: 2002/03/14 21:30:00 EST
951    Tag: blume-20020314-controls
952    Description:
953    
954    Controls:
955    ---------
956    
957    1. Factored out the recently-added Controls : CONTROLS stuff and put
958       it into its own library $/controls-lib.cm.  The source tree for
959       this is under src/smlnj-lib/Controls.
960    
961    2. Changed the names of types and functions in this interface, so they
962       make a bit more "sense":
963    
964          module -> registry
965          'a registry -> 'a group
966    
967    3. The interface now deals in ref cells only.  The getter/setter interface
968       is (mostly) gone.
969    
970    4. Added a function that lets one register an already-existing ref cell.
971    
972    5. Made the corresponding modifications to the rest of the code so that
973       everything compiles again.
974    
975    6. Changed the implementation of Controls.MLRISC back to something closer
976       to the original.  In particular, this module (and therefore MLRISC)
977       does not depend on Controls.  There now is some link-time code in
978       int-sys.sml that registers the MLRISC controls with the Controls
979       module.
980    
981    CM:
982    ---
983    
984      * One can now specify the lambda-split aggressiveness in init.cmi.
985    
986    ----------------------------------------------------------------------
987    Name: Allen Leung
988    Date: 2002/03/13 17:30:00 EST
989    Tag: leunga-20020313-x86-fp-unary
990    Description:
991    
992    Bug fix for:
993    
994    > leunga@weaselbane:~/Yale/tmp/sml-dist{21} bin/sml
995    > Standard ML of New Jersey v110.39.1 [FLINT v1.5], March 08, 2002
996    > - fun f(x,(y,z)) = Real.~ y;
997    > [autoloading]
998    > [autoloading done]
999    >       fchsl   (%eax), 184(%esp)
1000    > Error: MLRisc bug: X86MCEmitter.emitInstr
1001    >
1002    > uncaught exception Error
1003    >   raised at: ../MLRISC/control/mlriscErrormsg.sml:16.14-16.19
1004    
1005    The problem was that the code generator did not generate any fp registers
1006    in this case, and the ra didn't know that it needed to run the X86FP phase to
1007    translate the pseudo fp instruction.   This only happened with unary fp
1008    operators in certain situations.
1009    
1010    ----------------------------------------------------------------------
1011    Name: Matthias Blume
1012    Date: 2002/03/13 14:00:00 EST
1013    Tag: blume-20020313-overload-etc
1014    Description:
1015    
1016    1. Added _overload as a synonym for overload for backward compatibility.
1017       (Control.overloadKW must be true for either version to be accepted.)
1018    
1019    2. Fixed bug in install script that caused more things to be installed
1020       than what was requested in config/targets.
1021    
1022    3. Made CM aware of the (_)overload construct so that autoloading
1023       works.
1024    
1025    ----------------------------------------------------------------------
1026    Name: Matthias Blume
1027    Date: 2002/03/12 22:03:00 EST
1028    Tag: blume-20020312-url
1029    Description:
1030    
1031    Forgot to update BOOT and srcarchiveurl.
1032    
1033    ----------------------------------------------------------------------
1034    Name: Matthias Blume
1035    Date: 2002/03/12 17:30:00 EST
1036    Tag: blume-20020312-version110392
1037    Description:
1038    
1039    Yet another version number bump (because of small changes to the
1040    binfile format).  Version number is now 110.39.2.  NEW BOOTFILES!
1041    
1042    Changes:
1043    
1044      The new pid generation scheme described a few weeks ago was overly
1045      complicated.  I implemented a new mechanism that is simpler and
1046      provides a bit more "stability":  Once CM has seen a compilation
1047      unit, it keeps its identity constant (as long as you do not delete
1048      those crucial CM/GUID/* files).  This means that when you change
1049      an interface, compile, then go back to the old interface, and
1050      compile again, you arrive at the original pid.
1051    
1052      There now also is a mechanism that instructs CM to use the plain
1053      environment hash as a module's pid (effectively making its GUID
1054      the empty string).  For this, "noguid" must be specified as an
1055      option to the .sml file in question within its .cm file.
1056      This is most useful for code that is being generated by tools such
1057      as ml-nlffigen (because during development programmers tend to
1058      erase the tool's entire output directory tree including CM's cached
1059      GUIDs).  "noguid" is somewhat dangerous (since it can be used to locally
1060      revert to the old, broken behavior of SML/NJ, but in specific cases
1061      where there is no danger of interface confusion, its use is ok
1062      (I think).
1063    
1064      ml-nlffigen by default generates "noguid" annotations.  They can be
1065      turned off by specifying -guid in its command line.
1066    
1067    ----------------------------------------------------------------------
1068    Name: Lal George
1069    Date: 2002/03/12 12 14:42:36 EST
1070    Tag: george-20020312-frequency-computation
1071    Description:
1072    
1073    Integrated jump chaining and static block frequency into the
1074    compiler. More details and numbers later.
1075    
1076    ----------------------------------------------------------------------
1077    Name: Lal George
1078    Date: 2002/03/11 11 22:38:53 EST
1079    Tag: george-20020311-jump-chain-elim
1080    Description:
1081    
1082    Tested the jump chain elimination on all architectures (except the
1083    hppa).  This is on by default right now and is profitable for the
1084    alpha and x86, however, it may not be profitable for the sparc and ppc
1085    when compiling the compiler.
1086    
1087    The gc test will typically jump to a label at the end of the cluster,
1088    where there is another jump to an external cluster containing the actual
1089    code to invoke gc. This is to allow factoring of common gc invocation
1090    sequences. That is to say, we generate:
1091    
1092            f:
1093               testgc
1094               ja   L1      % jump if above to L1
1095    
1096            L1:
1097               jmp L2
1098    
1099    
1100    After jump chain elimination the 'ja L1' instructions is converted to
1101    'ja L2'. On the sparc and ppc, many of the 'ja L2' instructions may end
1102    up being implemented in their long form (if L2 is far away) using:
1103    
1104            jbe     L3      % jump if below or equal to L3
1105            jmp     L2
1106         L3:
1107            ...
1108    
1109    
1110    For large compilation units L2  may be far away.
1111    
1112    
1113    ----------------------------------------------------------------------
1114    Name: Matthias Blume
1115    Date: 2002/03/11 13:30:00 EST
1116    Tag: blume-20020311-mltreeeval
1117    Description:
1118    
1119    A functor parameter was missing.
1120    
1121    ----------------------------------------------------------------------
1122    Name: Allen Leung
1123    Date: 2002/03/11 10:30:00 EST
1124    Tag: leunga-20020311-runtime-string0
1125    Description:
1126    
1127       The representation of the empty string now points to a
1128    legal null terminated C string instead of unit.  It is now possible
1129    to convert an ML string into C string with InlineT.CharVector.getData.
1130    This compiles into one single machine instruction.
1131    
1132    ----------------------------------------------------------------------
1133    Name: Allen Leung
1134    Date: 2002/03/10 23:55:00 EST
1135    Tag: leunga-20020310-x86-call
1136    Description:
1137    
1138       Added machine generation for CALL instruction (relative displacement mode)
1139    
1140    ----------------------------------------------------------------------
1141    Name: Matthias Blume
1142    Date: 2002/03/08 16:05:00
1143    Tag: blume-20020308-entrypoints
1144    Description:
1145    
1146    Version number bumped to 110.39.1.  NEW BOOTFILES!
1147    
1148    Entrypoints: non-zero offset into a code object where execution should begin.
1149    
1150    - Added the notion of an entrypoint to CodeObj.
1151    - Added reading/writing of entrypoint info to Binfile.
1152    - Made runtime system bootloader aware of entrypoints.
1153    - Use the address of the label of the first function given to mlriscGen
1154      as the entrypoint.  This address is currently always 0, but it will
1155      not be 0 once we turn on block placement.
1156    - Removed the linkage cluster code (which was The Other Way(tm) of dealing
1157      with entry points) from mlriscGen.
1158    
1159    ----------------------------------------------------------------------
1160    Name: Allen Leung
1161    Date: 2002/03/07 20:45:00 EST
1162    Tag: leunga-20020307-x86-cmov
1163    Description:
1164    
1165       Bug fixes for CMOVcc on x86.
1166    
1167       1. Added machine code generation for CMOVcc
1168       2. CMOVcc is now generated in preference over SETcc on PentiumPro or above.
1169       3. CMOVcc cannot have an immediate operand as argument.
1170    
1171    ----------------------------------------------------------------------
1172    Name: Matthias Blume
1173    Date: 2002/03/07 16:15:00 EST
1174    Tag: blume-20020307-controls
1175    Description:
1176    
1177    This is a very large but mostly boring patch which makes (almost)
1178    every tuneable compiler knob (i.e., pretty much everything under
1179    Control.* plus a few other things) configurable via both the command
1180    line and environment variables in the style CM did its configuration
1181    until now.
1182    
1183    Try starting sml with '-h' (or, if you are brave, '-H')
1184    
1185    To this end, I added a structure Controls : CONTROLS to smlnj-lib.cm which
1186    implements the underlying generic mechanism.
1187    
1188    The interface to some of the existing such facilities has changed somewhat.
1189    For example, the MLRiscControl module now provides mkFoo instead of getFoo.
1190    (The getFoo interface is still there for backward-compatibility, but its
1191    use is deprecated.)
1192    
1193    The ml-build script passes -Cxxx=yyy command-line arguments through so
1194    that one can now twiddle the compiler settings when using this "batch"
1195    compiler.
1196    
1197    TODO items:
1198    
1199    We should go through and throw out all controls that are no longer
1200    connected to anything.  Moreover, we should go through and provide
1201    meaningful (and correct!) documentation strings for those controls
1202    that still are connected.
1203    
1204    Currently, multiple calls to Controls.new are accepted (only the first
1205    has any effect).  Eventually we should make sure that every control
1206    is being made (via Controls.new) exactly once.  Future access can then
1207    be done using Controls.acc.
1208    
1209    Finally, it would probably be a good idea to use the getter-setter
1210    interface to controls rather than ref cells.  For the time being, both
1211    styles are provided by the Controls module, but getter-setter pairs are
1212    better if thread-safety is of any concern because they can be wrapped.
1213    
1214    *****************************************
1215    
1216    One bug fix: The function blockPlacement in three of the MLRISC
1217    backpatch files used to be hard-wired to one of two possibilities at
1218    link time (according to the value of the placementFlag).  But (I
1219    think) it should rather sense the flag every time.
1220    
1221    *****************************************
1222    
1223    Other assorted changes (by other people who did not supply a HISTORY entry):
1224    
1225    1. the cross-module inliner now works much better (Monnier)
1226    2. representation of weights, frequencies, and probabilities in MLRISC
1227       changed in preparation of using those for weighted block placement
1228       (Reppy, George)
1229    
1230    ----------------------------------------------------------------------
1231    Name: Lal George
1232    Date: 2002/03/07 14:44:24 EST 2002
1233    Tag: george-20020307-weighted-block-placement
1234    
1235    Tested the weighted block placement optimization on all architectures
1236    (except the hppa) using AMPL to generate the block and edge frequencies.
1237    Changes were required in the machine properties to correctly
1238    categorize trap instructions. There is an MLRISC flag
1239    "weighted-block-placement" that can be used to enable weighted block
1240    placement, but this will be ineffective without block/edge
1241    frequencies (coming soon).
1242    
1243    
1244    ----------------------------------------------------------------------
1245    Name: Lal George
1246    Date: 2002/03/05 17:24:48 EST
1247    Tag: george-20020305-linkage-cluster
1248    
1249    In order to support the block placement optimization, a new cluster
1250    is generated as the very first cluster (called the linkage cluster).
1251    It contains a single jump to the 'real' entry point for the compilation
1252    unit. Block placement has no effect on the linkage cluster itself, but
1253    all the other clusters  have full freedom in the manner in which they
1254    reorder blocks or functions.
1255    
1256    On the x86 the typical linkage code that is generated is:
1257       ----------------------
1258            .align 2
1259       L0:
1260            addl    $L1-L0, 72(%esp)
1261            jmp     L1
1262    
1263    
1264            .align  2
1265       L1:
1266       ----------------------
1267    
1268    72(%esp) is the memory location for the stdlink register. This
1269    must contain the address of the CPS function being called. In the
1270    above example, it contains the address of  L0; before
1271    calling L1 (the real entry point for the compilation unit), it
1272    must contain the address for L1, and hence
1273    
1274            addl $L1-L0, 72(%esp)
1275    
1276    I have tested this on all architectures except the hppa.The increase
1277    in code size is of course negligible
1278    
1279    ----------------------------------------------------------------------
1280    Name: Allen Leung
1281    Date: 2002/03/03 13:20:00 EST
1282    Tag: leunga-20020303-mlrisc-tools
1283    
1284      Added #[ ... ] expressions to mlrisc tools
1285    
1286    ----------------------------------------------------------------------
1287    Name: Matthias Blume
1288    Date: 2002/02/27 12:29:00 EST
1289    Tag: blume-20020227-cdebug
1290    Description:
1291    
1292    - made types in structure C and C_Debug to be equal
1293    - got rid of code duplication (c-int.sml vs. c-int-debug.sml)
1294    - there no longer is a C_Int_Debug (C_Debug is directly derived from C)
1295    
1296    ----------------------------------------------------------------------
1297    Name: Matthias Blume
1298    Date: 2002/02/26 12:00:00 EST
1299    Tag: blume-20020226-ffi
1300    Description:
1301    
1302    1. Fixed a minor bug in CM's "noweb" tool:
1303       If numbering is turned off, then truly don't number (i.e., do not
1304       supply the -L option to noweb).  The previous behavior was to supply
1305       -L'' -- which caused noweb to use the "default" line numbering scheme.
1306       Thanks to Chris Richards for pointing this out (and supplying the fix).
1307    
1308    2. Once again, I reworked some aspects of the FFI:
1309    
1310       A. The incomplete/complete type business:
1311    
1312       - Signatures POINTER_TO_INCOMPLETE_TYPE and accompanying functors are
1313         gone!
1314       - ML types representing an incomplete type are now *equal* to
1315         ML types representing their corresponding complete types (just like
1316         in C).  This is still safe because ml-nlffigen will not generate
1317         RTTI for incomplete types, nor will it generate functions that
1318         require access to such RTTI.   But when ML code generated from both
1319         incomplete and complete versions of the C type meet, the ML types
1320         are trivially interoperable.
1321    
1322         NOTE:  These changes restore the full generality of the translation
1323         (which was previously lost when I eliminated functorization)!
1324    
1325       B. Enum types:
1326    
1327       - Structure C now has a type constructor "enum" that is similar to
1328         how the "su" constructor works.  However, "enum" is not a phantom
1329         type because each "T enum" has values (and is isomorphic to
1330         MLRep.Signed.int).
1331       - There are generic access operations for enum objects (using
1332         MLRep.Signed.int).
1333       - ml-nlffigen will generate a structure E_foo for each "enum foo".
1334         * The structure contains the definition of type "mlrep" (the ML-side
1335         representation type of the enum).  Normally, mlrep is the same
1336         as "MLRep.Signed.int", but if ml-nlffigen was invoked with "-ec",
1337         then mlrep will be defined as a datatype -- thus facilitating
1338         pattern matching on mlrep values.
1339         ("-ec" will be suppressed if there are duplicate values in an
1340          enumeration.)
1341         * Constructors ("-ec") or values (no "-ec") e_xxx of type mlrep
1342         will be generated for each C enum constant xxx.
1343         * Conversion functions m2i and i2m convert between mlrep and
1344         MLRep.Signed.int.  (Without "-ec", these functions are identities.)
1345         * Coversion functions c and ml convert between mlrep and "tag enum".
1346         * Access functions (get/set) fetch and store mlrep values.
1347       - By default (unless ml-nlffigen was invoked with "-nocollect"), unnamed
1348         enumerations are merged into one single enumeration represented by
1349         structure E_'.
1350    
1351    ----------------------------------------------------------------------
1352    Name: Allen Leung
1353    Date: 2002/02/25 04:45:00 EST
1354    Tag: leunga-20020225-cps-spill
1355    
1356    This is a new implementation of the CPS spill phase.
1357    The new phase is in the new file compiler/CodeGen/cpscompile/spill-new.sml
1358    In case of problems, replace it with the old file spill.sml
1359    
1360    The current compiler runs into some serious performance problems when
1361    constructing a large record.  This can happen when we try to compile a
1362    structure with many items.  Even a very simple structure like the following
1363    makes the compiler slow down.
1364    
1365        structure Foo = struct
1366           val x_1 = 0w1 : Word32.int
1367           val x_2 = 0w2 : Word32.int
1368           val x_3 = 0w3 : Word32.int
1369           ...
1370           val x_N = 0wN : Word32.int
1371        end
1372    
1373    The following table shows the compile time, from N=1000 to N=4000,
1374    with the old compiler:
1375    
1376    N
1377    1000   CPS 100 spill                           0.04u  0.00s  0.00g
1378           MLRISC ra                               0.06u  0.00s  0.05g
1379              (spills = 0 reloads = 0)
1380           TOTAL                                   0.63u  0.07s  0.21g
1381    
1382    1100   CPS 100 spill                           8.25u  0.32s  0.64g
1383           MLRISC ra                               5.68u  0.59s  3.93g
1384              (spills = 0 reloads = 0)
1385           TOTAL                                   14.71u  0.99s  4.81g
1386    
1387    1500   CPS 100 spill                           58.55u  2.34s  1.74g
1388           MLRISC ra                               5.54u  0.65s  3.91g
1389              (spills = 543 reloads = 1082)
1390           TOTAL                                   65.40u  3.13s  6.00g
1391    
1392    2000   CPS 100 spill                           126.69u  4.84s  3.08g
1393           MLRISC ra                               0.80u  0.10s  0.55g
1394              (spills = 42 reloads = 84)
1395           TOTAL                                   129.42u  5.10s  4.13g
1396    
1397    3000   CPS 100 spill                           675.59u  19.03s  11.64g
1398           MLRISC ra                               2.69u  0.27s  1.38g
1399              (spills = 62 reloads = 124)
1400           TOTAL                                   682.48u  19.61s  13.99g
1401    
1402    4000   CPS 100 spill                           2362.82u  56.28s  43.60g
1403           MLRISC ra                               4.96u  0.27s  2.72g
1404              (spills = 85 reloads = 170)
1405           TOTAL                                   2375.26u  57.21s  48.00g
1406    
1407    As you can see the old cps spill module suffers from some serious
1408    performance problem.  But since I cannot decipher the old code fully,
1409    instead of patching the problems up, I'm reimplementing it
1410    with a different algorithm.  The new code is more modular,
1411    smaller when compiled, and substantially faster
1412    (O(n log n) time and O(n) space).  Timing of the new spill module:
1413    
1414    4000  CPS 100 spill                           0.02u  0.00s  0.00g
1415          MLRISC ra                               0.25u  0.02s  0.15g
1416             (spills=1 reloads=3)
1417          TOTAL                                   7.74u  0.34s  1.62g
1418    
1419    Implementation details:
1420    
1421    As far as I can tell, the purpose of the CPS spill module is to make sure the
1422    number of live variables at any program point (the bandwidth)
1423    does not exceed a certain limit, which is determined by the
1424    size of the spill area.
1425    
1426    When the bandwidth is too large, we decrease the register pressure by
1427    packing live variables into spill records.  How we achieve this is
1428    completely different than what we did in the old code.
1429    
1430    First, there is something about the MLRiscGen code generator
1431    that we should be aware of:
1432    
1433    o MLRiscGen performs code motion!
1434    
1435       In particular, it will move floating point computations and
1436       address computations involving only the heap pointer to
1437       their use sites (if there is only a single use).
1438       What this means is that if we have a CPS record construction
1439       statement
1440    
1441           RECORD(k,vl,w,e)
1442    
1443       we should never count the new record address w as live if w
1444       has only one use (which is often the case).
1445    
1446       We should do something similar to floating point, but the transformation
1447       there is much more complex, so I won't deal with that.
1448    
1449    Secondly, there are now two new cps primops at our disposal:
1450    
1451     1. rawrecord of record_kind option
1452        This pure operator allocates some uninitialized storage from the heap.
1453        There are two forms:
1454    
1455         rawrecord NONE [INT n]  allocates a tagless record of length n
1456         rawrecord (SOME rk) [INT n] allocates a tagged record of length n
1457                                     and initializes the tag.
1458    
1459     2. rawupdate of cty
1460          rawupdate cty (v,i,x)
1461          Assigns to x to the ith component of record v.
1462          The storelist is not updated.
1463    
1464    We use these new primops for both spilling and increment record construction.
1465    
1466     1. Spilling.
1467    
1468        This is implemented with a linear scan algorithm (but generalized
1469        to trees).  The algorithm will create a single spill record at the
1470        beginning of the cps function and use rawupdate to spill to it,
1471        and SELECT or SELp to reload from it.  So both spills and reloads
1472        are fine-grain operations.  In contrast, in the old algorithm
1473        "spills" have to be bundled together in records.
1474    
1475        Ideally, we should sink the spill record construction to where
1476        it is needed.  We can even split the spill record into multiple ones
1477        at the places where they are needed.  But CPS is not a good
1478        representation for global code motion, so I'll keep it simple and
1479        am not attempting this.
1480    
1481     2. Incremental record construction (aka record splitting).
1482    
1483        Long records with many component values which are simulatenously live
1484        (recall that single use record addresses are not considered to
1485         be live) are constructed with rawrecord and rawupdate.
1486        We allocate space on the heap with rawrecord first, then gradually
1487        fill it in with rawupdate.  This is the technique suggested to me
1488        by Matthias.
1489    
1490        Some restrictions on when this is applicable:
1491        1. It is not a VECTOR record.  The code generator currently does not handle
1492           this case. VECTOR record uses double indirection like arrays.
1493        2. All the record component values are defined in the same "basic block"
1494           as the record constructor.  This is to prevent speculative
1495           record construction.
1496    
1497    ----------------------------------------------------------------------
1498    Name: Allen Leung
1499    Date: 2002/02/22 01:02:00 EST
1500    Tag: leunga-20020222-mlrisc-tools
1501    
1502    Minor bug fixes in the parser and rewriter
1503    
1504    ----------------------------------------------------------------------
1505    Name: Allen Leung
1506    Date: 2002/02/21 20:20:00 EST
1507    Tag: leunga-20020221-peephole
1508    
1509    Regenerated the peephole files.  Some contained typos in the specification
1510    and some didn't compile because of pretty printing bugs in the old version
1511    of 'nowhere'.
1512    
1513    ----------------------------------------------------------------------
1514    Name: Allen Leung
1515    Date: 2002/02/19 20:20:00 EST
1516    Tag: leunga-20020219-mlrisc-tools
1517    Description:
1518    
1519       Minor bug fixes to the mlrisc-tools library:
1520    
1521       1.  Fixed up parsing colon suffixed keywords
1522       2.  Added the ability to shut the error messages up
1523       3.  Reimplemented the pretty printer and fixed up/improved
1524           the pretty printing of handle and -> types.
1525       4.  Fixed up generation of literal symbols in the nowhere tool.
1526       5.  Added some SML keywords to to sml.sty
1527    
1528    ----------------------------------------------------------------------
1529    Name: Matthias Blume
1530    Date: 2002/02/19 16:20:00 EST
1531    Tag: blume-20020219-cmffi
1532    Description:
1533    
1534    A wild mix of changes, some minor, some major:
1535    
1536    * All C FFI-related libraries are now anchored under $c:
1537        $/c.cm      --> $c/c.cm
1538        $/c-int.cm  --> $c/internals/c-int.cm
1539        $/memory.cm --> $c/memory/memory.cm
1540    
1541    * "make" tool (in CM) now treats its argument pathname slightly
1542      differently:
1543        1. If the native expansion is an absolute name, then before invoking
1544           the "make" command on it, CM will apply OS.Path.mkRelative
1545           (with relativeTo = OS.FileSys.getDir()) to it.
1546        2. The argument will be passed through to subsequent phases of CM
1547           processing without "going native".  In particular, if the argument
1548           was an anchored path, then "make" will not lose track of that anchor.
1549    
1550    * Compiler backends now "know" their respective C calling conventions
1551      instead of having to be told about it by ml-nlffigen.  This relieves
1552      ml-nlffigen from one of its burdens.
1553    
1554    * The X86Backend has been split into X86CCallBackend and X86StdCallBackend.
1555    
1556    * Export C_DEBUG and C_Debug from $c/c.cm.
1557    
1558    * C type encoding in ml-nlffi-lib has been improved to model the conceptual
1559      subtyping relationship between incomplete pointers and their complete
1560      counterparts.  For this, ('t, 'c) ptr has been changed to 'o ptr --
1561      with the convention of instantiating 'o with ('t, 'c) obj whenever
1562      the pointer target type is complete.  In the incomplete case, 'o
1563      will be instantiated with some "'c iobj" -- a type obtained by
1564      using one of the functors PointerToIncompleteType or PointerToCompleteType.
1565    
1566      Operations that work on both incomplete and complete pointer types are
1567      typed as taking an 'o ptr while operations that require the target to
1568      be known are typed as taking some ('t, 'c) obj ptr.
1569    
1570      voidptr is now a bit "more concrete", namely "type voidptr = void ptr'"
1571      where void is an eqtype without any values.  This makes it possible
1572      to work on voidptr values using functions meant to operate on light
1573      incomplete pointers.
1574    
1575    * As a result of the above, signature POINTER_TO_INCOMPLETE_TYPE has
1576      been vastly simplified.
1577    
1578    ----------------------------------------------------------------------
1579    Name: Matthias Blume
1580    Date: 2002/02/19 10:48:00 EST
1581    Tag: blume-20020219-pqfix
1582    Description:
1583    
1584    Applied Chris Okasaki's bug fix for priority queues.
1585    
1586    ----------------------------------------------------------------------
1587    Name: Matthias Blume
1588    Date: 2002/02/15 17:05:00
1589    Tag: Release_110_39
1590    Description:
1591    
1592    Last-minute retagging is becoming a tradition... :-(
1593    
1594    This is the working release 110.39.
1595    
1596    ----------------------------------------------------------------------
1597    Name: Matthias Blume
1598    Date: 2002/02/15 16:00:00 EST
1599    Tag: Release_110_39-orig
1600    Description:
1601    
1602    Working release 110.39.  New bootfiles.
1603    
1604    (Update: There was a small bug in the installer so it wouldn't work
1605    with all shells.  So I retagged. -Matthias)
1606    
1607    ----------------------------------------------------------------------
1608    Name: Matthias Blume
1609    Date: 2002/02/15 14:17:00 EST
1610    Tag: blume-20020215-showbindings
1611    Description:
1612    
1613    Added EnvRef.listBoundSymbols and CM.State.showBindings.  Especially
1614    the latter can be useful for exploring what bindings are available at
1615    the interactive prompt.  (The first function returns only the list
1616    of symbols that are really bound, the second prints those but also the
1617    ones that CM's autoloading mechanism knows about.)
1618    
1619    ----------------------------------------------------------------------
1620    Name: Matthias Blume
1621    Date: 2002/02/15 12:08:00 EST
1622    Tag: blume-20020215-iptrs
1623    Description:
1624    
1625    Two improvements to ml-nlffigen:
1626    
1627      1. Write files only if they do not exist or if their current contents
1628         do not coincide with what's being written.  (That is, avoid messing
1629         with the time stamps unless absolutely necessary.)
1630    
1631      2. Implement a "repository" mechanism for generated files related
1632         to "incomplete pointer types".   See the README file for details.
1633    
1634    ----------------------------------------------------------------------
1635    Name: Matthias Blume
1636    Date: 2002/02/14 11:50:00 EST
1637    Tag: blume-20020214-quote
1638    Description:
1639    
1640    Added a type 't t_' to tag.sml (in ml-nlffi-lib.cm).  This is required
1641    because of the new and improved tag generation scheme.  (Thanks to Allen
1642    Leung for pointing it out.)
1643    
1644    ----------------------------------------------------------------------
1645    Name: Lal George
1646    Date: 2002/02/14 09:55:27 EST 2002
1647    Tag: george-20020214-isabelle-bug
1648    Description:
1649    
1650    Fixed the MLRISC bug sent by Markus Wenzel regarding the compilation
1651    of Isabelle on the x86.
1652    
1653    From Allen:
1654    -----------
1655     I've found the problem:
1656    
1657         in ra-core.sml, I use the counter "blocked" to keep track of the
1658         true number of elements in the freeze queue.  When the counter goes
1659         to zero, I skip examining the queue.  But I've messed up the
1660         bookkeeping in combine():
1661    
1662             else ();
1663             case !ucol of
1664               PSEUDO => (if !cntv > 0 then
1665                     (if !cntu > 0 then blocked := !blocked - 1 else ();
1666                                        ^^^^^^^^^^^^^^^^^^^^^^^
1667                      moveu := mergeMoveList(!movev, !moveu)
1668                     )
1669                  else ();
1670    
1671         combine() is called to coalesce two nodes u and v.
1672         I think I was thinking that if the move counts of u and v are both
1673         greater than zero then after they are coalesced then one node is
1674         removed from the freeze queue.  Apparently I was thinking that
1675         both u and v are of low degree, but that's clearly not necessarily true.
1676    
1677    
1678    02/12/2002:
1679        Here's the patch.  HOL now compiles.
1680    
1681        I don't know how this impact on performance (compile
1682        time or runtime).  This bug caused the RA (especially on the x86)
1683        to go thru the potential spill phase when there are still nodes on the
1684        freeze queue.
1685    
1686    
1687    
1688    
1689    ----------------------------------------------------------------------
1690    Name: Matthias Blume
1691    Date: 2002/02/13 22:40:00 EST
1692    Tag: blume-20020213-fptr-rtti
1693    Description:
1694    
1695    Fixed a bug in ml-nlffigen that was introduced with one of the previous
1696    updates.
1697    
1698    ----------------------------------------------------------------------
1699    Name: Matthias Blume
1700    Date: 2002/02/13 16:41:00 EST
1701    Tag: blume-20020213-cmlpq
1702    Description:
1703    
1704    Added new priority queue export symbols (which have just been added to
1705    smlnj-lib.cm) to CML's version of smlnj-lib.cm.  (Otherwise CML would
1706    not compile and the installer would choke.)
1707    
1708    ----------------------------------------------------------------------
1709    Name: Matthias Blume
1710    Date: 2002/02/13 16:15:00 EST
1711    Tag: blume-20020213-various
1712    Description:
1713    
1714    1. More tweaks to ml-nlffigen:
1715    
1716       - better internal datastructures (resulting in slight speedup)
1717       - "-match" option requires exact match
1718       - "localized" gensym counters (untagged structs/unions nested within
1719         other structs/unions or within typedefs get a fresh counter; their
1720         tag will be prefixed by a concatenation of their parents' tags)
1721       - bug fixes (related to calculation of transitive closure of types
1722         to be included in the output)
1723    
1724    2. Minor Basis updates:
1725    
1726       - added implementations for List.collate and Option.app
1727    
1728    ----------------------------------------------------------------------
1729    Name: Matthias Blume
1730    Date: 2002/02/11 15:55:00 EST
1731    Tag: blume-20020211-gensym
1732    Description:
1733    
1734    Added a "-gensym" option to command line of ml-nlffigen.  This can be
1735    used to specify a "stem" -- a string that is inserted in all "gensym'd"
1736    names (ML structure names that correspond to unnamed C structs, unions,
1737    and enums), so that separate runs of ml-nlffigen do not clash.
1738    
1739    ----------------------------------------------------------------------
1740    Name: Matthias Blume
1741    Date: 2002/02/11 12:05:00 EST
1742    Tag: blume-20020211-gensml
1743    Description:
1744    
1745    A quick fix for a problem with GenSML (in the pgraph-util library):
1746    Make generation of toplevel "local" optional.  (Strictly speaking,
1747    signature definitions within "local" are not legal SML.)
1748    
1749    Other than that: updates to INSTALL and cm/TODO.
1750    
1751    ----------------------------------------------------------------------
1752    Name: Matthias Blume
1753    Date: 2002/02/08 15:00:00 EST
1754    Tag: blume-20020208-uniquepid
1755    Description:
1756    
1757    0. Version number has been bumped to 110.38.1.  NEW BOOTFILES!!!
1758    
1759    1. The installer (config/install.sh) has gotten smarter:
1760    
1761         - Configuration options are a bit easier to specify now
1762           (in config/targets).
1763         - Bug in recognizing .tar.bz2 files fixed.
1764         - Installer automatically resolves dependencies between
1765           configuration options (e.g., if you ask for eXene, you will
1766           also get cml -- regardless whether you asked for it or not).
1767         - Installer can run in "quieter mode" by setting the environment
1768           variable INSTALL_QUIETLY to "true".  "Quieter" does not mean
1769           "completely silent", though.
1770         - Build HashCons library as part of smlnj-lib.
1771    
1772    2. A new scheme for assigning persistent identifiers to compilation
1773       units (and, by extension, to types etc.) has been put into place.
1774       This fixes a long-standing bug where types and even dynamic values
1775       can get internally confused, thereby compromising type safety
1776       (abstraction) and dynamic correctness.  See
1777    
1778         http://cm.bell-labs.com/cm/cs/who/blume/pid-confusion.tgz
1779    
1780       for an example of how things could go wrong until now.
1781    
1782       The downside of the new scheme is that pids are not quite as
1783       persistent as they used to be: CM will generate a fresh pid
1784       for every compilation unit that it thinks it sees for the first
1785       time.  That means that if you compile starting from a clean, fresh
1786       source tree at two different times, you end up with different
1787       binaries.
1788    
1789       Cutoff recompilation, however, has not been compromised because
1790       CM keeps pid information in special caches between runs.
1791    
1792    ----------------------------------------------------------------------
1793    Name: Lal George
1794    Date: 2002/02/07 15:34:13 EST 2002
1795    Tag: <none>
1796    Description:
1797    
1798    Compilers that generate assembly code may produce  global labels
1799    whose value is resolved at link time. The various peephole optimization
1800    modules did not take this in account.
1801    
1802    TODO. The Labels.addrOf function should really return an option
1803    type so that clients are forced to deal with this issue, rather
1804    than an exception being raised.
1805    
1806    ----------------------------------------------------------------------
1807  Name: Lal George  Name: Lal George
1808  Date: 2002/02/06 13:55:02 EST  Date: 2002/02/06 13:55:02 EST
1809  Tag: george-20020206-ra-breakup  Tag: george-20020206-ra-breakup
# Line 26  Line 1817 
1817      trap instruction (in this case they are harmless since none of the      trap instruction (in this case they are harmless since none of the
1818      integers overflow.)      integers overflow.)
1819    
1820  2. Plugged out various utility modules that were embedded in the modules  2. Pulled out various utility modules that were embedded in the modules
1821     of the register allocator. I need these modules for other purposes, but     of the register allocator. I need these modules for other purposes, but
1822     they are not complete enough to put into a library just yet.     they are not complete enough to put into a library (just yet).
1823  ----------------------------------------------------------------------  ----------------------------------------------------------------------
1824  Name: Matthias Blume  Name: Matthias Blume
1825  Date: 2002/01/31 16:05:00 EST  Date: 2002/01/31 16:05:00 EST

Legend:
Removed from v.1053  
changed lines
  Added in v.1343

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