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 1174, Sat Mar 23 21:14:40 2002 UTC revision 1186, Fri Apr 12 17:54:31 2002 UTC
# Line 13  Line 13 
13  Description:  Description:
14    
15  ----------------------------------------------------------------------  ----------------------------------------------------------------------
16    Name: Matthias Blume
17    Date: 2002/04/12 13:55:00 EDT
18    Tag: blume-20020412-assyntax
19    Description:
20    
21    1. Grabbed newer assyntax.h from the XFree86 project.
22    2. Fiddled with how to compile X86.prim.asm without warnings.
23    3. (Very) Minor cleanup in CM.
24    
25    ----------------------------------------------------------------------
26    Name: Matthias Blume
27    Date: 2002/04/01 (no joke!) 17:07:00 EST
28    Tag: blume-20020401-x86div
29    Description:
30    
31    Added full support for div/mod/rem/quot on the x86, using the machine
32    instruction's two results (without clumsily recomputing the remainder)
33    directly where appropriate.
34    
35    Some more extensive power-of-two support was added to the x86 instruction
36    selector (avoiding expensive divs, mods, and muls where they can be
37    replaced with cheaper shifts and masks).  However, this sort of thing
38    ought to be done earlier, e.g., within the CPS optimizer so that
39    all architectures benefit from it.
40    
41    The compiler compiles to a fixed point, but changes might be somewhat
42    fragile nevertheless.  Please, report any strange things that you might
43    see wrt. div/mod/quot/rem...
44    
45    ----------------------------------------------------------------------
46    Name: Matthias Blume
47    Date: 2002/03/29 17:22:00
48    Tag: blume-20020329-div
49    Description:
50    
51    Fixed my broken div/mod logic.  Unfortunately, this means that the
52    inline code for div/mod now has one more comparison than before.
53    Fast paths (quotient > 0 or remainder = 0) are not affected, though.
54    The problem was with quotient = 0, because that alone does not tell
55    us which way the rounding went.  One then has to look at whether
56    remainder and divisor have the same sign...  :(
57    
58    Anyway, I replaced the bootfiles with fresh ones...
59    
60    ----------------------------------------------------------------------
61    Name: Matthias Blume
62    Date: 2002/03/29 14:10:00 EST
63    Tag: blume-20020329-inlprims
64    Description:
65    
66    NEW BOOTFILES!!!    Version number bumped to 110.39.3.
67    
68    Primops have changed. This means that the bin/boot-file formats have
69    changed as well.
70    
71    To make sure that there is no confusion, I made a new version.
72    
73    
74    CHANGES:
75    
76    * removed REMT from mltree (remainder should never overflow).
77    
78    * added primops to deal with divisions of all flavors to the frontend
79    
80    * handled these primops all the way through so they map to their respective
81      MLRISC support
82    
83    * used these primops in the implementation of Int, Int32, Word, Word32
84    
85    * removed INLDIV, INLMOD, and INLREM as they are no longer necessary
86    
87    * parameterized INLMIN, INLMAX, and INLABS by a numkind
88    
89    * translate.sml now deals with all flavors of INL{MIN,MAX,ABS}, including
90      floating point
91    
92    * used INL{MIN,MAX,ABS} in the implementation of Int, Int32, Word, Word32,
93      and Real (but Real.abs maps to a separate floating-point-only primop)
94    
95    
96    TODO items:
97    
98    * Hacked Alpha32 instruction selection, disabling the selection of REMx
99      instructions because the machine instruction encoder cannot handle
100      them.  (Hppa, PPC, and Sparc instruction selection did not handle
101      REM in the first place, and REM is supported by the x86 machine coder.)
102    
103    * Handle DIV and MOD with DIV_TO_NEGINF directly in the x86 instruction
104      selection phase.  (The two can be streamlined because the hardware
105      delivers both quotient and remainder at the same time anyway.)
106    
107    * Think about what to do with "valOf(Int32.minInt) div ~1" and friends.
108      (Currently the behavior is inconsistent both across architectures and
109      wrt. the draft Basis spec.)
110    
111    * Word8 should eventually be handled natively, too.
112    
113    * There seems to be one serious bug in mltree-gen.sml.  It appears, though,
114      as if there currently is no execution path that could trigger it in
115      SML/NJ.  (The assumptions underlying functions arith and promotable do not
116      hold for things like multiplication and division.)
117    
118    ----------------------------------------------------------------------
119    Name: Matthias Blume
120    Date: 2002/03/27 16:27:00 EST
121    Tag: blume-20020327-mlrisc-divisions
122    Description:
123    
124    Added support for all four division operations (ML's div, mod, quot,
125    and rem) to MLRISC.  In the course of doing so, I also rationalized
126    the naming (no more annoying switch-around of DIV and QUOT), by
127    parameterizing the operation by div_rounding_mode (which can be either
128    DIV_TO_ZERO or DIV_TO_NEGINF).
129    
130    The generic MLTreeGen functor takes care of compiling all four
131    operations down to only round-to-zero div.
132    
133    Missing pieces:
134    
135      * Doing something smarter than relying on MLTreeGen on architectures
136        like, e.g., the x86 where hardware division delivers both quotient and
137        remainder at the same time.  With this, the implementation of the
138        round-to-neginf operations could be further streamlined.
139    
140      * Remove inlining support for div/mod/rem from the frontend and replace it
141        with primops that get carried through to the backend.  Do this for all
142        int and word types.
143    
144    ----------------------------------------------------------------------
145    Name: Matthias Blume
146    Date: 2002/03/25 17:25:00 EST
147    Tag: blume-20020325-divmod
148    Description:
149    
150    I improved (hopefully without breaking them) the implementation of Int.div,
151    Int.mod, and Int.rem.   For this, the code in translate.sml now takes
152    advantage of the following observations:
153    
154      Let  q = x quot y      r = x rem y
155           d = x div  y      m = x mod y
156    
157    where "quot" is the round-to-zero version of integer division that
158    hardware usually provides.  Then we have:
159    
160         r = x - q * y        where neither the * nor the - will overflow
161         d = if q >= 0 orelse x = q * y then q else q - 1
162                              where neither the * nor the - will overflow
163         m = if q >= 0 orelse r = 0 then r else r + y
164                              where the + will not overflow
165    
166    This results in substantial simplification of the generated code.
167    The following table shows the number of CFG nodes and edges generated
168    for
169            fun f (x, y) = x OPER y
170            (* with OPER \in div, mod, quot, rem *)
171    
172    
173        OPER | nodes(old) | edges(old) | nodes(new) | edges(new)
174        --------------------------------------------------------
175         div |         24 |         39 |         12 |         16
176         mod |         41 |         71 |         12 |         16
177        quot |          8 |         10 |          8 |         10
178         rem |         10 |         14 |          8 |         10
179    
180    
181    ----------------------------------------------------------------------
182    Name: Matthias Blume
183    Date: 2002/03/25 22:06:00 EST
184    Tag: blume-20020325-cprotobug
185    Description:
186    
187    Fixed a bug in cproto (c prototype decoder).
188    
189    ----------------------------------------------------------------------
190    Name: Matthias Blume
191    Date: 2002/03/25 16:00:00 EST
192    Tag: blume-20020325-raw-primops
193    Description:
194    
195    I did some cleanup to Allen's new primop code and
196    replaced yesterday's bootfiles with new ones.
197    (But they are stored in the same place.)
198    
199    ----------------------------------------------------------------------
200    Name: Matthias Blume
201    Date: 2002/03/24 22:40:00 EST
202    Tag: blume-20020324-bootfiles
203    Description:
204    
205    Made the bootfiles that Allen asked for.
206    
207    ----------------------------------------------------------------------
208  Name: Allen Leung  Name: Allen Leung
209  Date: 2002/03/23 15:50:00 EST  Date: 2002/03/23 15:50:00 EST
210  Tag: leunga-20020323-flint-cps-rcc-primops  Tag: leunga-20020323-flint-cps-rcc-primops

Legend:
Removed from v.1174  
changed lines
  Added in v.1186

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