riscv / riscv-v-spec

Working draft of the proposed RISC-V V vector extension
https://jira.riscv.org/browse/RVG-122
Creative Commons Attribution 4.0 International
961 stars 272 forks source link

is it possible to add outer product calc as an arithmetic instruction #641

Open julian-xinchi opened 3 years ago

julian-xinchi commented 3 years ago

https://en.wikipedia.org/wiki/Outer_product

David-Horner commented 3 years ago

Highly unlikely for v1.0.

The original vision for RISCV vector did propose matrix multiplication, including outer product. However, the Vector TG decided that vision was too visionary. The result is a comprehensive but limited set of augmented 32bit instructions. Direct matrix operations will be a later release, planned to use 64bit instruction encoding.

V1.0 does provide features that support efficient matrix multiplication operation code sequences. Notably these include:

julian-xinchi commented 3 years ago

Highly unlikely for v1.0.

The original vision for RISCV vector did propose matrix multiplication, including outer product. However, the Vector TG decided that vision was too visionary. The result is a comprehensive but limited set of augmented 32bit instructions. Direct matrix operations will be a later release, planned to use 64bit instruction encoding.

V1.0 does provide features that support efficient matrix multiplication operation code sequences. Notably these include:

  • stride load/store to efficiently load the columns of arrays.
  • shift and move under mask to duplicate the row data by the number of columns. -- whole register move [copy] between physical vectors registers for use when LMUL>1
  • For full matrix [not just outer product] there are [3 argument] fused multiply add variants.

Sweet! Thanks for your reply. Maybe i more expect the version after v1.0 :-)