Commit Graph

46 Commits

Author SHA1 Message Date
Irmen de Jong
53df0eb707 cleanups 2024-04-10 22:04:03 +02:00
Irmen de Jong
6b87cbb703 optimizers 2024-03-02 23:19:20 +01:00
Irmen de Jong
d4a2031c07 fix certain assignment data type mismatch crash 2024-01-25 21:14:20 +01:00
Irmen de Jong
a8c09d6144 removed a problematic bitshift replacement in the const evaluator 2024-01-21 23:05:51 +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
806654fc44 fix invalid const optimization with multiplication 2024-01-06 13:59:13 +01:00
Irmen de Jong
0e086d788b removed chained comparisons again, because they caused invalid expression evaluations due to changed semantics. 2024-01-01 16:00:11 +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
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
08a079a96e concerns with in for strings 2023-12-11 21:15:48 +01:00
Irmen de Jong
1509de390e various fixes
print_f() no longer prints a leading space.
Better error message if using float in for loop.
Fix crash when using non-const as when choice value.
VM print_f() more closely resembles the CBM version.
2023-12-02 18:23:54 +01:00
Irmen de Jong
88a1aa4f3d fix invalid optimization for integers (X/C1)*C2 , only ok for floats because of int rounding 2023-12-01 23:17:49 +01:00
Irmen de Jong
d9389afc66 fix compiler crash on certain constant expressions 2023-11-05 13:59:08 +01:00
Irmen de Jong
31c132c2eb several optimizations and compiler error fix for @(&var) and @(&var+1) 2023-09-14 23:04:23 +02:00
Irmen de Jong
c15c10a94e fixed 'unroll CONSTANTEXPR' compiler errors 2023-09-05 01:03:35 +02:00
Irmen de Jong
70ed2b4203 fix compilation of large bitshifts 2023-07-22 23:08:22 +02:00
Irmen de Jong
ffb2027a19 repeat loop count now always rounded to integer 2023-07-06 23:58:02 +02:00
Irmen de Jong
eae41de27d improve errors generated for undefined symbols 2023-06-25 15:19:51 +02:00
Irmen de Jong
fd269453a4 todos 2023-03-04 14:14:01 +01:00
Irmen de Jong
fb9902c536 avoid const fold loop on const bool thing=true
fixes #97
2023-02-22 21:27:08 +01:00
Irmen de Jong
4644c9b621 got rid of GoSub ast node and codegen complexity related to that.
sometimes programs get smaller, sometimes bigger.
2022-08-07 03:24:20 +02:00
Irmen de Jong
25aad8d7be improve const-evaluation of builtin expressions 2022-07-02 16:29:01 +02:00
Irmen de Jong
97cb0cbd08 tweak "not" removal/rewriting 2022-06-30 02:16:30 +02:00
Irmen de Jong
4b358abbb7 "not" operator removed from ast and codegen (it's been replaced with x==0 as equivalent) 2022-06-29 01:13:08 +02:00
Irmen de Jong
775c85fc18 don't swap operands that would change function evaluation order + vm: fix label casing error 2022-06-13 00:25:45 +02:00
Irmen de Jong
46ca0ac10d properly optimize X - -1 and X + -1, this also fixes type change of ubyte - 2 + 10 2022-06-05 15:35:29 +02:00
Irmen de Jong
348b3036ff now correctly accepts "xxx" * constexpr (where constexpr is not just a single const number) 2022-05-05 23:21:20 +02:00
Irmen de Jong
207a7e5160 move operator lists 2022-04-10 13:24:17 +02:00
Irmen de Jong
ed30108961 removed '**' power-operator. Use floats.pow() instead. 2022-03-27 13:16:34 +02:00
Irmen de Jong
9a798360f4 introduced codeAst and codeCore modules to reduce dependencies 2022-03-10 22:38:16 +01:00
Irmen de Jong
251b6fcf70 reducing dependencies 2022-03-10 02:09:34 +01:00
Irmen de Jong
7aa807ec7f proper error if attempting to do a containment check against non const range, and some cleanup in asmgen 2022-02-16 00:39:19 +01:00
Irmen de Jong
b47fc1c020 renames of some Ast node classes 2022-02-11 00:34:36 +01:00
Irmen de Jong
749ad700d8 naming consistency for some expression classes 2022-01-07 21:02:55 +01:00
Irmen de Jong
de6ce4a46e add "X in [1,2,3]" expression (efficient containment check) 2021-12-29 17:26:00 +01:00
Irmen de Jong
7b54aa0c7d more consistent naming of the statement classes 2021-12-28 13:56:47 +01:00
Irmen de Jong
08f87c321f fixed capitalization of operator sets to be consistent with other sets names 2021-12-15 23:43:14 +01:00
Irmen de Jong
3d743a1ba1 added more constfolding 2021-12-09 23:32:48 +01:00
Irmen de Jong
abca618008 added more constfolding 2021-12-09 23:12:12 +01:00
Irmen de Jong
0d2c3901a3 added more constfolding 2021-12-09 22:12:31 +01:00
Irmen de Jong
d8d56b195f comments 2021-12-09 21:13:13 +01:00
Irmen de Jong
107935ed31 add some more const folding patterns 2021-11-20 22:47:49 +01:00
Irmen de Jong
31491c62c5 add some more const folding patterns 2021-11-20 22:40:12 +01:00
Irmen de Jong
6af3209d4d add more const foldings 2021-11-17 00:57:00 +01:00
Irmen de Jong
f48d6ca9f8 simplified NumericLiteral to always just contain a Double instead of a Number for the value 2021-11-16 23:52:54 +01:00
Irmen de Jong
f21dcaa6fb split out the code optimizers into own project submodule 2021-10-29 02:42:10 +02:00