1/* SPDX-License-Identifier: GPL-2.0-or-later
2 *
3 * Test basic matrix multiply assist (MMA) functionality if available.
4 *
5 * Copyright 2020, Alistair Popple, IBM Corp.
6 */
7	.global test_mma
8test_mma:
9	/* Load accumulator via VSX registers from image passed in r3 */
10	lxvh8x	4,0,3
11	lxvh8x	5,0,4
12
13	/* Clear and prime the accumulator (xxsetaccz) */
14	.long	0x7c030162
15
16	/* Prime the accumulator with MMA VSX move to accumulator
17	* X-form (xxmtacc) (not needed due to above zeroing) */
18	//.long 0x7c010162
19
20	/* xvi16ger2s */
21	.long	0xec042958
22
23	/* Deprime the accumulator - xxmfacc 0 */
24	.long 0x7c000162
25
26	/* Store result in image passed in r5 */
27	stxvw4x	0,0,5
28	addi	5,5,16
29	stxvw4x	1,0,5
30	addi	5,5,16
31	stxvw4x	2,0,5
32	addi	5,5,16
33	stxvw4x	3,0,5
34	addi	5,5,16
35
36	blr
37