mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 16:29:21 +00:00
tweaks
This commit is contained in:
parent
3e62ffed0a
commit
1e63615592
@ -38,11 +38,11 @@ private fun compileMain(args: Array<String>): Boolean {
|
|||||||
val dontOptimize by cli.option(ArgType.Boolean, fullName = "noopt", description = "don't perform any optimizations")
|
val dontOptimize by cli.option(ArgType.Boolean, fullName = "noopt", description = "don't perform any optimizations")
|
||||||
val dontReinitGlobals by cli.option(ArgType.Boolean, fullName = "noreinit", description = "don't create code to reinitialize globals on multiple runs of the program (experimental!)")
|
val dontReinitGlobals by cli.option(ArgType.Boolean, fullName = "noreinit", description = "don't create code to reinitialize globals on multiple runs of the program (experimental!)")
|
||||||
val optimizeFloatExpressions by cli.option(ArgType.Boolean, fullName = "optfloatx", description = "optimize float expressions (warning: can increase program size)")
|
val optimizeFloatExpressions by cli.option(ArgType.Boolean, fullName = "optfloatx", description = "optimize float expressions (warning: can increase program size)")
|
||||||
val watchMode by cli.option(ArgType.Boolean, fullName = "watch", description = "continuous compilation mode (watches for file changes), greatly increases compilation speed")
|
val watchMode by cli.option(ArgType.Boolean, fullName = "watch", description = "continuous compilation mode (watch for file changes)")
|
||||||
val slowCodegenWarnings by cli.option(ArgType.Boolean, fullName = "slowwarn", description="show debug warnings about slow/problematic assembly code generation")
|
val slowCodegenWarnings by cli.option(ArgType.Boolean, fullName = "slowwarn", description="show debug warnings about slow/problematic assembly code generation")
|
||||||
val quietAssembler by cli.option(ArgType.Boolean, fullName = "quietasm", description = "don't print assembler output results")
|
val quietAssembler by cli.option(ArgType.Boolean, fullName = "quietasm", description = "don't print assembler output results")
|
||||||
val asmListfile by cli.option(ArgType.Boolean, fullName = "asmlist", description = "make the assembler produce a listing file as well")
|
val asmListfile by cli.option(ArgType.Boolean, fullName = "asmlist", description = "make the assembler produce a listing file as well")
|
||||||
val experimentalCodegen by cli.option(ArgType.Boolean, fullName = "expericodegen", description = "use experimental codegen")
|
val experimentalCodegen by cli.option(ArgType.Boolean, fullName = "expericodegen", description = "use experimental/alternative codegen")
|
||||||
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler (one of '${C64Target.NAME}', '${C128Target.NAME}', '${Cx16Target.NAME}', '${AtariTarget.NAME}', '${VMTarget.NAME}')")
|
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler (one of '${C64Target.NAME}', '${C128Target.NAME}', '${Cx16Target.NAME}', '${AtariTarget.NAME}', '${VMTarget.NAME}')")
|
||||||
.default(C64Target.NAME)
|
.default(C64Target.NAME)
|
||||||
val sourceDirs by cli.option(ArgType.String, fullName="srcdirs", description = "list of extra paths, separated with ${File.pathSeparator}, to search in for imported modules").multiple().delimiter(File.pathSeparator)
|
val sourceDirs by cli.option(ArgType.String, fullName="srcdirs", description = "list of extra paths, separated with ${File.pathSeparator}, to search in for imported modules").multiple().delimiter(File.pathSeparator)
|
||||||
|
@ -5,11 +5,10 @@ For next release
|
|||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
- vm codegen: When
|
- vm codegen: When
|
||||||
- vm codegen: Pipe expression
|
- vm codegen: Pipe expression
|
||||||
- vm codegen: validate that PtFunctionCall translation works okay with resultregister, and multiple paramsters in correct order
|
|
||||||
- vm: support no globals re-init option
|
- vm: support no globals re-init option
|
||||||
- vm: how to remove all unused subroutines? (for asm, 64tass used to do this)
|
- vm codegen/assembler: variable memory locations should also be referenced by the variable name instead of just the address, to make the output more human-readable
|
||||||
- vm: rather than being able to jump to any 'address' (IPTR), use 'blocks'
|
- vm: how to remove all unused subroutines? (in the assembly codegen, we let 64tass solve this for us)
|
||||||
- vm codegen/assembler: variable memory locations should also be referenced by the variable name instead of just the address
|
- vm: rather than being able to jump to any 'address' (IPTR), use 'blocks' that have entry and exit points -> even better dead code elimination possible too
|
||||||
- when the vm is stable and *if* its language can get promoted to prog8 IL, the variable allocation should be changed.
|
- when the vm is stable and *if* its language can get promoted to prog8 IL, the variable allocation should be changed.
|
||||||
It's now done before the vm code generation, but the IL should probably not depend on the allocations already performed.
|
It's now done before the vm code generation, but the IL should probably not depend on the allocations already performed.
|
||||||
So the CodeGen doesn't do VariableAlloc *before* the codegen, but as a last step.
|
So the CodeGen doesn't do VariableAlloc *before* the codegen, but as a last step.
|
||||||
@ -41,7 +40,6 @@ Compiler:
|
|||||||
- simplifyConditionalExpression() should not split expression if it still results in stack-based evaluation, but how does it know?
|
- simplifyConditionalExpression() should not split expression if it still results in stack-based evaluation, but how does it know?
|
||||||
- simplifyConditionalExpression() sometimes introduces needless assignment to r9 tempvar (scenario sought)
|
- simplifyConditionalExpression() sometimes introduces needless assignment to r9 tempvar (scenario sought)
|
||||||
- consider adding McCarthy evaluation to shortcircuit and and or expressions. First do ifs by splitting them up? Then do expressions that compute a value?
|
- consider adding McCarthy evaluation to shortcircuit and and or expressions. First do ifs by splitting them up? Then do expressions that compute a value?
|
||||||
- use more of Result<> to handle errors/ nulls better?
|
|
||||||
- make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as ``p8v_``? Or not worth it (most 3 letter opcodes as variables are nonsensical anyway)
|
- make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as ``p8v_``? Or not worth it (most 3 letter opcodes as variables are nonsensical anyway)
|
||||||
then we can get rid of the instruction lists in the machinedefinitions as well?
|
then we can get rid of the instruction lists in the machinedefinitions as well?
|
||||||
- [problematic due to 64tass:] add a compiler option to not remove unused subroutines. this allows for building library programs. But this won't work with 64tass's .proc ...
|
- [problematic due to 64tass:] add a compiler option to not remove unused subroutines. this allows for building library programs. But this won't work with 64tass's .proc ...
|
||||||
@ -73,8 +71,8 @@ Expressions:
|
|||||||
|
|
||||||
Optimizations:
|
Optimizations:
|
||||||
|
|
||||||
- various optimizers should/do skip stuff if compTarget.name==VMTarget.NAME. Once (if?) 6502-codegen is no longer done from
|
- various optimizers skip stuff if compTarget.name==VMTarget.NAME. Once (if?) 6502-codegen is no longer done from
|
||||||
the old CompilerAst, those checks should probably be removed.
|
the old CompilerAst, those checks should probably be removed, or be made permanent
|
||||||
- VariableAllocator: can we think of a smarter strategy for allocating variables into zeropage, rather than first-come-first-served
|
- VariableAllocator: can we think of a smarter strategy for allocating variables into zeropage, rather than first-come-first-served
|
||||||
- translateUnaryFunctioncall() in BuiltinFunctionsAsmGen: should be able to assign parameters to a builtin function directly from register(s), this will make the use of a builtin function in a pipe expression more efficient without using a temporary variable
|
- translateUnaryFunctioncall() in BuiltinFunctionsAsmGen: should be able to assign parameters to a builtin function directly from register(s), this will make the use of a builtin function in a pipe expression more efficient without using a temporary variable
|
||||||
compare ``aa = startvalue(1) |> sin8u() |> cos8u() |> sin8u() |> cos8u()``
|
compare ``aa = startvalue(1) |> sin8u() |> cos8u() |> sin8u() |> cos8u()``
|
||||||
|
@ -7,20 +7,20 @@ main {
|
|||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
|
|
||||||
cx16.clock_set_date_time(mkword(8, 2020 - 1900), mkword(19, 27), mkword(0, 16), 0)
|
cx16.clock_set_date_time(mkword(8, 2022 - 1900), mkword(19, 27), mkword(30, 16), 0)
|
||||||
txt.lowercase()
|
txt.lowercase()
|
||||||
|
|
||||||
repeat {
|
repeat {
|
||||||
txt.chrout(19) ; HOME
|
txt.chrout(19) ; HOME
|
||||||
txt.print("\n yyyy-mm-dd HH:MM:SS.jj\n\n")
|
txt.print("\n yyyy-mm-dd HH:MM:SS.jj\n\n")
|
||||||
void cx16.clock_get_date_time()
|
void cx16.clock_get_date_time()
|
||||||
txt.chrout(' ')
|
txt.spc()
|
||||||
print_date()
|
print_date()
|
||||||
txt.chrout(' ')
|
txt.spc()
|
||||||
print_time()
|
print_time()
|
||||||
|
|
||||||
txt.chrout('\n')
|
txt.nl()
|
||||||
txt.chrout('\n')
|
txt.nl()
|
||||||
uword jiffies = c64.RDTIM16()
|
uword jiffies = c64.RDTIM16()
|
||||||
txt.print_uw(jiffies)
|
txt.print_uw(jiffies)
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub keyboard_scancode_handler(ubyte prefix, ubyte scancode, ubyte updown) {
|
sub keyboard_scancode_handler(ubyte prefix, ubyte scancode, ubyte updown) {
|
||||||
txt.print_ub(prefix)
|
txt.print_ubhex(prefix, true)
|
||||||
txt.spc()
|
txt.chrout(':')
|
||||||
txt.print_ub(scancode)
|
txt.print_ubhex(scancode, true)
|
||||||
txt.spc()
|
txt.spc()
|
||||||
if updown
|
if updown
|
||||||
txt.chrout('u')
|
txt.chrout('u')
|
||||||
@ -43,11 +43,12 @@ asm_shim:
|
|||||||
php
|
php
|
||||||
pha
|
pha
|
||||||
phx
|
phx
|
||||||
sta scancode
|
|
||||||
stz updown
|
stz updown
|
||||||
bcc +
|
bcc +
|
||||||
inc updown
|
inc updown
|
||||||
+ jsr keyboard_scancode_handler
|
+ stx prefix
|
||||||
|
sta scancode
|
||||||
|
jsr keyboard_scancode_handler
|
||||||
plx
|
plx
|
||||||
pla
|
pla
|
||||||
plp
|
plp
|
||||||
|
@ -20,6 +20,7 @@ main {
|
|||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
txt.color(1)
|
txt.color(1)
|
||||||
|
txt.clear_screen()
|
||||||
txt.print("creating charset...\n")
|
txt.print("creating charset...\n")
|
||||||
makechar()
|
makechar()
|
||||||
|
|
||||||
|
@ -7,15 +7,8 @@ main {
|
|||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
|
|
||||||
txt.print("keyboard api test\n")
|
|
||||||
|
|
||||||
cx16.kbdbuf_put('l')
|
; a "pixelshader":
|
||||||
cx16.kbdbuf_put('o')
|
|
||||||
cx16.kbdbuf_put('a')
|
|
||||||
cx16.kbdbuf_put('d')
|
|
||||||
cx16.kbdbuf_put(13)
|
|
||||||
|
|
||||||
; the "pixelshader":
|
|
||||||
; syscall1(8, 0) ; enable lo res creen
|
; syscall1(8, 0) ; enable lo res creen
|
||||||
; ubyte shifter
|
; ubyte shifter
|
||||||
;
|
;
|
||||||
|
@ -121,7 +121,7 @@ lsl reg1, reg2, reg3 - reg1 = shift reg2 left by reg3 bi
|
|||||||
ror reg1, reg2, reg3 - reg1 = rotate reg2 right by reg3 bits, not using carry
|
ror reg1, reg2, reg3 - reg1 = rotate reg2 right by reg3 bits, not using carry
|
||||||
rol reg1, reg2, reg3 - reg1 = rotate reg2 left by reg3 bits, not using carry
|
rol reg1, reg2, reg3 - reg1 = rotate reg2 left by reg3 bits, not using carry
|
||||||
|
|
||||||
TODO also add ror/rol variants using the carry bit? These do map directly on 6502 and 68k instructions.
|
TODO also add ror/rol variants using the carry bit? These do map directly on 6502 and 68k instructions. But the VM doesn't have carry status bit yet.
|
||||||
|
|
||||||
|
|
||||||
MISC
|
MISC
|
||||||
|
Loading…
Reference in New Issue
Block a user