blob: f443ceaa1325abb382d542c010b80c45d3f2a627 [file] [log] [blame]
johpow0150ccb552020-11-10 19:22:13 -06001/*
Olivier Deprez19202382022-08-17 14:18:51 +02002 * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
johpow0150ccb552020-11-10 19:22:13 -06003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Olivier Deprez19202382022-08-17 14:18:51 +02007#ifndef SME_H
8#define SME_H
johpow0150ccb552020-11-10 19:22:13 -06009
Jayanth Dodderi Chidanandb3ffd3c2023-02-13 12:15:11 +000010#define MAX_VL (512)
11#define MAX_VL_B (MAX_VL / 8)
12#define SME_SMCR_LEN_MAX U(0x1FF)
johpow0150ccb552020-11-10 19:22:13 -060013
Jayanth Dodderi Chidanandb3ffd3c2023-02-13 12:15:11 +000014typedef 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;
johpow0150ccb552020-11-10 19:22:13 -060019
Jayanth Dodderi Chidanandb3ffd3c2023-02-13 12:15:11 +000020typedef 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. */
27void sme_enable(void);
28void sme_smstart(smestart_instruction_type_t smstart_type);
29void sme_smstop(smestop_instruction_type_t smstop_type);
30
31/* Assembly function prototypes. */
johpow0150ccb552020-11-10 19:22:13 -060032uint64_t sme_rdvl_1(void);
33void sme_try_illegal_instruction(void);
Jayanth Dodderi Chidanandb3ffd3c2023-02-13 12:15:11 +000034void sme_vector_to_ZA(const uint64_t *input_vector);
35void sme_ZA_to_vector(const uint64_t *output_vector);
johpow0150ccb552020-11-10 19:22:13 -060036
Olivier Deprez19202382022-08-17 14:18:51 +020037#endif /* SME_H */