Commit Graph

350 Commits

Author SHA1 Message Date
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
Irmen de Jong
4600772e05 fix pokew mistake 2023-03-11 01:03:34 +01:00
Irmen de Jong
f350137a14 fix array in place assignments
fixes balls and snow examples amongst others
2023-03-10 04:07:50 +01:00
Irmen de Jong
6c34672549 array in-place assignment problem 2023-03-10 02:02:47 +01:00
Irmen de Jong
c968bacb01 fix pokew() crash with certain address expressions 2023-03-08 23:29:57 +01:00
Irmen de Jong
48fed4e6fb slight tweak to codegenerator backend interface 2023-03-08 00:14:38 +01:00
Irmen de Jong
fd269453a4 todos 2023-03-04 14:14:01 +01:00
Irmen de Jong
540b3ae2f4 tweak BinaryExpression splitting 2023-02-28 21:45:38 +01:00
Irmen de Jong
d282a2d846 remove cx16.callrom() just use callfar 2023-02-23 23:02:56 +01:00
Irmen de Jong
ba9268a09e added -varshigh compiler option to move BSS section.
Documented BSS a bit in the manual.
2023-02-22 22:44:29 +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
5318ba6c6e shrink evalstack from 2 to 1 page
c64=$cf00-$cfff, x16: $0700-$07ff
2023-02-21 22:52:04 +01:00
Irmen de Jong
d9e4f39ddc memset BSS section to zero all at once, less individual var=0 assigns 2023-02-21 00:26:21 +01:00
Irmen de Jong
435b9d8973 get rid of 'noreinit' option for now, because it resulted in unreliable code 2023-02-20 23:29:16 +01:00
Irmen de Jong
0ea70ba656 fix proper initialization of zeropagevars with 'noreinit' 2023-02-20 23:05:27 +01:00
Irmen de Jong
92a07b87d2 clearer 2023-02-20 02:32:36 +01:00
Irmen de Jong
c3c82282ba reinitGlobals option is clearer than the inverse 2023-02-19 19:09:29 +01:00
Irmen de Jong
adc15c24ef introduce bss segments 2023-02-19 18:12:37 +01:00
Irmen de Jong
9ca6860ffa tweak 2023-02-19 15:08:16 +01:00
Irmen de Jong
aaf375a57b move some utility methods into Pt Ast nodes itself 2023-02-16 22:45:35 +01:00
Irmen de Jong
c59df6ec20 optimize isZpVar 2023-02-16 00:41:20 +01:00
Irmen de Jong
5c3f41f64d reintroduce explicit PtAugmentedAssign ast node 2023-02-15 22:54:32 +01:00
Irmen de Jong
b95608f68a new common ICodeGeneratorBackend interface for all code generator classes 2023-02-12 23:52:54 +01:00
Irmen de Jong
f09bcf3fcf Merge branch 'master' into codegen-on-new-ast 2023-02-12 17:36:18 +01:00
Irmen de Jong
d0b18dec8e shuffle variable sorting around to attempt smaller compiled programs 2023-02-12 17:34:33 +01:00
Irmen de Jong
75d486b124 fix variable node casting 2023-02-12 17:04:58 +01:00
Irmen de Jong
4914609485 local varnames and fix uninitialized parents 2023-02-12 16:00:58 +01:00
Irmen de Jong
8f904f75bb Merge branch 'master' into codegen-on-new-ast 2023-02-11 14:40:23 +01:00
Irmen de Jong
549c598f51 variables sorted in asm 2023-02-11 14:35:56 +01:00
Irmen de Jong
ed68d604d6 fix break as indirect jump
fix subroutine param scoped name
2023-02-11 01:21:27 +01:00
Irmen de Jong
30d20a453b tweak SymbolTable and fix its unittest 2023-02-09 22:58:21 +01:00
Irmen de Jong
fe29d8a23f tweak codegen of inline sub 2023-02-09 21:59:09 +01:00
Irmen de Jong
694d088160 some cleanups about asmsub return registers and types 2023-02-09 03:19:57 +01:00
Irmen de Jong
6aabbffc62 some cleanups 2023-02-09 02:34:18 +01:00
Irmen de Jong
c75b1581d2 lookup via new ST 2023-02-05 01:15:23 +01:00
Irmen de Jong
109e118aba fix sub return register 2023-02-03 21:16:44 +01:00
Irmen de Jong
201b77d5b6 boolean vs byte cast fixing, and pointervar error 2023-02-02 00:57:20 +01:00
Irmen de Jong
a5ca08f33d fix popCpuStack to load values into asmsub register params 2023-02-01 22:00:37 +01:00
Irmen de Jong
988a3e4446 group the three Pt nodes that represent a variable in the p8 source under single interface IPtVariable 2023-01-31 23:29:15 +01:00