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
Irmen de Jong
94822b8662
Add arrays of struct instances (StructType[N] vars)
...
Parser: accept `Type[N] name` between type and identifier
(Prog8ANTLR.g4, Antlr2KotlinVisitor) via elementToArray()
for STRUCT_INSTANCE; CodeDesugarer: handle struct-instance
bases, addressOfStructInstance(), whole-struct memcopy
(points[a]=points[b]), and fix variable-index 16-bit scaling
in 6502 AssignmentAsmGen.computeStructArrayElementAddress();
IR: preserve STRUCTDEFS round-trip, VM loader support;
m68k/new6502/intermediate backends; docs + todo updated.
Limitations: not as struct fields (AstChecker/
AstIdentifiersChecker error) nor as sub params.
2026-08-30 14:14:49 +02:00
Irmen de Jong
c8d29e6dc9
ir: more IR peephole optimizations
2026-08-29 00:29:50 +02:00
Irmen de Jong
a7b14c2931
ir: more optimized inplace array assignments
2026-08-28 23:38:54 +02:00
Irmen de Jong
a14a8f4e62
ir: deduplicate index canonicalization and strengthen regression tests
2026-08-28 23:00:51 +02:00
Irmen de Jong
cf50372515
ir: canonicalize LOADX/STOREX/STOREZX index width and remove guessed-type workaround
2026-08-28 22:23:55 +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
bde52cc134
ir: fix byte->long/pointer extension for 32-bit targets (single-type EXTL)
2026-08-26 23:55:17 +02:00
Irmen de Jong
8e739febf0
ir: m68k status-flag fusion - skip redundant CMPI #0 on ops that set Z
2026-08-26 23:41:36 +02:00
Irmen de Jong
3fcb4b4262
ir: canonicalize LOADX index width,
2026-08-26 23:18:06 +02:00
Irmen de Jong
02a118ec0e
deref assignment targets: use target pointer width for address temps and IR casts
2026-08-24 23:38:45 +02:00
Irmen de Jong
561f31329d
support pointer assignment targets like (expr as ^^Struct).field = v and func().field = v (grammar + CodeDesugarer poke desugar, IR pointer-cast widening, tests/docs)
2026-08-24 23:00:23 +02:00
Irmen de Jong
ae55109a18
m68k: peepholes
2026-08-23 03:24:20 +02:00
Irmen de Jong
2ce7a63c1e
IR: resolve loadx index-width type conflicts in usedRegisters; add conversion-collapse peephole
2026-08-23 02:41:12 +02:00
Irmen de Jong
198cf4d722
IR: fix for loop iteration overflow for 256 iters
2026-08-20 23:20:42 +02:00
Irmen de Jong
df659d285b
optimize imports
2026-08-18 01:28:35 +02:00
Irmen de Jong
34f0bea4e8
fix pointer unit tests, consolidate pointer type selection for target
2026-08-17 03:30:17 +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
cc4f27d121
vm: making VM 32 bit
...
work in progress: see vm32.md there are failing tests still
2026-08-16 19:49:28 +02:00
Irmen de Jong
65b6280618
fix string compares on 32 bits targets
2026-08-16 15:55:30 +02:00
Irmen de Jong
69def73f3f
m68k: allow assigning string constant to long/pointer variable (to get its address)
2026-08-16 06:18:33 +02:00
Irmen de Jong
a68cdd13a6
IR: added EXTL and EXTLS opcodes to help with pointer math
2026-08-15 22:58:15 +02:00
Irmen de Jong
fcc93b385d
IR: implement array in place / and %
2026-08-13 23:13:53 +02:00
Irmen de Jong
4c6d9b8f5f
even more IR peephole optimizations
2026-08-13 23:01:41 +02:00