Commit Graph

709 Commits

Author SHA1 Message Date
Irmen de Jong
87c46ba730 check boolean array size mismatch.
check for weird string assignment.
check for X16 problematic cpu instructions rmb, smb, bbr, bbs.
tweak number node equality wrt bool type
2024-01-21 19:15:22 +01:00
Irmen de Jong
fdbbd181ea fixes for address-of uword pointer array expressions 2024-01-17 22:51:15 +01:00
Irmen de Jong
69075376dc get rid of the noshortcircuit fallback 2024-01-17 21:24:41 +01:00
Irmen de Jong
504d1440cc fixed rol(),rol2(),ror(),ror2() 2024-01-17 21:02:17 +01:00
Irmen de Jong
0cfcc5cd29 fix VM sgn() function for floats 2024-01-16 01:34:55 +01:00
Irmen de Jong
e0de662f8e fix signed word bitshift right (>8 shifts) 2024-01-16 01:08:16 +01:00
Irmen de Jong
968609d06d IR: fix problems with symbol offsets and unused subroutines/chunks 2024-01-13 16:43:41 +01:00
Irmen de Jong
3b199a2a87 added cx16 example: automatons.
added debug mode and RTC to cx16 emulator launchers.
dt error details.
2024-01-12 21:40:30 +01:00
Irmen de Jong
bc3f2db3de Fix call graph to no longer mark subroutines unused, that still get their variables referenced somewhere.
Revert palette.default_colors_16[] back to palette.set_default16.colors.
2024-01-11 22:12:01 +01:00
Irmen de Jong
45a9751217 fix type of optimized lsb() / mkword() arguments when signed.
printast1 command line option now also works in case of compilation errors.
2024-01-10 23:57:44 +01:00
Irmen de Jong
f27e3478b9 fix const value of AddressOf for certain types 2024-01-09 22:10:25 +01:00
Irmen de Jong
f8084e7955 fix const replacement optimization error on memory mapped variable 2024-01-07 18:48:18 +01:00
Irmen de Jong
d85c347a6c optimize /256 more, and fixed a unsigned byte word cast error 2024-01-07 02:34:05 +01:00
Irmen de Jong
f2daa17b92 tweak some not optimizations
cleanup IR typestring
2024-01-05 17:49:56 +01:00
Irmen de Jong
6d9fccacb1 boolean not expression tweaks and optimizations 2024-01-05 13:32:16 +01:00
Irmen de Jong
37638e7ed0 added Absorption laws optimization 2024-01-05 00:36:47 +01:00
Irmen de Jong
8a0e650511 apply De Morgan's laws for logical not, results in smaller code 2024-01-04 23:45:46 +01:00
Irmen de Jong
56ba24962c fixed 'not not x' optimization to just 'x' 2024-01-04 15:02:21 +01:00
Irmen de Jong
242a3eec63 fix data type difference error on range from and to values 2024-01-03 21:46:22 +01:00
Irmen de Jong
6aed7e429a allow containment check in a range expression ("run time" range expression) 2024-01-03 01:17:13 +01:00
Irmen de Jong
99c29343de added -printast1 and -printast2 command line options 2024-01-01 22:48:19 +01:00
Irmen de Jong
d446b57d05 fix unittest 2024-01-01 16:11:50 +01:00
Irmen de Jong
d1f8ee1e56 replace most common subexpressions by a single temp variable 2024-01-01 14:57:24 +01:00
Irmen de Jong
75fd263e85 fix expericodegen crash related to shortcircuiting 2023-12-31 01:28:17 +01:00
Irmen de Jong
8f18b5b8a7 keep distinction between logical and bitwise boolean operators 2023-12-30 01:08:42 +01:00
Irmen de Jong
f790182f0b adding short-circuit boolean expression evaluation (in IR codegen) also -noshortcircuit cli option 2023-12-30 01:08:41 +01:00
Irmen de Jong
d03ff1e4d0 improved var -> const replacement, now done in constfolding already (fixes some obscure problems later on)
Also fixed some directive parenting errors
2023-12-29 19:48:40 +01:00
Irmen de Jong
779a5606a7 add unittest for aa%bb (without space) to be parsed correctly as modulo, not directive 2023-12-29 05:11:50 +01:00
Irmen de Jong
ccc11e49d2 fix asmgen for uword shift right 8 or more bits 2023-12-29 05:06:09 +01:00
Irmen de Jong
e35cfd4971 get rid of the redundant 'f' suffix of several funtions in floats module (breaking change!)
Unfortunately a few routines (minf, maxf, clampf) remain unchanged, because removing the 'f' would make them clash with a builtin function.

floats.rndf -> floats.rnd
floats.parse_f -> floats.parse
floats.rndseedf -> floats.rndseed
floats.print_f -> floats.print
floats.str_f -> floats.tostr
2023-12-29 03:12:44 +01:00
Irmen de Jong
a0594cbce3 const optimizer now knows about a bunch of library functions, such as math.* 2023-12-28 20:14:13 +01:00
Irmen de Jong
9c1b11d605 some WARN messages are now INFO 2023-12-28 14:20:47 +01:00
Irmen de Jong
44d82f9190 add unit tests 2023-12-28 13:30:07 +01:00
Irmen de Jong
09c6cb4d6b replace unwritten vars by consts. Improved const eval.
Fixed some slight bugs in library code
2023-12-28 05:17:15 +01:00
Irmen de Jong
2eb137618e refactor block options 2023-12-26 22:13:08 +01:00
Irmen de Jong
4bb2b8ca9b make isArray a computed property by simply checking the datatype 2023-12-26 19:58:08 +01:00
Irmen de Jong
0a4de45453 get rid of vardecl.declareddatatype 2023-12-26 19:33:58 +01:00
Irmen de Jong
ffdc658dc8 type error tweaks 2023-12-26 18:49:01 +01:00
Irmen de Jong
7530f4407b ir tag change INLINEASM->ASM 2023-12-26 16:15:19 +01:00
Irmen de Jong
0d44492086 push,pushw,pop and popw are no longer built-in functions but regular routines in sys 2023-12-26 14:47:31 +01:00
Irmen de Jong
8ae435549d added -slabshigh N and -slabsgolden for memory() slabs 2023-12-23 20:45:30 +01:00
Irmen de Jong
9b113c0cbb added -varsgolden to put BSS into Golden Ram at $0400 2023-12-23 20:11:50 +01:00
Irmen de Jong
ad9eaeafeb call now returns a word value 2023-12-22 22:24:11 +01:00
Irmen de Jong
49ec430592 cx16: added several word Vera-registers as memory-mapped vars as well 2023-12-21 00:28:09 +01:00
Irmen de Jong
6bc079c7b7 more asm symbol prefixing: variables with p8v_, subroutines with p8s_ etc
labels with p8l_ . All this to avoid symbol clashes in the generated assembly code.
Everything got its own distinguishing prefix so we're done with it once and for all and have only 1 breaking change moment.
2023-12-20 22:20:59 +01:00
Irmen de Jong
299419917e added symbol ambiguity error (variable vs block name for scoped symbols)
fixes #114
2023-12-20 00:28:15 +01:00
Irmen de Jong
b7279a3d9e fix 'not in' parsing error
fixes #115
2023-12-19 19:49:25 +01:00
Irmen de Jong
e14b854d7b cx16: added audio kernal routines example 2023-12-19 01:47:05 +01:00
Irmen de Jong
ae66fcac1e added call builtin function for indirect JSR 2023-12-17 15:45:28 +01:00
Irmen de Jong
a8be94de6b better error message when attempting to cast a float to integer 2023-12-15 22:28:06 +01:00