mirror of
https://github.com/irmen/prog8.git
synced 2025-01-12 04:30:03 +00:00
comments and prepare new version 7.7
This commit is contained in:
parent
de7ea04f54
commit
8966d2aa06
@ -37,7 +37,8 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
|||||||
SourceStorageKind.ARRAY -> src.array!!
|
SourceStorageKind.ARRAY -> src.array!!
|
||||||
else -> {
|
else -> {
|
||||||
// TODO make it so that we can assign efficiently from something else as an expression....namely: register(s)
|
// TODO make it so that we can assign efficiently from something else as an expression....namely: register(s)
|
||||||
// but for now, first assign it to a temporary variable
|
// this is useful in pipe expressions for instance, to skip the use of a temporary variable
|
||||||
|
// but for now, just assign it to a temporary variable and use that as a source
|
||||||
val tempvar = asmgen.getTempVarName(src.datatype)
|
val tempvar = asmgen.getTempVarName(src.datatype)
|
||||||
val assignTempvar = AsmAssignment(
|
val assignTempvar = AsmAssignment(
|
||||||
src,
|
src,
|
||||||
|
@ -287,7 +287,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
|||||||
}
|
}
|
||||||
is BinaryExpression -> {
|
is BinaryExpression -> {
|
||||||
if(value.operator in ComparisonOperators) {
|
if(value.operator in ComparisonOperators) {
|
||||||
// TODO real optimized code for comparison expressions
|
// TODO real optimized code for comparison expressions that yield a boolean result value
|
||||||
// for now generate code for this: assign-false; if expr { assign-true }
|
// for now generate code for this: assign-false; if expr { assign-true }
|
||||||
translateNormalAssignment(
|
translateNormalAssignment(
|
||||||
AsmAssignment(
|
AsmAssignment(
|
||||||
|
@ -1 +1 @@
|
|||||||
7.7-dev
|
7.7
|
||||||
|
@ -796,7 +796,7 @@ class TestProg8Parser: FunSpec( {
|
|||||||
val ff = start.statements[4] as Assignment
|
val ff = start.statements[4] as Assignment
|
||||||
ff.value shouldBe NumericLiteralValue(DataType.UBYTE, 255.0, Position.DUMMY)
|
ff.value shouldBe NumericLiteralValue(DataType.UBYTE, 255.0, Position.DUMMY)
|
||||||
val letter = start.statements[6] as Assignment
|
val letter = start.statements[6] as Assignment
|
||||||
// TODO characters should not be encoded until code generation, like strings...
|
// TODO characters should perhaps not be encoded until code generation, like strings... however this will prevent optimizing expressions with characters
|
||||||
val encodedletter = Petscii.encodePetscii("A", true).getOrElse { fail("petscii error") }.single()
|
val encodedletter = Petscii.encodePetscii("A", true).getOrElse { fail("petscii error") }.single()
|
||||||
letter.value shouldBe NumericLiteralValue(DataType.UBYTE, encodedletter.toDouble(), Position.DUMMY)
|
letter.value shouldBe NumericLiteralValue(DataType.UBYTE, encodedletter.toDouble(), Position.DUMMY)
|
||||||
}
|
}
|
||||||
|
@ -52,12 +52,11 @@ Future Things and Ideas
|
|||||||
|
|
||||||
More optimization ideas
|
More optimization ideas
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
- translateFunctioncall() in BuiltinFunctionsAsmGen: should be able to assign parameters directly from register(s)
|
- translateFunctioncall() 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
|
||||||
- translateNormalAssignment() -> better code gen for assigning boolean comparison expressions
|
- translateNormalAssignment() -> better code gen for assigning boolean comparison expressions
|
||||||
- if a for loop's loopvariable isn't referenced in the body, replace by a repeatloop
|
- when a for loop's loopvariable isn't referenced in the body, and the iterations are known, replace the loop by a repeatloop
|
||||||
- automatically convert if statements that test for multiple values (if X==1 or X==2..) to if X in [1,2,..] statements, instead of just a warning
|
- automatically convert if statements that test for multiple values (if X==1 or X==2..) to if X in [1,2,..] statements, instead of just a warning.
|
||||||
- byte typed expressions should be evaluated in the accumulator where possible, without (temp)var
|
- rewrite expression tree evaluation such that it doesn't use an eval stack but flatten the tree into linear code that uses a fixed number of predetermined value 'variables'?
|
||||||
for instance value = otherbyte >> 1 --> lda otherbite ; lsr a; sta value
|
|
||||||
- rewrite expression tree evaluation such that it doesn't use an eval stack but flatten the tree into linear code that uses a fixed number of predetermined value 'variables'
|
|
||||||
- this removes the need for the BinExprSplitter? (which is problematic and very limited now)
|
- this removes the need for the BinExprSplitter? (which is problematic and very limited now)
|
||||||
|
and perhaps as well the assignment splitting in BeforeAsmAstChanger too
|
||||||
- introduce byte-index operator to avoid index multiplications in loops over arrays? see github issue #4
|
- introduce byte-index operator to avoid index multiplications in loops over arrays? see github issue #4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user