johpow01 | 50ccb55 | 2020-11-10 19:22:13 -0600 | [diff] [blame] | 1 | /* |
Olivier Deprez | 1920238 | 2022-08-17 14:18:51 +0200 | [diff] [blame] | 2 | * Copyright (c) 2021-2022, Arm Limited. All rights reserved. |
johpow01 | 50ccb55 | 2020-11-10 19:22:13 -0600 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Olivier Deprez | 1920238 | 2022-08-17 14:18:51 +0200 | [diff] [blame] | 7 | #ifndef SME_H |
| 8 | #define SME_H |
johpow01 | 50ccb55 | 2020-11-10 19:22:13 -0600 | [diff] [blame] | 9 | |
Jayanth Dodderi Chidanand | b3ffd3c | 2023-02-13 12:15:11 +0000 | [diff] [blame^] | 10 | #define MAX_VL (512) |
| 11 | #define MAX_VL_B (MAX_VL / 8) |
| 12 | #define SME_SMCR_LEN_MAX U(0x1FF) |
johpow01 | 50ccb55 | 2020-11-10 19:22:13 -0600 | [diff] [blame] | 13 | |
Jayanth Dodderi Chidanand | b3ffd3c | 2023-02-13 12:15:11 +0000 | [diff] [blame^] | 14 | typedef enum { |
| 15 | SMSTART, /* enters streaming sve mode and enables SME ZA array */ |
| 16 | SMSTART_SM, /* enters streaming sve mode only */ |
| 17 | SMSTART_ZA, /* enables SME ZA array storage only */ |
| 18 | } smestart_instruction_type_t; |
johpow01 | 50ccb55 | 2020-11-10 19:22:13 -0600 | [diff] [blame] | 19 | |
Jayanth Dodderi Chidanand | b3ffd3c | 2023-02-13 12:15:11 +0000 | [diff] [blame^] | 20 | typedef enum { |
| 21 | SMSTOP, /* exits streaming sve mode, & disables SME ZA array */ |
| 22 | SMSTOP_SM, /* exits streaming sve mode only */ |
| 23 | SMSTOP_ZA, /* disables SME ZA array storage only */ |
| 24 | } smestop_instruction_type_t; |
| 25 | |
| 26 | /* SME feature related prototypes. */ |
| 27 | void sme_enable(void); |
| 28 | void sme_smstart(smestart_instruction_type_t smstart_type); |
| 29 | void sme_smstop(smestop_instruction_type_t smstop_type); |
| 30 | |
| 31 | /* Assembly function prototypes. */ |
johpow01 | 50ccb55 | 2020-11-10 19:22:13 -0600 | [diff] [blame] | 32 | uint64_t sme_rdvl_1(void); |
| 33 | void sme_try_illegal_instruction(void); |
Jayanth Dodderi Chidanand | b3ffd3c | 2023-02-13 12:15:11 +0000 | [diff] [blame^] | 34 | void sme_vector_to_ZA(const uint64_t *input_vector); |
| 35 | void sme_ZA_to_vector(const uint64_t *output_vector); |
johpow01 | 50ccb55 | 2020-11-10 19:22:13 -0600 | [diff] [blame] | 36 | |
Olivier Deprez | 1920238 | 2022-08-17 14:18:51 +0200 | [diff] [blame] | 37 | #endif /* SME_H */ |