[m-dev.] for review: document the MLDS back-end
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon May 22 14:02:47 AEST 2000
The MLDS back-end installed OK last night on hg, hydra and murlibobo.
So I think it's time to document it.
Sometime soon it should also be announced on the web site, but I think
I'll leave that until I've implemented one or two more of the missing
features.
If I don't get any comments on this within the next couple of
days, I'll go ahead and commit it.
----------
Estimated hours taken: 1
compiler/options.m:
doc/user_guide.texi:
Document the --high-level-code option and its associated `hlc'
grade.
NEWS:
Document the MLDS back-end.
HISTORY:
Add a section on "MLDS back-end history".
Workspace: /home/pgrad/fjh/ws/hg
Index: compiler/options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.280
diff -u -d -r1.280 options.m
--- compiler/options.m 2000/05/09 14:24:06 1.280
+++ compiler/options.m 2000/05/22 03:36:21
@@ -1744,10 +1744,11 @@
"library which has been compiled with the same setting.",
"-s <grade>, --grade <grade>",
"\tSelect the compilation model. The <grade> should be one of",
- "\t`none', `reg', `jump', `asm_jump', `fast', `asm_fast',",
-% These grades are not yet implemented.
-% The --high-level-code option is not yet documented.
-% "\t`hl', `hl_nest', `hlc', `hlc_nest'",
+ "\t`none', `reg', `jump', `asm_jump', `fast', `asm_fast', `hlc'",
+% These grades (hl, hl_nest, and hlc_nest) are not yet documented, because
+% the --high-level-data option is not yet implemented,
+% and the --gcc-nested-functions option is not yet documented.
+% "\t`hl', `hl_nest', `hlc_nest'",
"\tor one of those with `.gc', `.prof', `.proftime',",
"\t`.profcalls', `.tr', `.sa', `.debug', and/or `.pic_reg'",
"\tappended (in that order).",
@@ -1759,26 +1760,25 @@
"--no-gcc-global-registers\t(grades: none, jump, asm_jump)",
"\tSpecify whether or not to use GNU C's",
"\tglobal register variables extension.",
-% The --high-level-code option is not yet documented.
-% "\tThis option is ignored if the `--high-level-code' option is enabled.",
+ "\tThis option is ignored if the `--high-level-code' option is enabled.",
"--gcc-non-local-gotos\t\t(grades: jump, fast, asm_jump, asm_fast)",
"--no-gcc-non-local-gotos\t(grades: none, reg)",
"\tSpecify whether or not to use GNU C's",
"\t""labels as values"" extension.",
-% The --high-level-code option is not yet documented.
-% "\tThis option is ignored if the `--high-level-code' option is enabled.",
+ "\tThis option is ignored if the `--high-level-code' option is enabled.",
"--asm-labels\t\t\t(grades: asm_jump, asm_fast)",
"--no-asm-labels\t\t\t(grades: none, reg, jump, fast)",
"\tSpecify whether or not to use GNU C's",
"\tasm extensions for inline assembler labels.",
-% The --high-level-code option is not yet documented.
-% "\tThis option is ignored if the `--high-level-code' option is enabled.",
-% The --high-level-code option is not yet documented,
-% because the MLDS back-end is not yet complete enough to be useful.
+ "\tThis option is ignored if the `--high-level-code' option is enabled.",
+% These grades (hl, hl_nest, and hlc_nest) are not yet documented, because
+% the --high-level-data option is not yet implemented,
+% and the --gcc-nested-functions option is not yet documented.
% "--high-level-code\t\t\t(grades: hl, hlc, hl_nest, hlc_nest)",
-% "\tUse an alternative back-end that generates high-level C code",
-% "\trather than the very low-level C code that is generated by our",
-% "\toriginal back-end.",
+ "--high-level-code\t\t\t(grades: hlc)",
+ "\tUse an alternative back-end that generates high-level C code",
+ "\trather than the very low-level C code that is generated by our",
+ "\toriginal back-end.",
% The --high-level-data option is not yet documented,
% because it is not yet implemented
% "--high-level-data\t\t\t(grades: hl, hl_nest)",
@@ -1788,7 +1788,8 @@
% "--high-level\t\t\t(grades: hl, hl_nest)",
% "\tAn abbreviation for `--high-level-code --high-level-data'.",
% The --gcc-nested-functions option is not yet documented,
-% because the MLDS back-end is not yet complete enough to be useful.
+% because it has not been thoroughly tested, and it is
+% probably not very useful.
% "--gcc-nested-functions\t\t(grades: hl_nest, hlc_nest)",
% "\tSpecify whether or not to use GNU C's nested functions extension.",
% "\tThis option is ignored if the `--high-level-code' option is not enabled.",
@@ -1798,6 +1799,7 @@
"\t\t\t\tother grades use `--gc none'.)",
"\tSpecify which method of garbage collection to use",
"\t(default: conservative). `accurate' GC is not yet implemented.",
+ "\t`--high-level-code' requires `conservative' GC.",
"--use-trail\t\t\t(grade modifier: `.tr')",
"\tEnable use of a trail.",
"\tThis is necessary for interfacing with constraint solvers,",
@@ -1975,8 +1977,8 @@
"\tshould be allowed to get. Given as an integer percentage",
"\t(valid range: 1 to 100, default: 90)."
-% This option is not yet documented because the `--high-level-code' MLDS backend
-% is still not yet complete.
+% This option is not yet documented because the `--gcc-nested-functions' option
+% is not documented.
% "--gcc-local-labels",
% "\tThis option has no effect unless both the `--high-level-code' option",
% "\tand the `--gcc-nested-functions' options are enabled.",
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.206
diff -u -d -r1.206 user_guide.texi
--- doc/user_guide.texi 2000/05/11 03:46:29 1.206
+++ doc/user_guide.texi 2000/05/22 03:41:14
@@ -3296,9 +3296,9 @@
The set of aspects and their alternatives are:
@table @asis
- at item What combination of GNU-C extensions to use:
+ at item What combination of GNU C extensions to use:
@samp{none}, @samp{reg}, @samp{jump}, @samp{asm_jump},
- at samp{fast}, and @samp{asm_fast} (the default is system dependent).
+ at samp{fast}, @samp{asm_fast}, and @samp{hlc} (the default is system dependent).
@item What garbage collection strategy to use:
@samp{gc}, and @samp{agc} (the default is no garbage collection).
@@ -3355,6 +3355,9 @@
@item @samp{asm_fast}
@code{--gcc-global-registers --gcc-nonlocal_gotos --asm-labels}.
+ at item @samp{hlc}
+ at code{--high-level-code}.
+
@item @samp{.gc}
@code{--gc conservative}.
@@ -3394,17 +3397,26 @@
@item @code{--gcc-global-registers} (grades: reg, fast, asm_fast)
@itemx @code{--no-gcc-global-registers} (grades: none, jump, asm_jump)
Specify whether or not to use GNU C's global register variables extension.
+This option is ignored if the @samp{--high-level-code} option is enabled.
@sp 1
@item @code{--gcc-non-local-gotos} (grades: jump, fast, asm_jump, asm_fast)
@item @code{--no-gcc-non-local-gotos} (grades: none, reg)
Specify whether or not to use GNU C's ``labels as values'' extension.
+This option is ignored if the @samp{--high-level-code} option is enabled.
@sp 1
@item @code{--asm-labels} (grades: asm_jump, asm_fast)
@itemx @code{--no-asm-labels} (grades: none, reg, jump, fast)
Specify whether or not to use GNU C's asm extensions
for inline assembler labels.
+This option is ignored if the @samp{--high-level-code} option is enabled.
+
+ at sp 1
+ at item @code{--high-level-code} (grades: hlc)
+Use an alternative back-end that generates high-level C code
+rather than the very low-level C code that is generated by our
+original back-end.
@sp 1
@item @code{--gc @{none, conservative, accurate@}}
Index: HISTORY
===================================================================
RCS file: /home/mercury1/repository/mercury/HISTORY,v
retrieving revision 1.14
diff -u -d -r1.14 HISTORY
--- HISTORY 1999/12/26 11:38:54 1.14
+++ HISTORY 2000/05/11 20:14:32
@@ -1199,3 +1199,12 @@
This release just corrected some bugs in the binary
distribution for 0.8.
+
+MLDS back-end history
+---------------------
+
+We started working on a new back-end for the Mercury compiler in July
+1999. This new back-end, called the MLDS back-end, generates much
+higher level C code than original back-end. The first prototype
+compiled "hello world" in September 1999. The compiler successfully
+compiled itself using the MLDS back-end on 12 May 2000.
Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.167
diff -u -d -r1.167 NEWS
--- NEWS 2000/04/13 10:05:39 1.167
+++ NEWS 2000/05/22 03:50:02
@@ -49,6 +49,48 @@
are now deprecated; the new existentially typed predicate
`store__new/1' should be used instead.
+Changes to the Mercury implementation:
+
+* We've implemented a new back-end for the Mercury compiler.
+
+ The new back-end, which is enabled by using the `--high-level-code'
+ (or `-H') option or the `hlc.gc' grade, generates much higher-level
+ C code that does not require the use of GNU C extensions such as
+ global register variables or non-local gotos. It is also simpler
+ and more portable than the old back-end.
+
+ The main drawback of the new back-end is that for tail calls it only
+ optimizes direct tail recursion; loops written using tail calls
+ between two or more mutually recursive procedures are not guaranteed
+ to use constant stack space.
+
+ Preliminary benchmarking suggests that compilation speed is probably
+ about 20% better with the new back-end, and the generated executables
+ are likely to be smaller (though this will depend on the platform,
+ optimization options, etc.). Speed of the generated code varies:
+ sometimes it is better than the old back-end, sometimes it is worse.
+ There are a few important optimizations that we have not yet
+ implemented for the new back-end that would make a significant
+ difference for some applications. But we encourage those for whom
+ performance is important to try their application with both the old
+ and new back-ends and compare for themselves.
+
+ The new back-end is not yet as mature or complete as the old back-end.
+ It does not yet support the following standard Mercury features:
+ - `pragma export'
+ - abstractly exported equivalence types defined as `float'
+ - the `in = in' mode of unification for certain standard library
+ types such as arrays and `univ'
+ It also does not support the following implemention-specific
+ features that the old back-end supports:
+ - trailing
+ - fact tables
+ - the Mercury debugger (mdb)
+ - the Morphine trace analysis system
+ - the Aditi deductive database interface
+ - the `--split-c-files' option
+ - the `--introduce-accumulators' option
+
NEWS for Mercury release 0.9.1:
-------------------------------
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list