1 // SPDX-License-Identifier: GPL-2.0-only 2 // Copyright (C) 2021-2 ARM Limited. 3 // Original author: Mark Brown <broonie@kernel.org> 4 5 #ifndef SME_INST_H 6 #define SME_INST_H 7 8 #define REG_FPMR S3_3_C4_C4_2 9 10 /* 11 * RDSVL X\nx, #\imm 12 */ 13 .macro rdsvl nx, imm 14 .inst 0x4bf5800 \ 15 | (\imm << 5) \ 16 | (\nx) 17 .endm 18 19 .macro smstop 20 msr S0_3_C4_C6_3, xzr 21 .endm 22 23 .macro smstart_za 24 msr S0_3_C4_C5_3, xzr 25 .endm 26 27 .macro smstart_sm 28 msr S0_3_C4_C3_3, xzr 29 .endm 30 31 /* 32 * LDR (vector to ZA array): 33 * LDR ZA[\nw, #\offset], [X\nxbase, #\offset, MUL VL] 34 */ 35 .macro _ldr_za nw, nxbase, offset=0 36 .inst 0xe1000000 \ 37 | (((\nw) & 3) << 13) \ 38 | ((\nxbase) << 5) \ 39 | ((\offset) & 7) 40 .endm 41 42 /* 43 * STR (vector from ZA array): 44 * STR ZA[\nw, #\offset], [X\nxbase, #\offset, MUL VL] 45 */ 46 .macro _str_za nw, nxbase, offset=0 47 .inst 0xe1200000 \ 48 | (((\nw) & 3) << 13) \ 49 | ((\nxbase) << 5) \ 50 | ((\offset) & 7) 51 .endm 52 53 /* 54 * LDR (ZT0) 55 * 56 * LDR ZT0, nx 57 */ 58 .macro _ldr_zt nx 59 .inst 0xe11f8000 \ 60 | (((\nx) & 0x1f) << 5) 61 .endm 62 63 /* 64 * STR (ZT0) 65 * 66 * STR ZT0, nx 67 */ 68 .macro _str_zt nx 69 .inst 0xe13f8000 \ 70 | (((\nx) & 0x1f) << 5) 71 .endm 72 73 #endif 74