[v2,4/5] gdb: add a "matrix" register group

Message ID 20261030115016.45786-5-stephan.rohr@intel.com
State New
Headers
Series Add Intel AMX support |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Rohr, Stephan Oct. 30, 2026, 11:50 a.m. UTC
  From: "Rohr, Stephan" <stephan.rohr@intel.com>

Add "matrix" as a new standard register group, next to the "vector"
register group.  Architectures can use it for registers that hold
matrices, which can then be listed with "info registers matrix".

By default, no register is part of the group.

This is in preparation to add Intel AMX registers as user registers.
---
 gdb/NEWS            | 3 +++
 gdb/doc/gdb.texinfo | 6 ++++--
 gdb/reggroups.c     | 3 +++
 gdb/reggroups.h     | 1 +
 4 files changed, 11 insertions(+), 2 deletions(-)
  

Comments

Eli Zaretskii Oct. 30, 2026, 12:49 p.m. UTC | #1
> From: Stephan Rohr <stephan.rohr@intel.com>
> Cc: pedro@palves.net,
> 	eliz@gnu.org,
> 	jhb@FreeBSD.org,
> 	luis.machado@arm.com
> Date: Fri, 30 Oct 2026 11:50:15 +0000
> 
> From: "Rohr, Stephan" <stephan.rohr@intel.com>
> 
> Add "matrix" as a new standard register group, next to the "vector"
> register group.  Architectures can use it for registers that hold
> matrices, which can then be listed with "info registers matrix".
> 
> By default, no register is part of the group.
> 
> This is in preparation to add Intel AMX registers as user registers.
> ---
>  gdb/NEWS            | 3 +++
>  gdb/doc/gdb.texinfo | 6 ++++--
>  gdb/reggroups.c     | 3 +++
>  gdb/reggroups.h     | 1 +
>  4 files changed, 11 insertions(+), 2 deletions(-)

The documentation parts are okay, thanks.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
  

Patch

diff --git a/gdb/NEWS b/gdb/NEWS
index 4869f3595be..47ecba246a0 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -49,6 +49,9 @@ 
   source is modified.  Source tracking can be enabled with 'set
   breakpoint source-tracking enabled on'.
 
+* A new standard register group "matrix" has been added.  Its registers can
+  be printed with "info registers matrix".
+
 * New targets
 
 i386 Windows/MSVC               i[34567]86-*-windows-msvc
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 72b87401c5c..ba9d3df1ac5 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -42788,6 +42788,7 @@  The register groups info looks like this:
  float      user
  all        user
  vector     user
+ matrix     user
  system     user
  save       internal
  restore    internal
@@ -49868,8 +49869,9 @@  architecture's normal floating point format) of the correct size for
 
 @item group
 The register group to which this register belongs.  It can be one of the
-standard register groups @code{general}, @code{float}, @code{vector} or an
-arbitrary string.  Group names should be limited to alphanumeric characters.
+standard register groups @code{general}, @code{float}, @code{vector},
+@code{matrix} or an arbitrary string.  Group names should be limited to
+alphanumeric characters.
 If a group name is made up of multiple words the words may be separated by
 hyphens; e.g.@: @code{special-group} or @code{ultra-special-group}.  If no
 @var{group} is specified, @value{GDBN} will not display the register in
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index b0d3fd82185..a0f86baa5ac 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -58,6 +58,7 @@  struct reggroups
     add (float_reggroup);
     add (system_reggroup);
     add (vector_reggroup);
+    add (matrix_reggroup);
     add (all_reggroup);
     add (save_reggroup);
     add (restore_reggroup);
@@ -240,6 +241,7 @@  static const reggroup general_group = { "general", USER_REGGROUP };
 static const reggroup float_group = { "float", USER_REGGROUP };
 static const reggroup system_group = { "system", USER_REGGROUP };
 static const reggroup vector_group = { "vector", USER_REGGROUP };
+static const reggroup matrix_group = { "matrix", USER_REGGROUP };
 static const reggroup all_group = { "all", USER_REGGROUP };
 static const reggroup save_group = { "save", INTERNAL_REGGROUP };
 static const reggroup restore_group = { "restore", INTERNAL_REGGROUP };
@@ -248,6 +250,7 @@  const reggroup *const general_reggroup = &general_group;
 const reggroup *const float_reggroup = &float_group;
 const reggroup *const system_reggroup = &system_group;
 const reggroup *const vector_reggroup = &vector_group;
+const reggroup *const matrix_reggroup = &matrix_group;
 const reggroup *const all_reggroup = &all_group;
 const reggroup *const save_reggroup = &save_group;
 const reggroup *const restore_reggroup = &restore_group;
diff --git a/gdb/reggroups.h b/gdb/reggroups.h
index 47824d5427e..a827c775992 100644
--- a/gdb/reggroups.h
+++ b/gdb/reggroups.h
@@ -68,6 +68,7 @@  extern const reggroup *const general_reggroup;
 extern const reggroup *const float_reggroup;
 extern const reggroup *const system_reggroup;
 extern const reggroup *const vector_reggroup;
+extern const reggroup *const matrix_reggroup;
 extern const reggroup *const all_reggroup;
 
 /* Pre-defined, internal, register groups.  */