Phase 2i-a — Element-wise array arithmetic¶
Summary¶
Matching 1d array[N, int] / array[N, float] operands support +, -, *, / with a new array result; sum(a * b) lowers via a temp product array.
Agent continuation¶
- Read
li-tests/math_linalg/elementwise_mul_float.li,sum_elementwise_product.li. - Run
cmake --build build && ./li-tests/run_all.sh(expect 165 pass). - Then merge PR stack through #142; optional SIMD for
ArrayBinOpF64lanes. - Blocked on broadcast / mismatched-length promotion (not in v1).
Changed¶
| Path | What |
|---|---|
compiler/types/typecheck.cpp | Element-wise array binop types |
compiler/mir/ | ArrayBinOpF64, ArrayBinOpI64; sum(expr) |
compiler/codegen/emit.cpp | Per-element loops |
li-tests/math_linalg/elementwise_*.li, sum_elementwise_product.li |
Not changed¶
**on arrays;%///on arrays.- 2d matrix element-wise.
@vectorizedauto-SIMD.
Breaking¶
N/A.
Security¶
N/A.
Performance¶
Scalar element loops; LLVM may autovec at -O3.
Downstream¶
docs/guide/math-hpc-examples.md—sum(a * b)row updated.- Tier 1
simd_dotcould usesum(a * b)style in a follow-up bench refresh.