Commit Graph

388 Commits

Author SHA1 Message Date
Irmen de Jong
a9f5dc036c fix cpu stack corruption in array assignment codegen 2023-06-27 18:49:49 +02:00
Irmen de Jong
b0794cf35e added hiram bank number to -varshigh 2023-06-27 00:27:34 +02:00
Irmen de Jong
eae41de27d improve errors generated for undefined symbols 2023-06-25 15:19:51 +02:00
Irmen de Jong
c6b2639ca4 fix compiler crash due to missing 6502 codegen
(assigning a direct memory read byte to a cx16 virtual register)
2023-06-14 21:10:01 +02:00
Irmen de Jong
ea6926e57d fix float expression crash: fl = abs/sqrt (fl)+0.5 2023-06-09 19:28:34 +02:00
Irmen de Jong
bbc02752c9 use split word arrays in various examples, fix codegen issue, docs 2023-05-29 15:34:33 +02:00
Irmen de Jong
9896bc110e fix some split array issues in 6502 codegen 2023-05-28 22:49:33 +02:00
Irmen de Jong
82898f7bba fix some split array issues in 6502 codegen 2023-05-28 22:24:56 +02:00
Irmen de Jong
d61283a8bc Merge branch 'master' into split-arrays 2023-05-28 14:25:37 +02:00
Irmen de Jong
1ee3f826cc fix sqrt() regression 2023-05-28 14:23:47 +02:00
Irmen de Jong
3ac9036c79 more split array stuff for 6502 2023-05-27 22:44:45 +02:00
Irmen de Jong
c94e292176 more split array stuff 2023-05-27 12:47:11 +02:00
Irmen de Jong
e18119e24c Merge branch 'master' into split-arrays 2023-05-26 19:25:57 +02:00
Irmen de Jong
52a77db60f adding split array type 2023-05-26 19:11:07 +02:00
Irmen de Jong
0513c250fb Merge branch 'v8_maintenance' 2023-05-23 20:42:51 +02:00
Irmen de Jong
48864ad6cf add a unit test that checks for 64tass availability 2023-05-23 20:42:36 +02:00
Irmen de Jong
061617122a Merge branch 'v8_maintenance'
# Conflicts:
#	examples/test.p8
2023-05-20 18:07:57 +02:00
Irmen de Jong
125ce3240f expr operands assignment refactor 2023-05-20 18:04:46 +02:00
Irmen de Jong
7215efe167 fix expr eval error in certain situations
such as pokew() with 2 complex operands
2023-05-20 17:42:35 +02:00
Irmen de Jong
91e1643627 update 3rd party libraries 2023-05-18 11:47:30 +02:00
Irmen de Jong
dcba4f4098 fix resultregister crash 2023-05-18 00:00:37 +02:00
Irmen de Jong
b43223cb7a added clamp() builtin function and floats.clampf() 2023-05-17 23:12:58 +02:00
Irmen de Jong
f37f062cdc fix for loop pre-check 2023-05-17 00:33:55 +02:00
Irmen de Jong
bd2bcb6994 Merge branch 'master' into version_9
# Conflicts:
#	codeGenIntermediate/src/prog8/codegen/intermediate/AssignmentGen.kt
#	compiler/res/prog8lib/c128/syslib.p8
#	compiler/res/prog8lib/c64/syslib.p8
#	compiler/res/prog8lib/cx16/syslib.p8
#	docs/source/todo.rst
#	examples/test.p8
#	intermediate/src/prog8/intermediate/IRInstructions.kt
2023-05-08 23:17:52 +02:00
Irmen de Jong
4c8898a639 fix typecheck crash on certain byte to word assignments 2023-05-08 23:02:48 +02:00
Irmen de Jong
ef46fb2685 refactor 2023-05-08 21:51:55 +02:00
Irmen de Jong
d5d6dd3614 optimize typecast expr 2023-05-08 03:30:14 +02:00
Irmen de Jong
6c233c6a0a optimize add/sub expr 2023-05-08 02:41:34 +02:00
Irmen de Jong
6db715d879 optimize multiplication expr 2023-05-08 02:10:54 +02:00
Irmen de Jong
ab02e8a546 optimize more carry flag assembly 2023-05-07 23:55:34 +02:00
Irmen de Jong
8cbfe64f19 optimize some carry flag assembly 2023-05-07 23:27:49 +02:00
Irmen de Jong
fd1e9971e4 asmsub Pc params and returnvalue must be boolean 2023-05-07 22:59:30 +02:00
Irmen de Jong
68336a76c5 optimized word comparison expressions 2023-05-07 20:40:48 +02:00
Irmen de Jong
393e914a86 optimized word equality comparison expressions 2023-05-07 18:55:17 +02:00
Irmen de Jong
ffb54110e9 optimized byte comparison expressions 2023-05-07 15:15:58 +02:00
Irmen de Jong
533d825f1a optimized ubyte comparison expressions 2023-05-07 14:47:31 +02:00
Irmen de Jong
c65279b672 optimized logical expressions more 2023-05-07 13:29:45 +02:00
Irmen de Jong
21bc505d85 for loops no longer execute when from var already reached beyond the end 2023-05-03 00:43:03 +02:00
Irmen de Jong
d81fdf6d6b for loops... 2023-05-02 22:55:58 +02:00
Irmen de Jong
92062d056d divmod() now works on multiple data types including float.
divmodw() has been removed
2023-05-02 01:19:53 +02:00
Irmen de Jong
06368ab0a1 sqrt() now works on multiple data types including float.
no need to use floats.sqrtf() anymore
2023-05-02 01:19:53 +02:00
Irmen de Jong
38efe25c68 abs() now works on multiple data types including float.
no need to use floats.fabs() anymore
2023-05-02 01:19:53 +02:00
Irmen de Jong
319079de7a sqrt 2023-05-02 01:19:53 +02:00
Irmen de Jong
025bf900a5 min max docs, added floats.minf() and maxf() 2023-05-02 01:19:53 +02:00
Irmen de Jong
2885f4f7b1 fix 2023-05-02 01:19:53 +02:00
Irmen de Jong
c07eda15b1 adding min() and max() 2023-05-02 01:19:53 +02:00
Irmen de Jong
4274296cf3 api change: new 'cbm' module that now contains the common CBM kernal variables and routines. 2023-05-02 01:19:53 +02:00
Irmen de Jong
76a203d4df api change: rename builtin func sqrt16 to sqrtw 2023-05-02 01:19:53 +02:00
Irmen de Jong
c35a183a64 extra fix 2023-04-29 17:24:01 +02:00
Irmen de Jong
9cdd5fe7f2 fix byte to word sign extension error in certain cases 2023-04-29 17:14:50 +02:00
Irmen de Jong
c21428215e fix possible mkword() error 2023-04-29 14:39:14 +02:00
Irmen de Jong
e056a28316 c128: fix memory bank resetting 2023-04-28 04:02:07 +02:00
Irmen de Jong
7c1d5cadd7 fix sort and reverse on strings on 6502 codegen 2023-04-10 19:33:24 +02:00
Irmen de Jong
c560abedba fix compiler crash on rol/ror array value 2023-04-09 22:29:11 +02:00
Irmen de Jong
f47498888c optimize imports 2023-04-07 22:34:23 +02:00
Irmen de Jong
2d85fd093e Merge branch 'new-expr-codegen'
# Conflicts:
#	codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt
#	codeGenIntermediate/src/prog8/codegen/intermediate/BuiltinFuncGen.kt
#	examples/test.p8
2023-03-29 23:56:16 +02:00
Irmen de Jong
d936568b76 added divmod() and divmodw() builtin functions to efficiently compute division and remainder in a single call 2023-03-29 23:46:44 +02:00
Irmen de Jong
4598a83e8e fixing new comparisons 2023-03-29 22:06:32 +02:00
Irmen de Jong
f4bf00ad31 fix string compare and ifelse 2023-03-28 22:46:01 +02:00
Irmen de Jong
729209574e fixing str compares codegen 2023-03-28 20:01:26 +02:00
Irmen de Jong
f28206d989 new attempt 2023-03-28 20:01:26 +02:00
Irmen de Jong
a7b9f53967 fix word comparison bug in asmgen 2023-03-26 23:44:06 +02:00
Irmen de Jong
1fa2e2e37d 3rd party library versions upgrades 2023-03-26 21:36:21 +02:00
Irmen de Jong
5cbf859458 cleanup 2023-03-26 15:08:57 +02:00
Irmen de Jong
629ed74d09 got rid of rpn deadend code... 2023-03-25 18:45:17 +01:00
Irmen de Jong
ca2af2ca63 todo 2023-03-25 18:23:33 +01:00
Irmen de Jong
52ab089615 rpn: implement more comparisons 2023-03-25 18:21:10 +01:00
Irmen de Jong
01461a196d implementing optimized comparisons 2023-03-25 00:08:21 +01:00
Irmen de Jong
04832f052a working on doing comparison codegen differently 2023-03-25 00:08:21 +01:00
Irmen de Jong
c8b2c8ae50 extra asmvars now also moved into BSS section instead of taking up space inline 2023-03-25 00:00:29 +01:00
Irmen de Jong
fc3ec57437 fix wrong branch in in-place byte equality expression 2023-03-23 00:45:47 +01:00
Irmen de Jong
cc81d6fe82 remove traces of ** operator 2023-03-22 00:51:58 +01:00
Irmen de Jong
9c71e2f1c8 rpn optimizations 2023-03-21 18:41:37 +01:00
Irmen de Jong
134fd62da8 RPN: better handling of bit shifts 2023-03-21 02:58:26 +01:00
Irmen de Jong
2afd283582 optimize RPN 2023-03-21 00:05:32 +01:00
Irmen de Jong
d265271148 fix rpn variable depth clobber and type error 2023-03-20 22:18:10 +01:00
Irmen de Jong
b40e397b28 fix rpn result type mismatch 2023-03-20 00:58:48 +01:00
Irmen de Jong
35ff1d996a only reuse actual counter vars 2023-03-19 21:53:49 +01:00
Irmen de Jong
deea0b05cb tweak cx16 system init and reset to not reset Vera any more
uses new audio routine to silence the audio
2023-03-19 21:16:23 +01:00
Irmen de Jong
a819b4a5a5 fix RPN issues 2023-03-19 17:35:28 +01:00
Irmen de Jong
df2d7d4734 fix RPN comparison exprs 2023-03-19 16:08:48 +01:00
Irmen de Jong
374464a1f8 weird condition operator... 2023-03-19 01:32:20 +01:00
Irmen de Jong
c8d0bf27af get rid of useless scope param 2023-03-19 00:58:45 +01:00
Irmen de Jong
6e4ae034b2 more Rpn optimizations 2023-03-19 00:48:12 +01:00
Irmen de Jong
52b560e72d more Rpn optimizations 2023-03-18 19:13:32 +01:00
Irmen de Jong
9b971ad222 fix PeekW and PokeW optimizations 2023-03-18 17:36:32 +01:00
Irmen de Jong
3613162d09 fix RPN string comparisons 2023-03-18 16:55:03 +01:00
Irmen de Jong
84b31e65e1 more rpn optimization 2023-03-18 14:23:17 +01:00
Irmen de Jong
dd78a3a686 fix typo in comparison function 2023-03-18 12:52:50 +01:00
Irmen de Jong
94c06e13f4 implementing Rpn optimizations 2 2023-03-18 12:43:45 +01:00
Irmen de Jong
e8bebe5a75 implementing Rpn optimizations 2023-03-18 01:13:02 +01:00
Irmen de Jong
5b0e1b4f9e a little rpn refactor 2023-03-17 23:04:56 +01:00
Irmen de Jong
8c0a93779b added first implementation of RPN 6502 codegen - all via stackeval still 2023-03-17 22:28:22 +01:00
Irmen de Jong
9241479da4 add "-rpn" command line switch to transform exprs to RPN in codegen 2023-03-17 22:28:22 +01:00
Irmen de Jong
8ffca93cd5 added transform routine for expr -> RPN 2023-03-17 22:28:22 +01:00
Irmen de Jong
7fea0c124a introduce PtRpn node to replace PtBinaryExpression later 2023-03-17 22:28:22 +01:00
Irmen de Jong
c07cd72e85 restored the non=problematic asm optimization steps... 2023-03-14 22:30:50 +01:00
Irmen de Jong
e2c101206c removed a problematic asm optimization step that could result in dysfunctional code when writing to I/O addresses 2023-03-14 22:14:48 +01:00
Irmen de Jong
ebd9f1471b fix crash when using const word as pointer and implement 2 missing assign codegen paths 2023-03-11 15:39:03 +01:00
Irmen de Jong
d76547ead4 don't crash on certain undefined symbols, give proper error instead
Also the error handlers in unit tests now de-duplicate messages just like the compiler itself does
2023-03-11 14:58:41 +01:00