Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later
0002  *
0003  * Test basic matrix multiply assist (MMA) functionality if available.
0004  *
0005  * Copyright 2020, Alistair Popple, IBM Corp.
0006  */
0007     .global test_mma
0008 test_mma:
0009     /* Load accumulator via VSX registers from image passed in r3 */
0010     lxvh8x  4,0,3
0011     lxvh8x  5,0,4
0012 
0013     /* Clear and prime the accumulator (xxsetaccz) */
0014     .long   0x7c030162
0015 
0016     /* Prime the accumulator with MMA VSX move to accumulator
0017     * X-form (xxmtacc) (not needed due to above zeroing) */
0018     //.long 0x7c010162
0019 
0020     /* xvi16ger2s */
0021     .long   0xec042958
0022 
0023     /* Deprime the accumulator - xxmfacc 0 */
0024     .long 0x7c000162
0025 
0026     /* Store result in image passed in r5 */
0027     stxvw4x 0,0,5
0028     addi    5,5,16
0029     stxvw4x 1,0,5
0030     addi    5,5,16
0031     stxvw4x 2,0,5
0032     addi    5,5,16
0033     stxvw4x 3,0,5
0034     addi    5,5,16
0035 
0036     blr