Commit Graph
494 Commits
Author SHA1 Message Date
Irmen de Jong 99f29cb9b9 fix broken min/max rewrite when the target aliases an operand.
fixes #247
2026-09-30 21:15:32 +02:00
Irmen de Jong 3d675a460e don't fold signed division by a power of two into a shift 2026-09-28 21:22:01 +02:00
Irmen de Jong d51ca62431 Fix poke->assignment optimizer dropping AddressOf index
StatementOptimizer rewrote pokel(&arena[1], x) to arena = x, ignoring
AddressOf.arrayIndex (and dereference), which miscompiled implicit
indexed-base struct field writes such as arena[1].s = X. All four
poke/pokew/pokel/pokef rewrites now require a plain variable address.
2026-09-09 02:05:20 +02:00
Irmen de Jong bd0457f262 Allow const expressions for 2D array dimensions (not just numeric literals) 2026-09-08 23:13:54 +02:00
Irmen de Jong ce2b298d6f code cleanups 2026-09-08 22:36:54 +02:00
Irmen de Jong 54507ad9b3 Merge branch 'v12maintenance'
# Conflicts:
#	gradle.properties
2026-09-07 19:19:52 +02:00
Irmen de Jong 1358a535e3 Fix inliner crash when inlining a sub that assigns to its own parameter
Also error on a variable declaration directly followed by another statement on the same line.

fixes #235
2026-09-04 22:13:11 +02:00
Irmen de Jong 9a461628f2 Merge branch 'v12maintenance' 2026-09-02 19:14:57 +02:00
Irmen de Jong c8f309307f fix inlining bug: subroutines with register-mapped parameters cannot be inlined 2026-09-02 19:10:21 +02:00
Irmen de Jong 4b320013cf Merge branch 'master' into new-codegens
# Conflicts:
#	codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/PointerAssignmentsGen.kt
#	compiler/test/TestPointers.kt
#	docs/source/todo.rst
#	examples/test.p8
2026-08-21 19:14:29 +02:00
Irmen de Jong 6b91a464c0 fix spelling errors 2026-08-20 23:55:26 +02:00
Irmen de Jong c81d9b25ac Merge branch 'master' into new-codegens
# Conflicts:
#	compiler/test/ast/TestConst.kt
#	docs/source/todo.rst
2026-08-18 23:52:02 +02:00
Irmen de Jong 3aab457a47 fix const evaluation type truncation error for bitwise operations between constants of different types 2026-08-18 23:48:06 +02:00
Irmen de Jong 34f0bea4e8 fix pointer unit tests, consolidate pointer type selection for target 2026-08-17 03:30:17 +02:00
Irmen de Jong 3514bd61ab new syntax feature: const type can be omitted (defaults to long for integers now) 2026-08-11 21:27:07 +02:00
Irmen de Jong c53e72c5b2 Merge branch 'master' into new-codegens
# Conflicts:
#	compiler/test/TestCompilerOnExamples.kt
2026-08-09 23:05:04 +02:00
Irmen de Jong 41c2b9c039 fix bit shift code for shifts by 16/32 bits or more 2026-08-09 14:26:45 +02:00
Irmen de Jong b5dfc0cd97 fix debug message and tests 2026-08-09 00:32:58 +02:00
Irmen de Jong a5978a913b m68k: added coroutines module 2026-08-06 22:08:59 +02:00
Irmen de Jong 1c71f702f4 fix invalid const-folding of certain strings char classification routines such as isupper() 2026-08-05 02:55:36 +02:00
Irmen de Jong 3d3c567ea6 fix memory-byte read sign extension error when the byte was signed 2026-08-05 02:54:59 +02:00
Irmen de Jong 82342268da fix too conservative Inliner gates, and possible endinanness problem. Optimized nested msb/lsb on m68k. 2026-08-04 21:01:29 +02:00
Irmen de Jong 30e576e253 defensive fix for wrong datatype in pointer comparisons 2026-08-04 20:44:05 +02:00
Irmen de Jong a5782c300a fix compiler crash on out of range pointer address values 2026-08-04 20:24:50 +02:00
Irmen de Jong 84f720b63b fix pokew/pokel pointer size mismatch 2026-08-04 19:46:49 +02:00
Irmen de Jong b8cded4373 revert back to fast (but slightly inaccurate) signed bitshifting for division optimization 2026-08-04 19:41:14 +02:00
Irmen de Jong cf714d8e0c fix invalid optimization of signed division into a shift (wrong rounding result) - 6502 codegen only 2026-08-04 16:16:38 +02:00
Irmen de Jong 86c2f711ed fix invalid const-folding of certain strings char classification routines such as isupper() 2026-08-04 15:59:08 +02:00
Irmen de Jong 7138ee024b fix memory-byte read sign extension error when the byte was signed 2026-08-04 15:45:14 +02:00
Irmen de Jong fea52c6145 uword comparison optimizations not for m68k 2026-08-03 22:45:46 +02:00
Irmen de Jong 4b20440efe another bit shift optimization not for m68k 2026-08-03 22:30:30 +02:00
Irmen de Jong c39410afc2 x/256 ast optimization not for m68k 2026-08-03 22:19:29 +02:00
Irmen de Jong 93b953cf60 implement IR ADDIM and SUBIM in the new codegens 2026-08-03 21:53:54 +02:00
Irmen de Jong 8405e6f2a3 fix endianness issue with msw/lsw on m68k 2026-08-03 15:49:39 +02:00
Irmen de Jong 491b28f6b6 chained expression splitting is only beneficial on the 6502 2026-08-03 15:26:52 +02:00
Irmen de Jong d144235dc9 Merge branch 'master' into new-codegens 2026-08-03 14:35:47 +02:00
Irmen de Jong 9cbbf85a85 fix chained expression optimization bug 2026-08-03 14:22:46 +02:00
Irmen de Jong 2fa82ff3ad fix ast remainder optimization check 2026-08-03 13:26:11 +02:00
Irmen de Jong 9936a855ab fix ast remainder optimization check 2026-08-03 13:05:26 +02:00
Irmen de Jong 3e03980478 tweaking ast optimizations for m68k 2026-08-03 12:45:48 +02:00
Irmen de Jong b6e503a67b fix amiga textio and m68k alignment issues 2026-08-03 02:33:19 +02:00
Irmen de Jong abea7bf329 fix const evaluation type problem in bitwise operations 2026-07-14 07:28:31 +02:00
Irmen de Jong 9a2851a9d5 fix const evaluation type problem in bitwise operations 2026-07-14 07:12:52 +02:00
Irmen de Jong 4506a3cb3e pass compilation target to more places to be able to determine correct types 2026-07-12 03:52:57 +02:00
Irmen de Jong f977daafbb value casting now gets passed the compilation target (needed for correct pointer type casting) 2026-07-10 22:23:33 +02:00
Irmen de Jong 8a7922ffcc fix split words arrays on m68k to be not split 2026-07-10 01:47:18 +02:00
Irmen de Jong a3d14003cb Enhanced inlining: support subroutines with one simple parameter. NOTE: risky optimization, maybe still broken in obscure cases
also improve parent pointer relinking, fix namespace scoping, and refine assembly checks.
2026-06-19 04:57:54 +02:00
Irmen de Jong b5fc25b2f4 Merge branch 'v12.2.1'
# Conflicts:
#	compiler/test/TestCompilerOnExamples.kt
#	docs/source/_static/symboldumps/skeletons-cx16.txt
2026-06-17 19:41:34 +02:00
Irmen de Jong 0f80b695e7 Fix invalid optimizer edge cases 2026-06-17 01:18:39 +02:00
Irmen de Jong 88a3e5b23f Merge branch 'v12.2.1'
# Conflicts:
#	compiler/test/TestCompilerOnExamples.kt
#	compiler/test/codegeneration/TestArrayThings.kt
#	examples/test.p8
2026-06-16 00:48:35 +02:00