Irmen de Jong
9daab16ece
Optimize redundant frame zero stores safely
2026-10-26 22:54:00 +01:00
Irmen de Jong
4427f986cc
fuse extending loads into single IR load opcodes
...
add 8 IR opcodes (LOADMZ/LOADMS/LOADMZL/LOADMSL and the indexed
LOADI variants) and a peephole fusion pass that replaces
loadm/indexload followed by ext/exts/extl/extls with a single
extending load. Implemented for m68k, new6502 and the VM; run
deduplicateAddressComputations before fusion so it still sees the
unfused loadm+ext pairs.
2026-10-26 21:12:11 +01:00
Irmen de Jong
52e5535ec5
enable bias-corrected signed div by power of two for m68k
2026-10-25 21:56:59 +01:00
Irmen de Jong
da2288db93
improved variable source line position
2026-10-19 22:16:53 +02:00
Irmen de Jong
e3ca9ae4a8
Fix virtual target typed pop results
2026-10-17 02:12:17 +02:00
Irmen de Jong
38c60a2d75
harden AstWalker detached-subtree skipping and extract shared canSkipExplicitCmpi helper
2026-10-17 01:46:35 +02:00
Irmen de Jong
5e83c44300
fix wrong result for short-circuit boolean and/or on the virtual target
2026-10-17 01:43:08 +02:00
Irmen de Jong
6cac707fd1
code cleanups
2026-10-13 22:40:19 +02:00
Irmen de Jong
0b902f06b5
m68k: word-packed stack argument slots
2026-10-13 21:37:43 +02:00
Irmen de Jong
eda21a6ebf
Fix in operator on arrays larger than 255 elements
2026-10-11 02:05:21 +02:00
Irmen de Jong
592637856f
m68k: cleaner recursive defer errors
2026-10-10 02:02:25 +02:00
Irmen de Jong
233ca21492
m68k: frameable inline asm, word-sized sys.exit, and sys.die alerts
2026-10-10 00:19:22 +02:00
Irmen de Jong
3d78415088
better vm error for %asm
2026-10-08 04:37:19 +02:00
Irmen de Jong
0189903a63
m68k: pin @shared variables to static storage
2026-10-08 04:17:40 +02:00
Irmen de Jong
9c9552174e
m68k: stackful coroutines fixed with per-task stacks, new %option noframe
2026-10-08 01:59:50 +02:00
Irmen de Jong
70bb199e12
m68k: pop frame on jumps leaving subroutine; reject dispatch to subs with parameters
2026-10-07 23:46:48 +02:00
Irmen de Jong
5e709fca7e
m68k: stack-frame zero-clear coalescing
2026-10-07 19:06:16 +02:00
Irmen de Jong
cc8df33418
m68k: plan for optimized stack frame zeroing
2026-10-07 19:06:16 +02:00
Irmen de Jong
a1a48405b0
m68k: fix a5 frame pointer register clobbering
2026-10-07 19:06:16 +02:00
Irmen de Jong
acc8705ea8
bugfix for m68k stack memory model
2026-10-07 19:06:16 +02:00
Irmen de Jong
bbff472457
doc cleanup
2026-10-07 19:06:16 +02:00
Irmen de Jong
353b0c84b7
slice 5 for m68k stack memory model
...
(slice 4 was skipped)
2026-10-07 19:06:16 +02:00
Irmen de Jong
329b3df4a3
slice 3 for m68k stack memory model
2026-10-07 19:06:16 +02:00
Irmen de Jong
fe90ca572d
slice 2 for m68k stack mememory model
2026-10-07 19:06:16 +02:00
Irmen de Jong
26bbd6c1fe
vertical slice prototype for m68k stack mememory model
2026-10-07 19:06:16 +02:00
Irmen de Jong
8c2bc15b41
Fix IR peephole crash on lsigb.l + ext.b with mismatched register types
...
regression was introduced in commit 2ce7a63c1e
2026-10-03 14:01:56 +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
e38f71fd2d
keep routines referenced from struct instance initializers, so that unusedcoderemover doesn't strip them
2026-09-30 21:33:26 +02:00
Irmen de Jong
6c107379df
fix broken struct-array initializer prefixing for address-of arguments
...
fixes #246
2026-09-30 21:15:32 +02:00
Irmen de Jong
90a7c41586
fix IR symbol prefixing
2026-09-25 02:04:43 +02:00
Irmen de Jong
b1a9ba929d
remove ARRAY_POINTER and make pointer arrays target-independent
2026-09-25 01:18:32 +02:00
Irmen de Jong
4cbf93da85
fix Status flag extraction clobbers a register return value
2026-09-24 01:00:49 +02:00
Irmen de Jong
976b64185d
fix struct size truncation to 256 bytes on targets that allow larger structs (m68k)
2026-09-24 00:22:23 +02:00
Irmen de Jong
bf696bcf5e
fix multiple status flag returns in new codegens
2026-09-23 03:10:59 +02:00
Irmen de Jong
f086918e6f
add union types: structs where every field is at offset 0, thus saving memory
2026-09-23 00:07:44 +02:00
Irmen de Jong
2d070aaec4
Fix 6502 pointer-field augmented assignment clobbering scratch pointer
...
Fixes #245
2026-09-21 22:51:11 +02:00
Irmen de Jong
ba76fbfe85
fix code generation for "return <void function call>"
2026-09-17 22:39:53 +02:00
Irmen de Jong
3b0faa749a
Merge branch 'master' into structured-IR
...
Port end-exclusive for-loop codegen and M4 loop-counter peephole to the
structured operand API (IRInstructions factories, memory?.symbolName,
labelTarget, requireDest/requireSrcA).
2026-09-12 00:48:30 +02:00
Irmen de Jong
22a2f8cbc5
IR: end-exclusive increment+compare for step +-1 for-loops; fix DECM/BSTPOS on VM
2026-09-12 00:07:02 +02:00
Irmen de Jong
468850bc47
structured IR
2026-09-11 20:20:40 +02:00
Irmen de Jong
dbba6a94fa
Merge branch 'v12maintenance'
...
# Conflicts:
# codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AssignmentAsmGen.kt
# compiler/src/prog8/compiler/astprocessing/AstIdentifiersChecker.kt
# compiler/test/ast/TestVariousCompilerAst.kt
# compiler/test/codegeneration/TestExecution6502.kt
# examples/test.p8
# gradle.properties
2026-09-10 21:45:47 +02:00
Irmen de Jong
af06fdfffc
fix more 6502-only struct pointer-field bugs; add indexed in-place support
...
fixes #237
2026-09-10 19:20:02 +02:00
Irmen de Jong
ce2b298d6f
code cleanups
2026-09-08 22:36:54 +02:00
Irmen de Jong
687d86d36e
added amiga1200 target (68020 + FPU)
2026-09-06 18:25:15 +02:00
Irmen de Jong
e074fe614f
avoid extremely long array data source lines, and redundant label comments
2026-09-06 16:18:31 +02:00
Irmen de Jong
bbfb09e467
IR: uniform traversal
2026-09-05 00:06:30 +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
b0f1f655c3
codeGenIntermediate: fold struct-array field access to single LOADX/STOREX
...
Replace arr[idx].field (arr:Struct[Sz], idx variable) from
EXT+MUL #Sz + ADDR + ADD #fieldOff + LOADI/STOREI (5 ops) to
single indexed op: LOADX/STOREX arr+fieldOff,S=Sz and
STOREZX for zero. Reuses existing ,S=N + +off encoding.
2026-09-02 01:35:30 +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
1ba08ec6ec
make -dumpvars work on all compilation targets
2026-09-01 03:51:13 +02:00