Internal Memo
ToFrom
Mimosa^.paRuss Atkinson
 PARC/CSL
SubjectDate
MimosaAgenda.tioga July 8, 1988
Hot items
TypeStrings bug
The length for fields is output twice (check on AppendName, the <<+ 1>> comment gives the true length); BUT we can't change this without invalidating the old type strings, so wait for full recompilation
SymbolSegment bug
The comments on fgRelBase & fgCount are a little bogus (see ObjectOut.SetFgt for the truth)
INLINE procs used to calculate constants
Should be smarter (improve Pass4Xa.Substx)
Variable locations
Where are the links? (global frame, frame extension, static link, long arg & rtn records)
Where are the indirect variables? (based on frame extension, long arg & rtn records)
Preparation for Little-Endian machines
Constant encoding & folding
Both Host & Target dependent (rework TargetConversions)?
Constant folding
Layout descriptions (target-specific rather than absolute?)
Type locator information
design & impl
Cleanup work
interface & implementation consolidation
get rid of unused stuff (all over)
Extensions
number literals over 32-bits
Entry vector
make it possible to determine the location of procedure descriptor bodies from a BcdDefs.Link ("gfi" & "ep"); probably put them all in an entry vecor and pass through the entry vector offset via BcdDefs; this should also enable POINTER TO FRAME [foo]
Multiple imports
look OK from the point of view of the compiler, but let's make sure that it all hangs together with the runtime support!
Named exports
does this even work now?
Mob file changes
stuff for entry vector decoding
more version info?
Different compiler version numbers
one for definitions files
one for implementations files
Recent past
ZONE allocation units
uses addressing units, not words
UNCOUNTED ZONE
now consistent with ZONE (see Allocator & AllocatorImpl as to why it is not now (extra level of indirection for UNCOUNTED ZONE))
String literals
more consistent with XDE compiler
("..." vs. "..."L vs. "..."G)
isolate operating system dependencies (to MimSysOps)
remove use of FS except for one module (MimSysOpsImpl)
BcdDefs => MobDefs
ComData => MimData
TypeStringsImpl.AppendPaint (form = $opaque)
Rename pad2 --> slots in Symbols.SERecord.definition (& fix uses)
Documentation
Parameters
Document the parameters in DragonParms.mesa and Pass4Parms.mesa.
Big vs. little endian
There are still significant problems. For example, string literals do not work in a machine-independent fashion. The bytes are passed along correctly, but the bounds fields are wrong. This will probably require some augmentation to IntCodeDefs, but it is not yet designed.
Options specification
Needs design work. The idea is to turn certain options on/off textually within the compiler. An OPTIONS statement that took effect at the point of occurence, and persisted until block exit, would probably do the trick. Here are some of the possible options:
Check: type | ALL | NONE | DEFAULT
controls bounds/overflow checking for the specified type; for arrays, affects bounds checking; for INT or CARD, controls overflow checking; ALL causes all checking to take place; NONE causes no checking to take place; DEFAULT sets the checking to the defaults for the compiler
CrossJump: TRUE | FALSE | DEFAULT
controls cross-jumping optimizations
VariablePrune: TRUE | FALSE | DEFAULT
eliminates unused variables (i.e. variables declared but not further referenced); if TRUE then the compiler must generate such variables and have them accessible over the declared scope
SpaceTime: SPACE | TIME | DEFAULT
instructs the code generator to compile for minimal space or time
More checking
Funny subranges of INT
Check that things like MIN, MAX, ABS, and other operations work for subranges like INT[-40..LAST[INT]] (providing we allow such a degenerate subrange). I suspect problems here.
Tentative changes
This section describes some changes that are proposed and implemented for Mimosa, but may be rescinded.
Signed division
Isolate & document the differences in the two methods for signed division.
Old method (PrincOps)
(X / Y) * Y + X MOD Y = X
ABS[X/Y] = ABS[X] / ABS[Y]
New method (Mimosa)
(X / Y) * Y + X MOD Y = X
0 d X MOD Y ý ABS[Y]
Performance
AND & OR
AND & OR can be performed faster by using boolean operations when the operands are guaranteed to evaluate without problems. Simple variables (local or global) are simple enough, as are AND & OR applied to simple operands. The relative costs of AND & OR compared to conditional expressions should be parameterized. This could be done as late as IntCodeTwig, but it is probably better done in Pass 5, before we lose track of AND & OR.
Unsigned comparison
Unsigned comparison can be done using the cheaper signed comparison when the number of bits in the operand types is less than for the full unsigned type. MimFlow.Rel could be the right place for this, although it might be better if we did this earlier. The preferred comparison mode (signed, unsigned, either) should be parameterized.
Assignments of constants to dereferenced stuff
Assignments of constants to dereferenced variables is going to be quicker if the constants are in local variables. This is strictly an IntCodeTwig transformation to be performed if the maximum stack depth is small enough.
Tag tests for dereferenced stuff
... often perform extra dereferences. In such a case, or when we need the tag extracted from a variable, we need to put the tag into a temporary. Of course, if there is only one case, we don't need to do it! TestSelect.Proc3 has a test case for this.
Cleanliness
Variable layout
Variable layout for local and global frames is handled in Pass4L and in the machine specific code generation that comes after the intermediate code generation. The Pass4L layout should be flushed, and the later layout needs to be reported back to the symbol table.
Little things
Alias
The alias mechanism used in TestSelect (MimP5.Alias, exported by MimExpr) does not currently pass along enough information to determine name and location in later passes. We can either eliminate aliasing (declare new variables & make copies, hoping for a good optimizer) or we can do something else to get back information about locations.