1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-09-27 12:57:41 +00:00

Unify syntax of command-line switches

This commit is contained in:
Karol Stasiak 2018-07-01 19:19:30 +02:00
parent 2b6315f15b
commit 35caae6d8b
6 changed files with 31 additions and 13 deletions

View File

@ -8,6 +8,6 @@
## Automatic inlining
`--inline` command-line option
`-finline` command-line option
`inline` and `noinline` keyword

View File

@ -87,21 +87,28 @@ This may cause problems if the parameter table is stored next to a hardware regi
* `-O9` Optimize code using superoptimizer (experimental). Computationally expensive, decent results.
* `--inline` Inline functions automatically (experimental). See the [documentation about inlining](../abi/inlining.md). Computationally easy, can give decent gains.
* `-finline`, `-fno-inline` Whether should inline functions automatically (experimental).
See the [documentation about inlining](../abi/inlining.md). Computationally easy, can give decent gains.
`.ini` equivalent: `inline`.
* `--fipo`, `--fno-ipo` Whether should perform interprocedural optimization.
* `-fipo`, `-fno-ipo` Whether should perform interprocedural optimization.
It enables certain optimization similar to what inlining would enable, but without actual inlining.
`.ini` equivalent: `ipo`.
* `--size` Optimize for size, sacrificing some speed (experimental).
* `-Os`, `--size` Optimize for size, sacrificing some speed (experimental).
* `--fast` Optimize for speed, even if it increases the size a bit (experimental).
* `-Of`, `--fast` Optimize for speed, even if it increases the size a bit (experimental).
* `--blast-processing` Optimize for speed, even if it increases the size a lot (experimental).
Enables `--inline` automatically.
* `-Ob`, `--blast-processing` Optimize for speed, even if it increases the size a lot (experimental).
Enables `-finline` automatically.
* `--dangerous-optimizations` Use dangerous optimizations (experimental).
* `-fdangerous-optimizations` Use dangerous optimizations (experimental).
Dangerous optimizations are more likely to result in broken code.
Enables `--fipo` automatically.
Enables `-fipo` automatically.
`.ini` equivalent: `dangerous_optimizations`.
Note: for compatibility with versions 0.3.0 and earlier,
command line options `--inline`, `--dangerous-optimizations` `--fipo` and `--fno-ipo` are still recognized, but discouraged.
## Warning options

View File

@ -43,9 +43,9 @@ You may be also interested in the following:
* `-O`, `-O2`, `-O3`, `-O4` enable optimization (various levels)
* `--inline` automatically inline functions for better optimization
* `-finline` automatically inline functions for better optimization
* `--fipo` enable interprocedural optimization
* `-fipo` enable interprocedural optimization
* `-s` additionally generate assembly output

View File

@ -3,7 +3,7 @@
// https://github.com/JasonAldred/C64-Starfield
// http://www.galencia.games/
// compile with -O3 --inline -t c64
// compile with -O3 -finline -t c64
const word starScreenChar = $0400 // Screen address
const word StarScreenCols = $d800 // Character attribute address

View File

@ -233,6 +233,8 @@ object CompilationFlag extends Enumeration {
"emit_sharp" -> EmitSharpOpcodes,
"ix_stack" -> UseIxForStack,
"ipo" -> InterproceduralOptimization,
"inline" -> InlineFunctions,
"dangerous_optimizations" -> DangerousOptimizations,
"zeropage_register" -> ZeropagePseudoregister,
"decimal_mode" -> DecimalMode,
"ro_arrays" -> ReadOnlyArrays,

View File

@ -308,12 +308,18 @@ object Main {
}
flag("--inline").action { c =>
c.changeFlag(CompilationFlag.InlineFunctions, true)
}.description("Inline functions automatically.").hidden()
boolean("-finline", "-fno-inline").action { (c, v) =>
c.changeFlag(CompilationFlag.InlineFunctions, v)
}.description("Inline functions automatically.")
flag("--ipo").action { c =>
c.changeFlag(CompilationFlag.InterproceduralOptimization, true)
}.description("Interprocedural optimization.").hidden()
boolean("--fipo", "--fno-ipo").action { (c, v) =>
c.changeFlag(CompilationFlag.InterproceduralOptimization, v)
}.description("Interprocedural optimization.").hidden()
boolean("-fipo", "-fno-ipo").action { (c, v) =>
c.changeFlag(CompilationFlag.InterproceduralOptimization, v)
}.description("Interprocedural optimization.")
flag("-Os", "--size").action { c =>
c.changeFlag(CompilationFlag.OptimizeForSize, true).
@ -330,9 +336,12 @@ object Main {
changeFlag(CompilationFlag.OptimizeForSpeed, true).
changeFlag(CompilationFlag.OptimizeForSonicSpeed, true).
changeFlag(CompilationFlag.InlineFunctions, true)
}.description("Prefer faster code even if it is much bigger (experimental). Implies --inline.")
}.description("Prefer faster code even if it is much bigger (experimental). Implies -finline.")
flag("--dangerous-optimizations").action { c =>
c.changeFlag(CompilationFlag.DangerousOptimizations, true)
}.description("Use dangerous optimizations (experimental).").hidden()
boolean("-fdangerous-optimizations", "-fnodangerous-optimizations").action { (c, v) =>
c.changeFlag(CompilationFlag.DangerousOptimizations, v)
}.description("Use dangerous optimizations (experimental).")
fluff("", "Warning options:", "")