Commit Graph
273 Commits
Author SHA1 Message Date
Irmen de Jong 78f9df203c inline math trig routines 2026-10-10 20:46:10 +02:00
Irmen de Jong c4679bd8af m68k: optimize lerp/interpolate/CRC routines; add interpolatew 2026-10-10 18:28:12 +02:00
Irmen de Jong 822cfd4f35 tweak textelite 2026-10-07 02:24:17 +02:00
Irmen de Jong 38db571f20 implemented -o / --output to specify specific output file 2026-10-02 22:33:43 +02:00
Irmen de Jong cff7732189 fix unsound index-reload peephole and extend it to two indexed accesses 2026-09-28 00:48:00 +02:00
Irmen de Jong 5222562493 move sqr range check into prog8_math.square instead of inlining it at each call site 2026-09-27 11:49:49 +02:00
Irmen de Jong c8cda7947a 6502 optimization for uword * ubyte 2026-09-26 05:15:41 +02:00
Irmen de Jong b8c975704a 6502 byte shift optimization for const multiplications 2026-09-26 03:25:25 +02:00
Irmen de Jong 2ef0ddd42c 6502 word shift optimization for const multiplications 2026-09-26 02:45:57 +02:00
Irmen de Jong 4eaba62f1e 6502 codegen: inline clamp() on word/uword when having compile-time constant bounds 2026-09-23 22:54:57 +02:00
Irmen de Jong 815f4109a5 cx16/gfx_lores: optimize text() by setting VERA address once per character 2026-09-19 22:06:05 +02:00
Irmen de Jong 457d55b392 fix potential endless loop in wavfile library, also made a correct implementation of it for m68k targets (little/big endianness problem resolved) 2026-09-17 00:04:34 +02:00
Irmen de Jong b21a984dbb even more optimized adpcm decoding routine 2026-09-16 19:04:49 +02:00
Irmen de Jong 7427e6ddad changed adpcm decoder by a table driven one, almost twice as fast now 2026-09-16 05:03:13 +02:00
Irmen de Jong 9621552056 add 'arena' allocator library
6502 targets use uword sizes with no alignment overhead; m68k/virtual use
long sizes with even-address alignment. Updated the six pointer examples that used to have their own arena implementation.
2026-09-13 05:43:57 +02:00
Irmen de Jong 5685a1f229 6502: tighter for loop code for word and long loop vars 2026-09-13 04:29:59 +02:00
Irmen de Jong 619a215a87 fix test size expectation 2026-09-07 19:14:58 +02:00
Irmen de Jong c12e27dacc cx16: added verafx-accelerated line routine, added cobramk3 example that uses it next to the cpu only version 2026-09-06 22:51:12 +02:00
Irmen de Jong 58f544fe14 Implement counted-loop IR (IRLoopChunk)
Replace the early lowering of constant repeat/for loops into p8_regfile
counter sequences with a first-class IRLoopChunk that carries the trip
count and body. This removes the fragile REGFILE-DEPENDENT m68k dbra
peephole and gives each backend explicit control.
2026-09-04 00:01:00 +02:00
Irmen de Jong 7dc05688bf Add peephole optimization to fold array[variable+const] index offsets
Adds three new passes to the 6502 assembly optimizer:

- optimizeFoldIndexOffset (byte/bool arrays)
- optimizeFoldIndexOffsetSplitWord (split word arrays)
- optimizeFoldIndexOffsetNonSplitWord (@nosplit word arrays)

fixes github issue #234
2026-09-03 21:36:29 +02:00
Irmen de Jong 59c41ad129 ir: add scaled indexing (S=) to LOADX/STOREX/STOREZX
Remove byte-offset pre-scaling from IR generation and encode
element index + explicit scale in the IR.  Effective address is
base + index*scale + disp (disp = symbolOffset).
2026-09-02 00:34:23 +02:00
Irmen de Jong deae2e6422 Unify variable and memory slab relocation with vars address configuration 2026-08-29 01:17:44 +02:00
Irmen de Jong 277e9c09bb making defer program-wide: also unwinds at program exit()/return from start() 2026-08-28 05:10:09 +02:00
Irmen de Jong 250ddda11b ir,m68k: add LOADP_INC/STOREP_INC for pointer post-inc (a0)+ 2026-08-27 02:57:54 +02:00
Irmen de Jong 8647b136bd 6502: fix constant byte store via pointer+const offset storing garbage
fixes regression from commit 102992911
2026-08-25 23:59:41 +02:00
Irmen de Jong 4199ab4200 fix broken unit test dependency on vasm 2026-08-23 16:07:27 +02:00
Irmen de Jong dfda43e747 more 6502 optimizations 2026-08-23 10:18:05 +02:00
Irmen de Jong 1029929111 6502 optimizations 2026-08-23 04:15:47 +02:00
Irmen de Jong ae55109a18 m68k: peepholes 2026-08-23 03:24:20 +02:00
Irmen de Jong d17c978892 Merge branch 'master' into new-codegens
# Conflicts:
#	compiler/test/TestCompilerOnExamples.kt
#	examples/c64/cube3d.p8
#	examples/cube3d-gfx.p8
#	examples/cx16/cobramk3-gfx.p8
#	examples/cx16/cube3d.p8
2026-08-22 19:12:06 +02:00
Irmen de Jong 2cd2bb0121 optimized the 3d rotation examples 2026-08-22 19:03:14 +02:00
Irmen de Jong 82828606e6 removed some string routines from shared because virtual target versions now need a 32 bit compatible implementation 2026-08-17 01:39:31 +02:00
Irmen de Jong 4fdd12929a vm: switched to m68k like 32 bits registers 2026-08-16 21:14:15 +02:00
Irmen de Jong fa1ceab78f M68K codegen: extend immediate call-argument forwarding and dead-store removal to floating-point registers and `p8_fregfile`. 2026-08-16 08:08:02 +02:00
Irmen de Jong d870c39aa4 m68k: use moveq and movea for call argument loading, drop +0 offset
- use moveq for small immediate call args (bytes 128-255 map to signed -128..-1)
- use movea.l for pointer/long args into address registers, dropping +0 suffix
- loadPointerToA0 also emits movea.l without the redundant +0 offset
- update stale C64 multiplexer expected output size
2026-08-15 18:49:28 +02:00
Irmen de Jong 22035077af clean up for loop vardecls in examples 2026-08-09 17:05:34 +02:00
Irmen de Jong 41c2b9c039 fix bit shift code for shifts by 16/32 bits or more 2026-08-09 14:26:45 +02:00
Irmen de Jong b5dfc0cd97 fix debug message and tests 2026-08-09 00:32:58 +02:00
Irmen de Jong e5d9609db1 IR: added new multi-bit shifting opcodes 2026-08-05 01:42:49 +02:00
Irmen de Jong b5fd07bb91 IR: added STOREIM instruction for immediate store constant to memory 2026-08-04 23:11:07 +02:00
Irmen de Jong 4097d51514 IR: more efficient code for comparisons against constants 2026-08-04 22:28:59 +02:00
Irmen de Jong af80ec6502 fix invalid optimization of signed division into a shift (wrong rounding result) - IR codegen 2026-08-04 17:42:12 +02:00
Irmen de Jong b9f65186cb fix expression operand swap bug when there are side effects 2026-08-04 14:49:01 +02:00
Irmen de Jong 3e03980478 tweaking ast optimizations for m68k 2026-08-03 12:45:48 +02:00
Irmen de Jong 247559858f fix bitwise instructions on m68k 2026-07-11 23:40:46 +02:00
Irmen de Jong cf2a5ae4f9 fix test sizes 2026-07-11 23:06:26 +02:00
Irmen de Jong 57714efb40 added pushp() and popp() builtin functions 2026-07-11 21:49:22 +02:00
Irmen de Jong 57254233e4 Merge branch 'master' into new-codegens
# Conflicts:
#	codeCore/src/prog8/code/target/NormalMemSizer.kt
2026-07-11 18:22:11 +02:00
Irmen de Jong 5b5f553d37 improved error message when attempting to alias types,
fix size test
2026-07-11 17:04:52 +02:00
Irmen de Jong cb240f6a4b Merge branch 'master' into new-codegens 2026-07-08 21:02:17 +02:00