Skip to content

Shared-memory declarations for reduced-width element types #67

Description

@tetsuo-cpp

Summary

Allow \! shared buffers declared as i8/i16/i32/f16/bf16/f32 (not only i64/f64), matching the existing S-prefixed narrow load/store words.

Motivation

Access words already exist (SI8@, SHF!, SF32@, etc.), but shared declarations are effectively i64/f64-oriented. Tiled kernels often want f32 or f16 tiles in shared memory with correct sizing (bytes vs cells) and allocation footprint.

Proposed syntax

\! shared TILE f32[256]
\! shared MASK i8[128]

Lowering:

  • Workgroup attribution sized by sizeof(elem) * N
  • Base address usable with the matching S* access words (or element-scaled indexing from the typed-params issue)

Acceptance criteria

  • Parser accepts reduced-width shared declarations
  • ForthToGPU / workgroup memory size is correct in bytes
  • LIT tests for each major width class (int + float)
  • GPU test storing/loading f32 shared tile
  • Docs updated

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions