long bitwise operator expressions

This commit is contained in:
Irmen de Jong
2025-09-27 23:29:10 +02:00
parent cd1862dd9f
commit e7fc0360ad
3 changed files with 37 additions and 136 deletions

View File

@@ -1,9 +1,6 @@
TODO
====
implement the bitwise & | ^ operations as expressions on longs (all types args)
LONG TYPE
---------
- call convention: return long -> return it in R0+R1.... because AY is only 16 bits...
@@ -176,7 +173,7 @@ Optimizations
- more optimized operator handling of different types, for example uword a ^ byte b now does a type cast of b to word first
- optimize longEqualsValue() for const and variable operands to not assign needlessly to R0-R3.
- optimize inplacemodificationLongWithLiteralval() for more shift values such as 8, 16, 24 etc but take sign bit into account!
- optimize optimizedBitwiseExpr() for const and variable operands to not assign needlessly to R0-R3.
- optimize inplacemodificationLongWithLiteralval() for more shift values such as 8, 16, 24 etc but take sign bit into account!
- Port benchmarks from https://thred.github.io/c-bench-64/ to prog8 and see how it stacks up.
- Since fixing the missing zp-var initialization, programs grew in size again because STZ's reappeared. Can we add more intelligent (and correct!) optimizations to remove those STZs that might be redundant again?