Skip to content

[PTO v0.58] TGATHER/TSCATTER bind index Tile through B.IOR instead of two-source B.IOT #78

Description

@jiale-wangOwO

Defect

Current linx include/jcore/template_asm.hpp lowers TGATHER and TSCATTER with one source in B.IOT, then passes the index Tile through B.IOR:

B.IOT ValueSrc, mask=1111, last, ->Dst<TSize>
B.IOR [IndexSrc], []

The index constraint is Tr, so this produces a scalar-T operand where the current model correctly attempts a scalar temporary-register read and then aborts when no scalar T value exists.

ASL contract

The current authoritative ASL requires one terminating two-source Local B.IOT for both operations:

B.IOT ValueSrc, IndexSrc, mask=PE_MASK, last, ->Dst<TSize>

B.IOR is explicitly illegal for both schemas. The index selects a row at the current column; it is not a scalar block argument.

References:

  • pto-spec@dea0b75e: asl/tile/irregular-and-complex/layout/TGATHER.asl
  • pto-spec@dea0b75e: asl/tile/irregular-and-complex/layout/TSCATTER.asl
  • current lowerer: include/jcore/template_asm.hpp (TGATHER and TSCATTER bodies)

Required API change

For both compile-time and dynamic valid-shape branches:

  1. Emit B.IOT src, index, mask=..., last, ->dst.
  2. Remove B.IOR [index], [].
  3. Keep dimensions from index/destination geometry as required by the active ASL.
  4. Add assembly/lowering regressions for a two-source B.IOT and no B.IOR.

Reproducer caveat

The SuperNPUBench guard demo used in LinxISA/SuperScalarModel#569 also calls gfill_idx(idx, MN), which produces values up to MN-1. For an M x N Tile, ASL requires row indexes in [0, M). Its data generator must be corrected separately before treating a run as a semantic golden.

Related triage: LinxISA/SuperScalarModel#569 (gfrun-10).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions