2 * SME outer product, 1 x 1.
3 * SPDX-License-Identifier: GPL-2.0-or-later
8 static void foo(float *dst
)
10 asm(".arch_extension sme\n\t"
15 * An outer product of a vector of 1.0 by itself should be a matrix of 1.0.
16 * Note that we are using tile 1 here (za1.s) rather than tile 0.
19 "fmopa za1.s, p0/m, p0/m, z0.s, z0.s\n\t"
21 * Read the first 4x4 sub-matrix of elements from tile 1:
22 * Note that za1h should be interchangeable here.
25 "mova z0.s, p0/m, za1v.s[w12, #0]\n\t"
26 "mova z1.s, p0/m, za1v.s[w12, #1]\n\t"
27 "mova z2.s, p0/m, za1v.s[w12, #2]\n\t"
28 "mova z3.s, p0/m, za1v.s[w12, #3]\n\t"
30 * And store them to the input pointer (dst in the C code):
32 "st1w {z0.s}, p0, [%0]\n\t"
34 "st1w {z1.s}, p0, [x0]\n\t"
36 "st1w {z2.s}, p0, [x0]\n\t"
38 "st1w {z3.s}, p0, [x0]\n\t"
41 : "x12", "d0", "d1", "d2", "d3", "memory");
50 for (int i
= 0; i
< 16; i
++) {
59 for (int i
= 0; i
< 16; i
++) {
60 printf("%f%c", dst
[i
], i
% 4 == 3 ? '\n' : ' ');