xref: /llvm-project/mlir/docs/Dialects/ArmSME.md (revision 9f430de4b2577fb0a0169b6409a6267db927c08d)
1# 'ArmSME' Dialect
2
3Basic dialect to target Arm SME.
4
5This dialect defines custom and LLVM IR intrinsic operations that are used to
6target Arm Scalable Matrix Extension. Through the available conversion and
7ArmSME passes you can, for example, lower a
8[linalg.matmul](https://mlir.llvm.org/docs/Dialects/Linalg/#linalgmatmul-linalgmatmulop)
9operation to Arm SME
10[FMOPA](https://developer.arm.com/documentation/ddi0602/2023-03/SME-Instructions/FMOPA--widening---Half-precision-floating-point-sum-of-outer-products-and-accumulate-)
11(floating-point outer product) operations. See one of the in-tree end-to-end
12integration tests for reference:
13
14* [Linalg/CPU/ArmSME/matmul.mlir](https://github.com/llvm/llvm-project/blob/main/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir)
15* [Vector/CPU/ArmSME/outerproduct-f64.mlir](https://github.com/llvm/llvm-project/blob/main/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/outerproduct-f64.mlir)
16
17In order to run ArmSME integration tests, include these flags in the CMake
18invocation when configuring LLVM and MLIR:
19```bash
20  -DMLIR_INCLUDE_INTEGRATION_TESTS=On
21  -DMLIR_RUN_ARM_SME_TESTS=On
22  -DARM_EMULATOR_EXECUTABLE=<path-to-emulator>
23```
24
25These tests are run "post-commit" by the
26[clang-aarch64-sve-vla](https://lab.llvm.org/buildbot/#/builders/197) LLVM
27BuildBot worker.
28
29**References:**
30
31* [The Scalable Matrix Extension (SME), for Armv9-A](https://developer.arm.com/documentation/ddi0616)
32* [A64 -- SME Instructions (alphabetic order)](https://developer.arm.com/documentation/ddi0602/2023-03/SME-Instructions)
33
34[TOC]
35
36## Operations
37
38[include "Dialects/ArmSMEOps.md"]
39
40## Operations for LLVM IR Intrinsics
41
42[include "Dialects/ArmSMEIntrinsicOps.md"]
43