TileOP: per-dimension static/dynamic B.DIM lowering (SS/SD/DS/DD) - #82
Conversation
Split every lb0/lb1 B.DIM site into four if-constexpr branches on ValidCol/ValidRow (SS/SD/DS/DD): - static dim -> B.DIM zero, %c[imm] (compresses to C.B.DIMI) - dynamic dim -> B.DIM %[reg], 0 lb2 always stays the immediate form (only TPREFETCH's dynamic-GM fallback keeps a runtime register). Also: - make TMATMUL N/K immediate-form (M stays a register: group_M is runtime for cooperative forms) - fix THISTOGRAM: missing space/PadValue in the B.DATR paste made the macro un-compilable; template now four-branch parameterized - fix TLOAD2/TLOAD4/TSTORE2 lb2 immediate-slot form - remove fa-56 legacy dead code: TMAX_T, TSUB_EXP_EXPAND_T, TMUL_ADD_ROWSUM_T, TADD_MUL_EXPAND_T, TMOV_DN2NZ_DYN and the DEFINE_TMOV_LAYOUT variants (no callers; VPAR raw-opcode spelling does not assemble) - fix pre-existing BLayout::ND2M16/32 -> LayoutCvtEnum in TIMG2COL
- ValidShapePerDim.cpp: TADD/TMUL/TRECIP/TEXP across SS/SD/DS/DD - ValidShapePerDimSweep.cpp: compile-time sweep of ~65 interface instantiations x four combinations (elementwise, unary, row/col reduce, scalar variants, TCMP/THISTOGRAM/TLOAD_CUBE/TSTORE_CUBE); disassembly form matrix is symmetric (96 static + 96 dynamic per lb0/lb1, lb2 all immediate) with zero illegal forms - compile.all: register both fixtures - test_v058_engine_contract.py: assert no "ri" masquerade, lb2 immediate-form invariant (TPREFETCH dynamic-GM fallback exempted), TMATMUL M/N/K forms; update TCVT anchors for the removed DEFINE_TMOV_LAYOUT macro
|
Sweep coverage extended — the first sweep only covered 48 of the 97 four-branch interfaces; a re-audit flagged the remaining 49. Added in
Now 101 four-combination instantiations, zero compile errors. Disassembly form matrix across the whole fixture:
Symmetric static/dynamic pairs on lb0/lb1, lb2 always immediate, zero illegal forms. Note on Shared TSTORE: the sweep uses Not sweepable due to pre-existing blockers (identical on baseline): TLOAD2/TLOAD4 ( |
Summary
Split every lb0/lb1 B.DIM site in
template_asm.hppinto fourif constexprbranches on ValidCol/ValidRow:B.DIM zero, %c[imm](assembler compresses toC.B.DIMI)B.DIM %[reg], 0physicalCol = rowStrideis a runtime value there)Rebased on top of linx (#79–#81). Includes:
Main changes
PTO_MATMUL_HEADER: N/K now immediate-form (resolver is constexpr; the code's own comment admitted "compile-time exact even though passed through GPR"); M stays a register since cooperative group_M is genuinely runtimeTHISTOGRAMfix: the macro'sB.DATR %D2,paste produced unmatchable asm (missing space + PadValue); never compiled because no fixture covered it. Template now four-branch parameterizedTLOAD2/TLOAD4/TSTORE2lb2 immediate-slot form fixedTMAX_T,TSUB_EXP_EXPAND_T,TMUL_ADD_ROWSUM_T,TADD_MUL_EXPAND_T,TMOV_DN2NZ_DYN,DEFINE_TMOV_LAYOUTvariants (zero callers; the VPAR raw-opcode spelling does not assemble — superseded by region helpers)BLayout::ND2M16/32→LayoutCvtEnum(also present in Docs/timg2col contract alignment #81's new code)Verification
test_v058_engine_contract: 40/40 OK (assertions strengthened: no"ri"masquerade, lb2 immediate invariant, TMATMUL M/N/K forms)ValidShapePerDimSweep.cpp: compile-time sweep of ~65 interface instantiations × four combinations (elementwise, unary, row/col reduce, scalar variants, TCMP/THISTOGRAM/TLOAD_CUBE/TSTORE_CUBE); disassembly form matrix is symmetric (96 static + 96 dynamic per lb0/lb1, lb2 all immediate), zero illegal formsGlobaltemplate missing in ValidShapeImmediate, TImg2Col/TMatmulAllOptions pre-existing match errors)git diff --checkclean