From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2045.outbound.protection.outlook.com [40.107.104.45]) by sourceware.org (Postfix) with ESMTPS id 7D08C3858D33 for ; Thu, 13 Apr 2023 12:17:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D08C3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=inW5BWtrrHxVFbKJpNBX3WepQvAjjyHudsCrR2GYas4=; b=zREnoWqcfd2Iim2fvTemvywdSUszp+6kg67ChM1nWwmDS71/XVicFSH1OJRpNuizi4ttxYM9bxawZu7KrBqBHY4klOTu52lzVdryeCyGwl6ud1TPEjGGC75BQvXFhqOlJPxoMzVoWZ4eTwCt4XA8gf9K8IvLzj0ZXXw6R1i7Q9A= Received: from DB3PR06CA0031.eurprd06.prod.outlook.com (2603:10a6:8:1::44) by AS2PR08MB10375.eurprd08.prod.outlook.com (2603:10a6:20b:544::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 12:17:31 +0000 Received: from DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:1:cafe::11) by DB3PR06CA0031.outlook.office365.com (2603:10a6:8:1::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 12:17:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT025.mail.protection.outlook.com (100.127.142.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 12:17:30 +0000 Received: ("Tessian outbound 99a3040377ca:v136"); Thu, 13 Apr 2023 12:17:30 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2ee124f661b90a76 X-CR-MTA-TID: 64aa7808 Received: from 941258fec194.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AC7F954B-F783-4327-B5D1-69915D58F375.1; Thu, 13 Apr 2023 12:17:24 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 941258fec194.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 12:17:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i1Zfk03BeRZGVtKn7Qgno1Y6Pc9ZOTq2xMPdH5wYfZhf0jaLU34rr86Ze7gLxeHDGqdUT3jo/17Cl336hcJzQycFieE7b/t9ZSvMOdA4Ea9OfSl2xHgvOCAJ8UYV03l6argoC/2w4RCU2EBrM8Mh+qQkTdNTpWrzLRxNBPVky8MYJNNMKjNezgzKw5FLDob8IFa9WjSwiUoe8McZ+lNTJDW14vUvNVdCjUEXbosT542BkEke7cfvQ1kPDesERs5mgAK28z934DQdNpDV4DLCh0c6ByAYceYSeiD2ihZT2V13Xy5c6D8xvDC6mIkhFoEzcWOHqforkSDLWS7Ku95LBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=inW5BWtrrHxVFbKJpNBX3WepQvAjjyHudsCrR2GYas4=; b=VLxveZ3lgfsgvdv6wTBDSwX5FANR19/hcNWsqZ2XOyJcZ+g4Q83e6ADvttfeVJkoNip9lYy7GYkgMIZLitxpm5gC2OuCCBUkbrh3B6rPoGpWOMRA5d13VN00Mb4E29/mK6q4uMGs9V97RM0h0K4Fm5qpitbzEC5BEVYNZpMp7O7n5ca3o3nW6iq2o8SkVKSsmNw67pVaxQdbOV2lA61pWiMNZWMKTqHTcAkThGPE/0fb9COLaW5zSKbksVnMbWKGSg+mSGrsB9obL52nJsuLx0earj3yyuIJmdYY6WYqUPNBqtfDMWddiuCQ+3RERJMtUS0DNq9wO/X7WJ/rZKAhQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=inW5BWtrrHxVFbKJpNBX3WepQvAjjyHudsCrR2GYas4=; b=zREnoWqcfd2Iim2fvTemvywdSUszp+6kg67ChM1nWwmDS71/XVicFSH1OJRpNuizi4ttxYM9bxawZu7KrBqBHY4klOTu52lzVdryeCyGwl6ud1TPEjGGC75BQvXFhqOlJPxoMzVoWZ4eTwCt4XA8gf9K8IvLzj0ZXXw6R1i7Q9A= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AS8PR08MB6262.eurprd08.prod.outlook.com (2603:10a6:20b:23e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 12:17:20 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::ff70:5431:70fa:34bf]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::ff70:5431:70fa:34bf%5]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 12:17:20 +0000 Message-ID: Date: Thu, 13 Apr 2023 13:17:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH,v2 17/17] [gdb/docs] sme: Document SME registers and features To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20230411042658.1852730-18-luis.machado@arm.com> <20230412120444.2593312-1-luis.machado@arm.com> <835ya05i4r.fsf@gnu.org> Content-Language: en-US From: Luis Machado In-Reply-To: <835ya05i4r.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P123CA0030.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:313::10) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS8PR08MB6262:EE_|DBAEUR03FT025:EE_|AS2PR08MB10375:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c9f797c-de7b-4df8-0118-08db3c190e01 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: K1lBlvxHJBNOmmXDhRAmmV2rVteIUfhjPpLncWO9grPMtDeuWsP1sFvg5WTfjVYHnXF9VxgtonMaWYSrssKHOUi/UaUoCz1qPRhJ2aPIZpdfeihx2nApZVdro45c8vCheCk2FYiuU7GhnHJkRonVEbY7M7OV/2IvK3aF/hjmjYbaj9ln+V/uMFQRcytTymitF6jElrBGHn3SlgahlF7NsGELBnFUuiLBLvlJSBigcuykCIo9P2R8nsQNz0P0lAzhcWbIm/r1K71l/syJax31W7B1jYWgJ9FO0Ly6s2AvrpRQcJG1dbEoxhcCWfeMNb7r9AdemjCMQJTHCGMBqU7lo9WM1Tmo/KM98ct4azhlOkQa/JDGOyOuuV0lYF0zGUFbkjLEACYjDmWYfy0tJhhd0fMgkf6V69/hHXfT+8Nh7kVKzSDaaza9+SB808LhwSlUB5s933jmRjz59fC1Igt85h09gOLAwcPclfiC+oKFS8REUUFBatlkt1jtrk56KyQ4ytQ06JxiHgMC9tE21ofeBuzduLJz+lDdcpBqWivDrY/1bqbGoq7lgqA0QkA7a8jlRik+1iz7fpQs6mQgW73T7RjLCAoi2Af6yfhYCRM6UVFtDcaAffFmiz1CdW6NEwL9PZjc8q+/GEPaoR06xVlZy3aCdyNFKD8ARQzPvp+XK3xBWwAzopD12wHJWiNwgv3D X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(346002)(39860400002)(136003)(366004)(451199021)(66899021)(36756003)(478600001)(6486002)(6666004)(41300700001)(8676002)(8936002)(38100700002)(66556008)(66946007)(66476007)(316002)(6916009)(4326008)(2616005)(83380400001)(31686004)(6506007)(6512007)(53546011)(26005)(186003)(31696002)(86362001)(44832011)(30864003)(2906002)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6262 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7158cacc-9c82-4121-8753-08db3c1906db X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: thLJ3T9b1iqqYUaLacHybRPsvcBnawsvimSJ+jPGuICZem0Eox0455/hmQMg+yhrP+4Qk0kLTTtMOL5Vs9KSqnWwv2y0OvuN7UZe4jtou5cBCglkEeFlMlpVPcTbQe13ntv8Kd9ducIC9KWDkJlOS2f2ozldGtpi6Onj4lkfWRcJkwkfce+zlh1IdnBY2TInJXLKiz3Iwppv/RbAcpU1qw1ua77lMng6/UESwLGlElV83BDj6DOp1s9iX3HNpNkDqMRjxoFBUY9To52tGPbsohVMMn6WOTLCu5pDlnu2/xNIeX2sWGh0gkoWWMxrBXkfcVtKuB9vB32k8n0agAW6a3hLiqZsojbdlhuCe4DhGLZpOIvK2Ble4kaFudEqm+c6ANKE6SWnZR6oJ05snHyRsud2uuJTCTslQvpGQR0xYdoXCf0cH4b8NRpYVLgu8p7Ste7l5GE+mk6TsydHo8m/Cxz9zhO8ys3dCAczDsvGXBeuIzJg3NekWyP40KJjFvXyu+eSfinU+qWybwIrJM+vFSgxQMEFd5MDEKlAi+PilPxBMe6uzPZCceZIVElvwGwavWM67BtlPSDl9PZl9mo2TG0TJOK0O93jZwChsMDdVcmNNHpMrIHIpG4kREvYhLlxJhdFN5UzcAPCqK4CjDw3eO9yu/sBYWD/StgQ12J61ba5mmzlqk9vPGIi55vzpbygwDK9R9F4AuVZ631QjDfHwOrD2u7FtJ46mZAI3q0EZGfUns8UEpPDHE3NOOHJQreUTT82mxl54aXOSK8GPsSbVg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(6486002)(40460700003)(70206006)(70586007)(4326008)(36756003)(30864003)(2906002)(44832011)(31696002)(86362001)(81166007)(82740400003)(356005)(41300700001)(5660300002)(82310400005)(8676002)(8936002)(6862004)(316002)(478600001)(40480700001)(53546011)(6512007)(6506007)(26005)(31686004)(336012)(36860700001)(2616005)(186003)(47076005)(66899021)(83380400001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 12:17:30.9852 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c9f797c-de7b-4df8-0118-08db3c190e01 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10375 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Eli, Thanks for the feedback on the documentation. I have some comments about your suggestion, but I think we're converging. On 4/13/23 08:57, Eli Zaretskii wrote: >> From: Luis Machado >> Date: Wed, 12 Apr 2023 13:04:44 +0100 >> >> Updates since v1: >> >> - Made SME text more thorough. >> - Adjusted text based on upstream reviews. >> - Fixed documentation errors (missing itemization for SME registers). >> >> Provide documentation for the SME feature and other information that >> should be useful for users that need to debug a SME-capable target. >> --- >> gdb/NEWS | 11 +++ >> gdb/doc/gdb.texinfo | 223 ++++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 234 insertions(+) > > Thanks. > >> diff --git a/gdb/NEWS b/gdb/NEWS >> index 10a1a70fa52..48a82172f0e 100644 >> --- a/gdb/NEWS >> +++ b/gdb/NEWS >> @@ -3,6 +3,17 @@ >> >> *** Changes since GDB 13 >> >> +* GDB now supports the AArch64 Scalable Matrix Extension (SME), which includes >> + a new matrix register named ZA, a new thread register TPIDR2 and a new vector >> + length register SVG (streaming vector granule). GDB also supports tracking >> + ZA state across signal frames. >> + >> + Some features are still under development or are dependent on ABI specs that >> + are still in alpha stage. For example, manual function calls with ZA state >> + don't have any special handling, and tracking of SVG changes based on >> + DWARF information is still not implemented, but there are plans to do so in >> + the future. > > This part is OK. > >> +For SVE, the following definitions are used throughout @value{GDBN}'s source >> +code and in this document: >> + >> +@itemize >> + >> +@item >> +@anchor{VL} >> +@cindex VL >> +@code{VL}: The vector length, in bytes. It defines the size of each @code{Z} >> +register. >> + >> +@item >> +@anchor{VQ} >> +@cindex VQ >> +@code{VQ}: The number of 128 bit units in @code{VL}. This is mostly used >> +internally by @value{GDBN} and the Linux Kernel. >> + >> +@item >> +@anchor{VG} >> +@cindex VG >> +@code{VG}: The number of 64 bit units in @code{VL}. This is mostly used >> +internally by @value{GDBN} and the Linux Kernel. > > I suggest to call these parameters @var{nvl}, @var{nvq}, and > @var{nvg}, respectively. That is: (1) lower-case names, (2) name them > differently from the corresponding register, and (3) use @var markup. > This could mean the names are no longer identical to what you use in > the GDB sources, but the text is easier to read and less confusing, > because, for example, the difference between SVG the parameter and SVG > the register name is tricky, and confused even you (or at least it > confused me, see below). > I'm not sure that would be a good idea. These definitions (VL, VG and VQ, as well as the SME counterparts SVL, SVG and SVQ) are supposed to provide different views into the same data, the SVE vector length or the SME vector length. They are only supposed to help describe the concept of SVE/SME. When we're talking about how gdb implements SVE and SME, then we're talking about registers vg and svg, which map directly to the VG and SVG definitions. I may be leaking some implementation details to the user's manual. Would it help if we only mention these definitions when explaining the concept, but then restrict ourselves to only using the vg and svg registers when explaining how gdb deals with SVE and SME? But it is convenient, when detailing the sizes of registers, to use SVL, which doesn't have a direct mapping to a gdb register. >> +by providing a 2-dimensional square matrix of variable size called @code{ZA}, >> +just like SVE provides a group of vector registers of variable size, the >> +32 @code{Z} registers. > > ZA is a register, no? Then I suggest > > by providing a 2-dimensional register @code{ZA}, which is a square > matrix of variable size, just like [...] > Fixed. >> +The following definitions are used throughout @value{GDBN}'s source code and >> +in this document: >> + >> +@itemize >> + >> +@item >> +@anchor{SVL} >> +@cindex SVL >> +@code{SVL}: The streaming vector length, in bytes. It defines the size of each >> +dimension of the 2-dimensional square @code{ZA} matrix. The total size of >> +@code{ZA} is therefore @code{@var{SVL}x@var{SVL}}. >> + >> +@item >> +@anchor{SVQ} >> +@cindex SVQ >> +@code{SVQ}: The number of 128 bit units in @code{SVL}. This is mostly used >> +internally by @value{GDBN} and the Linux Kernel. >> + >> +@item >> +@anchor{SVG} >> +@cindex SVG >> +@code{SVG}: The number of 64 bit units in @code{SVL}. This is mostly used >> +internally by @value{GDBN} and the Linux Kernel. > > Likewise here: I suggest to use @var{nsvl} etc. for these parameters. > Pending on my first point above. >> +The @code{za} register is a 2-dimensional square @code{@var{n}x@var{n}} >> +matrix of bytes, where @var{n} is the streaming vector length (@code{SVL}. > > Here you could use the parameter explicitly: > > The @code{za} register is a 2-dimensional square > @code{@var{nsvl}x@var{nsvl}} matrix of bytes. > I'm having a hard time seeing the benefits of renaming SVL/SVQ/SVG to nsvl, nsvq and nsvg. The definition for SVL/SVQ/SVG is made clear above, at least I see it that way. My intent is to introduce SME enough so users are aware this feature is supported by gdb and are aware of how gdb exposes it. >> +@xref{SVL} > > This reference is unnecessary, as the description is only a short ways > above, and in the same node. > Removed now. >> +If the user wants to index the @code{za} register as a matrix, it is possible >> +to reference @code{za} as @code{za[i][j]}, where @var{i} is the row number > ^^^^^^^^^^^^^^^ > This should be @code{za[@var{i}][@var{j}]}. > Fixed now. >> +The @code{svg} register is the streaming vector granule (@code{SVG}) for the >> +current thread. @xref{SVG} > > Likewise: the @xref is not necessary. > Removed. >> +If the @sc{sm} bit is 1, it means the current thread is in streaming >> +mode, and the SVE registers will have their sizes based on the @code{svg} >> +register. If the @sc{sm} bit is 0, the current thread is not in streaming >> +mode, and the SVE registers have sizes based on the @code{vg} register. >> +@xref{VG}. @xref{SVG}. > > Here, only the cross-reference to VG is necessary. > Fixed now. >> +Setting the @code{svg} register to the same value will have no >> +effect. > > What do you mean by "same" here? Do you mean to say that setting SVG > is only meaningful if the value is different from its current value? > It means if svg is 2 and you attempt to set it to 2 nothing will change in the register state. Then again, gdb already enforces this, I think. I want to convey the information that the SME statw won't be reset if we accidentaly set svg to the same value (possibly an implementation detail that shouldn't be in the manual?). >> +The possible values for @code{svg} are 2, 4, 8, 16, 32 (1, 2, 4, 8, 16 >> +for svq). > > Are these values for the SVG register or for the SVG parameter? Same > question about the reference to "svq". > The svg values are for both the register and the parameter. They are the same thing. As stated before, svg (the register) is simply how gdb exposes SVG (the definition). svq is only a concept. No registers expose it directly (though gdb uses this in the code). svl is the exact same situation as svq. It is a concept and there is no register exposing its value directly, but we use it internally in gdb's code. This is an extension to what SVE already established with vg, vq and vl. I can see where there is some confusion with the uppercase/lowercase uses of svq/svl. I've rectified that. Given svq/svl don't have register counterparts, I think it is fair to always use SVQ/SVL. >> These numbers correspond to streaming vector length values of 16 >> +bytes, 32 bytes, 64 bytes, 128 bytes and 256 bytes. > > Same question here: are these the values of the SVL parameter? > Yes. I describe the case for svg values (register/parameter), SVQ values and SVL values. I've rephrased this slightly to... The possible values for the @code{svg} register are 2, 4, 8, 16, 32 (1, 2, 4, 8, 16 for @code{SVQ}). These numbers correspond to streaming vector length (@code{SVL}) values of 16 bytes, 32 bytes, 64 bytes, 128 bytes and 256 bytes respectively. >> +There is a fixed number of @code{za} tile pseudo registers (32). They are >> +@code{za0b}, @code{za0h} through @code{za1h}, @code{zas0} through @code{zas3}, >> +@code{zad0} through @code{zad7} and @code{zaq0} through @code{zaq15}. > > Something is amiss here, I think, since I only get 31 when I add the > above numbers (1+2+4+8+16). What did I miss? > Yeah, that's a typo. It should really be 31. Thanks for catching that. I might have read this too many times. >> +Tile slice pseudo-registers are vectors of horizontally or vertically >> +contiguous elements within the @code{za} register. >> + >> +The tile slice pseudo-registers are numerous. For a minimum streaming vector >> +length of 16 bytes, there are 5 x 32 pseudo registers. For the maximum >> +streaming vector length of 256 bytes, there are 5 x 512 pseudo registers. > > An explanation of why 5 and why 32 or 512 will help here, I think. > I noticed I missed a part of the tile slice register naming. I've reordered this block and rewritten some of it. How does it look? The tile slice pseudo registers have the following naming pattern: @code{za<@var{tile number}><@var{direction}>@var{qualifier} <@var{slice number}>}. There are up to 16 tiles (0 ~ 15), the direction can be either @code{v} (vertical) or @code{h} (horizontal), the qualifiers can be @code{b} (byte), @code{h} (halfword), @code{s} (word), @code{d} (doubleword) and @code{q} (quadword) and there are up to 256 slices (0 ~ 255) depending on the value of @code{svg}. The number of slices is the same as the value of @code{SVL}. The number of available tile slice pseudo-registers can be large. For a minimum @code{SVL} of 16 bytes, there are 5 (number of qualifiers) x 2 (number of directions) x 16 (@code{SVL}) pseudo registers. For the maximum @code{SVL} of 256 bytes, there are 5 x 2 x 256 pseudo registers. >> +The tile slice pseudo registers have the following naming pattern: >> +za<@var{tile number}><@var{orientation}><@var{slice number}>. >> + >> +There are up to 16 tiles (0 ~ 15), the orientation can be either vertical (v) >> +or horizontal (h) and there are up to 256 slices (0 ~ 255) depending on the >> +value of @code{svg}. > ^^^^^^^^^^^^^^^^^^^ > Is this the SVG parameter or the value of the SVG register? > Same situation as before. Given SVG is represented by a register svg, I'm talking about the register. >> +When listing all the available registers, users will see the >> +currently-available @code{za} pseudo-registers. Pseudo-registers that don't >> +exist for a given @code{svg} value will not be displayed. > ^^^^^^^^^^^^^^^^ > Same question here. > Same as above. >> +For more information on @acronym{SME} and its terminology, please refer to the >> +@url{https://developer.arm.com/documentation/ddi0616/aa/, >> +Arm Architecture Reference Manual Supplement}, The Scalable Matrix Extension >> +(@acronym{SME}), for Armv9-A. >> + >> +Some features are still under development and rely on ACLE and ABI >> +definitions, so there are known limitations to the current @acronym{SME} >> +support in @value{GDBN}. > > What is "ACLE"? It is not used anywhere else in the manual, AFAICT. > Arm C Language Extensions. I've added a link to it and to the ABI document, like so: Some features are still under development and rely on @url{https://github.com/ARM-software/acle/releases/latest, ACLE} and @url{https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst, ABI} definitions, so there are known limitations to the current @acronym{SME} support in @value{GDBN}. >> +One such example is calling functions by hand from @value{GDBN}. Hand calls >> +are not @acronym{SME}-aware and thus don't take into account the @code{svcr} >> +bits nor the @code{za} contents. > > I believe we refer to such calls as "calling functions in the program > being debugged", not "calling by hand". Also, a cross-reference to > the "Calling" node would be beneficial here. > Probably implementor speak here. I've fixed it now. It should say the following: One such example is calling functions in the program being debugged by @value{GDBN}. Such calls are not @acronym{SME}-aware and thus don't take into account the @code{svcr} pseudo-register bits nor the @code{za} register contents. >> +The lazy saving scheme involving the @code{tpidr2} register is not yet >> +supported by @value{GDBN}, though the @code{tpidr2} register is known >> +and supported by @value{GDBN}. > > What is the "lazy saving scheme"? If it's described somewhere in the > manual, please use here the same terminology as there, and please > include a cross-reference to that place. > It is described in the ABI. I've added a link to the ABI document and the section describing it: The @url{https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#the-za-lazy-saving-scheme, lazy saving scheme} involving the @code{tpidr2} register is not yet supported by @value{GDBN}, though the @code{tpidr2} register is known and supported by @value{GDBN}. >> +Lastly, an important limitation for @code{gdbserver} is its inability to >> +communicate changes in the streaming vector length to @value{GDBN}. This >> +means @code{gdbserver}, even though it is capable of adjusting its internal >> +caches to reflect a change to @code{svg}, will operate with a potentially >> +different @code{svg} value compared to @value{GDBN}. This can lead to >> +@value{GDBN} showing incorrect values for the @code{za} register and >> +incorrect values for SVE registers (when the @sc{m} bit is on). > > Is it really reasonable to release this feature given this glaring > limitation? > I think it isn't great, but OK. This has been a limitation for SVE since its inception. I proposed changes to fix this issue a while ago, and, more recently, Thiago has picked up this work and is working on a potential fix. Once fixed for the SVE case, it will be trivial to make it work for SME as well. I think this is also a limitation for Intel AMX. The rationale for it being OK is that changes to the SVE vector length and SME vector length that happen mid-execution of a program are very unlikely. The most common scenario is a program using a single vector length throughout its execution. >> +@item >> +@samp{za} is a vector of bytes of size svl x svl. > > See the comments above: I'd use > > [...] rectangular matrix bytes of the size @code{@var{nsvl}x@var{nsvl}} > I've adjusted this, provisionally, to the following: @item @samp{svg} is a 64-bit pseudo-register containing the number of 64-bit chunks in @code{SVL}. Its value is equal to @code{SVG}. @xref{SVG}. @xref{SVL}. >> +@item >> +@samp{svg} is a 64-bit pseudo register containing the number of 64-bit chunks >> +in svl. @xref{SVG} > ^^ > Two spaces there. > Fixed. >> +@item >> +@samp{svcr} is a 64-bit state register containing bits 0 (@sc{sm}) and >> +1 (@sc{za}). @xref{aarch64 sme svcr} > ^^ > And there. > Fixed. > Reviewed-By: Eli Zaretskii