Commit Graph

1159 Commits

Author SHA1 Message Date
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
031f647952 allow casting negative numbers to unsigned, result = 2's complement 2022-06-05 14:21:10 +02:00
Irmen de Jong
dbb92881a1 fixed X register corruption in some cases of rol() and ror() 2022-06-04 21:10:48 +02:00
Irmen de Jong
10bf7f5d07 fix: again gives proper name redefinition errors in same scope 2022-06-04 20:15:46 +02:00
Irmen de Jong
1e61d84fd1 vm: fix expression codegen for pointer indexing 2022-06-04 19:32:35 +02:00
Irmen de Jong
2002412026 optimized codegen for pointer indexing (read expressions) 2022-06-04 17:20:17 +02:00
Irmen de Jong
7f69517fd4 preparing optimizing pointer indexing 2022-06-04 16:18:27 +02:00
Irmen de Jong
c40cfaa388 preparing optimizing pointer indexing 2022-06-04 14:23:02 +02:00
Irmen de Jong
5fe6aa2800 fix swap() code for pointervars 2022-06-03 23:13:35 +02:00
Irmen de Jong
b459b09b2f vm: fix comparison datatype error; primes.p8 works again 2022-05-24 18:26:07 +02:00
Irmen de Jong
3f5877dbcc vm: fix array iteration 2022-05-23 21:24:36 +02:00
Irmen de Jong
e659b91c4d vm: fix storezm/storezx instructions 2022-05-23 21:01:02 +02:00
Irmen de Jong
b646f50265 vm: implemented in-memory bit shift instructions 2022-05-23 20:15:20 +02:00
Irmen de Jong
0a48ef3030 vm: just use new register instead of trying to (ab)use reg 0 2022-05-22 23:38:46 +02:00
Irmen de Jong
ba614801ee cleanup 2022-05-22 23:11:22 +02:00
Irmen de Jong
fd6eb47e68 added inlining certain trivial non-asm subroutine calls 2022-05-22 20:22:09 +02:00
Irmen de Jong
e69aeb8b98 added warning about shadowing variables 2022-05-22 17:34:08 +02:00
Irmen de Jong
26ea1da146 vm: add in-place bitwise or,and,xor 2022-05-20 20:50:27 +02:00
Irmen de Jong
461b6499ef vm: add in-place add/sub 2022-05-19 22:54:50 +02:00
Irmen de Jong
c769920b6e vm: fix signed divide 2022-05-19 22:24:57 +02:00
Irmen de Jong
181b98ef9e vm: implemented some self-assign instructions 2022-05-18 22:15:42 +02:00
Irmen de Jong
4e1184a400 vm: added some of the sin cos tables in math.p8 2022-05-17 22:56:00 +02:00
Irmen de Jong
e52d9e3210 vm: split off assignment codegen to its own file 2022-05-17 22:38:31 +02:00
Irmen de Jong
dc6475c91b vm: fixed non-byte array indexing 2022-05-17 18:53:33 +02:00
Irmen de Jong
0bf00d1ca4 c64/c128 targets: perform cleanup at program exit such as re-enabling run-stop key and character set switching. 2022-05-15 16:44:26 +02:00
Irmen de Jong
d1a707df57 fix assigning a pointer (uword) to string not copying the correct memory 2022-05-15 16:10:58 +02:00
Irmen de Jong
4dc9b45297 vm: fixed string comparisons, added missing vm string module 2022-05-13 23:10:13 +02:00
Irmen de Jong
6e31eebfb5 vm: ifElse codegen uses proper branching instructions now 2022-05-12 21:26:17 +02:00
Irmen de Jong
a7df828932 vm: codegen uses INCM/DECM if possible 2022-05-12 19:40:31 +02:00
Irmen de Jong
517cf61d11 vm: limit int instructions to just 2 register args 2022-05-11 22:36:47 +02:00
Irmen de Jong
4be7bc8323 vm: limit float instructions to just 2 register args 2022-05-11 22:09:46 +02:00
Irmen de Jong
74c05d00a9 vm: fix comparison operator codegen for floats 2022-05-11 17:07:21 +02:00
Irmen de Jong
bacba629a5 vm: use shift-one instructions in codegen 2022-05-11 15:50:51 +02:00
Irmen de Jong
14e36f1362 vm: fix assignment to array 2022-05-11 15:26:54 +02:00
Irmen de Jong
d43ad849d1 vm: actually use the store-zero instructions in codegen 2022-05-11 15:18:36 +02:00
Irmen de Jong
627aa61184 clean up subroutine inlining, basis for new try 2022-05-09 15:42:58 +02:00
Irmen de Jong
fef52c0112 automatically convert multi-compare expression (if X==1 or X==2..) to contaiment check if X in [1,2,..] 2022-05-08 13:21:34 +02:00
Irmen de Jong
8c4765b386 vm: support non-unary functions in pipe expressions 2022-05-07 20:42:05 +02:00
Irmen de Jong
7c121bfc01 first steps to support multiple args in pipe expressions 2022-05-07 19:00:47 +02:00
Irmen de Jong
942c5cc04b fix crash when optimizing pipe expression too aggressively 2022-05-07 17:29:36 +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
09d3451d9d vm: accept %asmbinary (but it is eventually ignored in code execution) 2022-05-05 21:43:31 +02:00
Irmen de Jong
b1a49e5f29 vm: implement rest of float instructions 2022-05-04 22:31:45 +02:00
Irmen de Jong
da01a5b4dc vm: implement float to integer cast, any, all, reverse 2022-05-04 22:08:21 +02:00
Irmen de Jong
3f9cdd9b56 vm: fix mul and div instructions 2022-05-04 01:10:59 +02:00
Irmen de Jong
0f9e87d7bb fixed compiler crash when casting float to integer, fixed float to int cast value error on cx16 2022-05-03 23:43:38 +02:00
Irmen de Jong
0869789214 vm: implement float type casts to integer types 2022-05-02 23:38:32 +02:00
Irmen de Jong
10c8cc35c5 vm: implement float divide multiply sub add 2022-05-02 21:53:43 +02:00
Irmen de Jong
30c2e3e8ff vm: fix comparisons codegen 2022-05-02 21:32:45 +02:00
Irmen de Jong
86cc2f1075 vm: implementing more fp instructions 2022-05-02 21:06:14 +02:00