Skip to content

feat(codegen): array index access and multi-word array locals - #70

Merged
rieske merged 3 commits into
masterfrom
feature/array-index-mw
Jul 24, 2026
Merged

feat(codegen): array index access and multi-word array locals#70
rieske merged 3 commits into
masterfrom
feature/array-index-mw

Conversation

@rieske

@rieske rieske commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Multi-word stack slots for sized arrays (ValueScope word packing)
  • IndexAddress IR + StackMachine lowering for a[i] / p[i]
  • Size-aware byte/dword load/store for packed elements
  • &a[i] reuses the element address temp
  • Functional ArraysTest (1D R/W, loops, pointer arrays, char, address-of)

Stack

PR 1/N — base master. Next: array decay / multi-dim.

Test plan

  • Full local ctest
  • CI green / coverage non-regression

Sized arrays get multi-word stack slots; IndexAddress lowers a[i]/p[i]
with element stride; &a[i] reuses the element address; char stores use
byte/dword widths. Functional ArraysTest covers 1D read/write, loops,
pointer arrays, pointer subscript, and char arrays.
@mergify

mergify Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@coveralls

coveralls commented Jul 24, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 92.601% (+0.08%) from 92.526% — feature/array-index-mw into master

rieske added 2 commits July 24, 2026 14:50
Use movsx/movsxd so 64-bit ALU sees signed element values, and spill the
index before one-operand imul so a live index in RAX is not corrupted.
@rieske
rieske merged commit b87ce98 into master Jul 24, 2026
4 checks passed
@rieske
rieske deleted the feature/array-index-mw branch July 24, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants