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

Legend:
Removed from v.1063  
changed lines
  Added in v.1348

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