From a4f697bae16473cfe1152656565fd1ffb20a797c Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 10 Feb 2024 23:00:21 +0100 Subject: [PATCH] faster --- codeOptimizers/src/prog8/optimizer/StatementOptimizer.kt | 4 ++-- docs/source/todo.rst | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/codeOptimizers/src/prog8/optimizer/StatementOptimizer.kt b/codeOptimizers/src/prog8/optimizer/StatementOptimizer.kt index e447233b8..c7780f5f1 100644 --- a/codeOptimizers/src/prog8/optimizer/StatementOptimizer.kt +++ b/codeOptimizers/src/prog8/optimizer/StatementOptimizer.kt @@ -443,7 +443,7 @@ class StatementOptimizer(private val program: Program, } } - // xx+=3 -> xx++ xx++ xx++ + // xx+=2 -> xx++ xx++ // note: ideally this optimization should be done by the code generator, but doing it there // requires doing it multiple times (because lots of different things can be incremented/decremented) if(assignment.target.identifier!=null @@ -454,7 +454,7 @@ class StatementOptimizer(private val program: Program, if(binExpr!=null) { if(binExpr.operator in "+-") { val value = binExpr.right.constValue(program)?.number?.toInt() - if(value!=null && value in 2..3) { + if(value!=null && value==2) { val stmts = mutableListOf() repeat(value) { val incrdecr = Assignment(assignment.target.copy(), diff --git a/docs/source/todo.rst b/docs/source/todo.rst index f884e1806..d176c9668 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,10 +1,10 @@ TODO ==== -rockrunner cave load/decode is now broken (even with -noopt) - (after merge in boolean): move all "OperatorXinplace" from expressionGen to AssignmentGen, see if we can get rid of the Result return type. +replace Takes by Http4k in httpCompilerService project. https://github.com/http4k/examples/blob/master/hello-world/README.md + ... @@ -12,7 +12,7 @@ Future Things and Ideas ^^^^^^^^^^^^^^^^^^^^^^^ Compiler: -- can we support singed % (remainder) somehow? +- can we support signed % (remainder) somehow? - instead of copy-pasting inline asmsubs, make them into a 64tass macro and use that instead. that will allow them to be reused from custom user written assembly code as well. - Multidimensional arrays and chained indexing, purely as syntactic sugar over regular arrays.