binutils-gdb/gdb/features/aarch64-sme2.c
Luis Machado 42019af621 sme2: Enable SME2 for AArch64 gdb on Linux
SME2 defines a new 512-bit register named ZT0, and it is only available
if SME is also supported.  The ZT0 state is valid only if the SVCR ZA bit
is enabled.  Otherwise its contents are empty (0).

The target description is dynamic and gets generated at runtime based on the
availability of the feature.

Validated under Fast Models.

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
2023-10-04 16:23:40 +01:00

44 lines
1.5 KiB
C

/* Copyright (C) 2023 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "gdbsupport/tdesc.h"
/* This function is NOT auto generated from xml. Create the AArch64 SME2
feature into RESULT.
The ZT0 register is only available when the SME ZA register is
available. */
static int
create_feature_aarch64_sme2 (struct target_desc *result, long regnum)
{
struct tdesc_feature *feature;
tdesc_type *element_type;
feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.sme2");
/* Byte type. */
element_type = tdesc_named_type (feature, "uint8");
/* Vector of 64 bytes. */
element_type = tdesc_create_vector (feature, "sme2_bv", element_type, 64);
/* The following is the ZT0 register, with 512 bits (64 bytes). */
tdesc_create_reg (feature, "zt0", regnum++, 1, nullptr, 512, "sme2_bv");
return regnum;
}