Commit Graph

291 Commits

Author SHA1 Message Date
Irmen de Jong
0f72bdb4a2 Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeCore/src/prog8/code/core/BuiltinFunctions.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt
#	codeGenIntermediate/src/prog8/codegen/intermediate/BuiltinFuncGen.kt
#	codeOptimizers/src/prog8/optimizer/ConstantIdentifierReplacer.kt
#	compiler/src/prog8/compiler/astprocessing/AstChecker.kt
#	compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt
#	compiler/test/ast/TestAstChecks.kt
2024-10-13 21:48:33 +02:00
Irmen de Jong
aef211e5f3 stricter array literal element type handling (number,bool,address-of).
More consistent implicit address-of handling if array literals contain by-ref identifiers (such as subroutine names)
2024-10-13 17:46:41 +02:00
Irmen de Jong
66829203d8 New [x]*42 syntax to create array literals with repeated values (like "abc"*10 already exists for strings)
Should be used in place of array initializer expressions that contain only a single numeric value to initialize the whole array with. That isn't supported anymore.
2024-10-13 05:16:08 +02:00
Irmen de Jong
7a0eaf3148 Remove array initialization by single value.
New compiler and kotlin version.
2024-10-13 04:31:56 +02:00
Irmen de Jong
ba6db8f905 Merge branch 'master' into next_compositetypes
# Conflicts:
#	compiler/src/prog8/compiler/astprocessing/AstChecker.kt
#	compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt
#	compiler/src/prog8/compiler/astprocessing/VariousCleanups.kt
#	compiler/test/TestSubroutines.kt
2024-10-12 13:40:39 +02:00
Irmen de Jong
8d9bc2f5ff fixing all sorts of things about assigning arrays to arrays 2024-10-12 12:33:46 +02:00
Irmen de Jong
7afd716fab Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeCore/src/prog8/code/core/BuiltinFunctions.kt
#	compiler/src/prog8/compiler/astprocessing/AstChecker.kt
#	examples/test.p8
2024-10-08 22:58:26 +02:00
Irmen de Jong
a088ee56b0 function inlining can no longer get into an infinite loop. Fixes #154 2024-10-07 19:58:04 +02:00
Irmen de Jong
7df0ae3ed4 fix merge 2024-09-14 21:39:35 +02:00
Irmen de Jong
c2a75aa4d2 Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeOptimizers/src/prog8/optimizer/ConstExprEvaluator.kt
#	codeOptimizers/src/prog8/optimizer/ConstantFoldingOptimizer.kt
#	compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt
#	compiler/src/prog8/compiler/astprocessing/TypecastsAdder.kt
#	compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt
#	compilerAst/src/prog8/ast/statements/AstStatements.kt
#	examples/test.p8
2024-09-14 21:28:00 +02:00
Irmen de Jong
0d3ad80659 retain type of consts better to avoid precision loss
this also fixed a difference in const calculation where the result could differ if you were using optimzations or not.
2024-09-14 21:06:21 +02:00
Irmen de Jong
a737547fe9 Merge branch 'master' into next_compositetypes
# Conflicts:
#	codeCore/src/prog8/code/ast/AstExpressions.kt
#	codeCore/src/prog8/code/optimize/Optimizer.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/ForLoopsAsmGen.kt
#	codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt
#	codeGenIntermediate/src/prog8/codegen/intermediate/ExpressionGen.kt
#	codeGenIntermediate/src/prog8/codegen/intermediate/IRCodeGen.kt
#	codeOptimizers/src/prog8/optimizer/StatementOptimizer.kt
#	compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt
#	compiler/src/prog8/compiler/astprocessing/VariousCleanups.kt
#	docs/source/todo.rst
#	examples/test.p8
2024-09-12 23:32:23 +02:00
Irmen de Jong
8eaf884f69 improve codegen for for loops downto 0,1 when start value is not const 2024-09-10 23:54:44 +02:00
Irmen de Jong
8f5d42dbc2 more tests and some cleanups/fixes 2024-09-08 23:01:49 +02:00
Irmen de Jong
759babb4c1 rename back to DataType 2024-09-08 22:59:08 +02:00
Irmen de Jong
a1dfcd07a8 fixing things 2024-09-08 22:58:40 +02:00
Irmen de Jong
5cbf1cd2b1 cleanup imports 2024-09-08 22:58:36 +02:00
Irmen de Jong
e80c22275d making datatype more capable (subtypes) 2024-09-08 22:58:35 +02:00
Irmen de Jong
74e305b90c making datatype more capable (subtypes) 2024-09-08 22:57:49 +02:00
Irmen de Jong
bdeac74cfc removed the -nostrictbool compiler option
boolean types and bytes are no longer implicitly interchangeable using this option
2024-09-01 20:53:39 +02:00
Irmen de Jong
8f6eaeac2c half width katakana conversion 2024-08-21 18:51:34 +02:00
Irmen de Jong
3681d6ee1c optimize division by powers of 2 better (into bit shifts) 2024-07-21 21:34:38 +02:00
Irmen de Jong
0af17cdc33 todo's for division optimizations 2024-07-21 20:32:03 +02:00
Irmen de Jong
ddf990296b fix subroutine inlining symbol scope error 2024-06-29 18:53:54 +02:00
Irmen de Jong
c9a4235669 update to kotlin 2.0, fix several code style issues 2024-06-04 01:00:46 +02:00
Irmen de Jong
c719e274d5 java version tweaks 2024-05-18 20:25:44 +02:00
Irmen de Jong
7915dda35f update libraries 2024-05-12 03:02:54 +02:00
Irmen de Jong
2675623aea fix optimization ast parent linkage problem 2024-04-16 23:27:22 +02:00
Irmen de Jong
a7247f5b8b fix boolean expression optimization bug 2024-04-12 21:56:25 +02:00
Irmen de Jong
53df0eb707 cleanups 2024-04-10 22:04:03 +02:00
Irmen de Jong
641f6c05d8 allow 'void' as dummy assign target in multi-assignment statements 2024-03-31 23:43:26 +02:00
Irmen de Jong
0c5e8ca199 Merge branch 'master' into multi-assign 2024-03-29 11:51:42 +01:00
Irmen de Jong
ff23fb0086 take ignore_unused option into account for warnings about removing unused blocks themselves as well 2024-03-29 00:16:18 +01:00
Irmen de Jong
56c1035581 Merge branch 'master' into multi-assign
# Conflicts:
#	docs/source/todo.rst
#	examples/test.p8
2024-03-26 22:09:16 +01:00
Irmen de Jong
ba1e907c79 fix divmod; out args are written to and should be potential constants 2024-03-26 22:04:44 +01:00
Irmen de Jong
edc83305a4 allow multiple targets in AssignTarget 2024-03-22 21:51:08 +01:00
Irmen de Jong
ad4880997a no operand swap on logical expressions with shortcircuit evaluation (and,or are no longer associative!) 2024-03-20 22:34:48 +01:00
Irmen de Jong
a94cfd34f5 don't apply absorption law on functioncall operands 2024-03-15 01:04:27 +01:00
Irmen de Jong
3535c1acda fix broken boolean != comparison optimization 2024-03-13 20:23:42 +01:00
Irmen de Jong
80f39e8097 Merge branch 'booleans'
# Conflicts:
#	compiler/res/prog8lib/cx16/monogfx.p8
#	compiler/res/prog8lib/virtual/monogfx.p8
#	compiler/src/prog8/compiler/astprocessing/BoolRemover.kt
#	compiler/test/TestTypecasts.kt
#	docs/source/todo.rst
#	examples/cx16/highresbitmap.p8
#	examples/test.p8
#	httpCompilerService/src/prog8/http/TestHttp.kt
2024-03-11 01:00:48 +01:00
Irmen de Jong
04f7b772a3 lib updates, removed unused and obsolete http and dbus modules 2024-03-05 23:42:35 +01:00
Irmen de Jong
9826d7c494 optimize certain boolean comparisons more 2024-03-05 03:09:53 +01:00
Irmen de Jong
84afb374e6 nostrictbool array conversions 2024-03-03 17:48:52 +01:00
Irmen de Jong
7d8cdcbfea more bool fixes and optimizations in codegen 2024-03-02 23:19:39 +01:00
Irmen de Jong
6b87cbb703 optimizers 2024-03-02 23:19:20 +01:00
Irmen de Jong
b27368175d get rid of problematic rewrite of certain for loops that were causing the end expression to be evaluated every loop iteration 2024-02-20 21:03:21 +01:00
Irmen de Jong
01bbc2234e fix absorption law optimization, add 2 additional optimizations 2024-02-14 23:12:54 +01:00
Irmen de Jong
a4f697bae1 faster 2024-02-10 23:56:55 +01:00
Irmen de Jong
4dc50cb551 fix unused subroutine removal not removing all unused subs 2024-02-10 21:26:53 +01:00
Irmen de Jong
d7f72056fc rest of the array copying 2024-02-10 17:16:06 +01:00