Skip to content

Implement Matrix Get Element Builtin #7900

Closed

Description

Create __builtin_LinAlg_MatrixGetElement(MatrixRef, int index) and lower it to dx.op.matrixGetElement as specified in https://github.com/microsoft/hlsl-specs/blob/main/proposals/0035-linalg-matrix.md

Changes required:

  • If necessary, update the intrinsic definition in utils/hct/gen_intrin_main.txt
  • In lib/HLSL/HLOperationLower.cpp
    • Create a new lowering function TranslateLinAlgMatrixGetElement
    • Update the mapping table for IOP___builtin_LinAlg_MatrixGetElement from EmptyLower to TranslateLinAlgMatrixGetElement
  • Write frontend tests in tools/clang/test/SemaHLSL/hlsl/linalg/builtins/matrixgetelement
  • Update frontend tests in tools/clang/test/SemaHLSL/hlsl/linalg/builtins
  • If necessary, update the opcode definition in utils/hct/hctdb.py (be sure to check allowed stages)
  • Update codegen tests in tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins
  • For complex ops, write codegen tests in tools/clang/test/CodeGenDXIL/hlsl/linalg/builtins/matrixgetelement

Note: The spec is not final therefore this issue may fall out of date. The spec is the source of truth and should be referenced during implementation.

Metadata

Metadata

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