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

Legend:
Removed from v.1080  
changed lines
  Added in v.1353

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