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