mma.S 761 B

123456789101112131415161718192021222324252627282930313233343536
  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
  8. test_mma:
  9. /* Load accumulator via VSX registers from image passed in r3 */
  10. lxvh8x 4,0,3
  11. lxvh8x 5,0,4
  12. /* Clear and prime the accumulator (xxsetaccz) */
  13. .long 0x7c030162
  14. /* Prime the accumulator with MMA VSX move to accumulator
  15. * X-form (xxmtacc) (not needed due to above zeroing) */
  16. //.long 0x7c010162
  17. /* xvi16ger2s */
  18. .long 0xec042958
  19. /* Deprime the accumulator - xxmfacc 0 */
  20. .long 0x7c000162
  21. /* Store result in image passed in r5 */
  22. stxvw4x 0,0,5
  23. addi 5,5,16
  24. stxvw4x 1,0,5
  25. addi 5,5,16
  26. stxvw4x 2,0,5
  27. addi 5,5,16
  28. stxvw4x 3,0,5
  29. addi 5,5,16
  30. blr