From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4hXVMZUNvmiFgzIAWB0awg (envelope-from ) for ; Sun, 07 Sep 2025 18:56:21 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=PFeKBXjP; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9FC5D1E0BA; Sun, 07 Sep 2025 18:56:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A6B481E047 for ; Sun, 07 Sep 2025 18:56:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF9B13858D37 for ; Sun, 7 Sep 2025 22:56:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF9B13858D37 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=PFeKBXjP Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id DECF03858D1E for ; Sun, 7 Sep 2025 22:55:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DECF03858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DECF03858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::432 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757285732; cv=none; b=vvUtJCF9QpBeE104GhMoog9VuJNK/kVYLwMmLbmg1SjG8S2Fj089tjA6A6UKIq4AWsmZPBe2hqW8JPLjQl1XN5v7+g0rfqzcDSqZd07i/yHqpAj5LcmejWhSktZjfVUkxqbFoUKpn+MorayEXKxOCjJ6+2N7EPKl6znNZFO168k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757285732; c=relaxed/simple; bh=kwwd4feRCMIK4M+rVSnkTEzfYhzjJlZ1nTO+Wngy+5c=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=hwquYDc4gMmHU+bdF+yAYLZHk4HyGmXHbaKRm4pm3GOPAO0zUgPGx0gGIr3f3BeIrK7WrNmzFXkxjkeufnmDOBZYjsb5Qb5wb0T7zfMMmHlf3D4xv3UNBcLmb0vzq7HcJYlZZxVairIxG4fiw9h+kA5tRQyQL5c8v0sUZiFpF9Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DECF03858D1E Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3d44d734cabso2610757f8f.3 for ; Sun, 07 Sep 2025 15:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757285730; x=1757890530; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:from:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=VD/w/ZElqjMBQIHWe7yH8sZDP2Hr7kNros2/lsxyGMU=; b=PFeKBXjPqucXL7F6EgniTnahglGlkCKV8jg2s4Ha9BmK5Y18jvOsi5pShCz0iBYh08 8V/aMu4dBv4t1JEqyYow3Lt8sTIjiJyTkm3FpMUvhQmdgigjBLEJrUUVSMg2Ei1kCno0 +XrhpNT5bRyGNzwHYmsJI3OTVvZSxaHd5oDOWyszpADVc/0ickvcLbct5twjuyVGXiGr Bjbc6mCjFQqB8dTYZWUNLd2D0cDT4zf+M+qIRhfhDUztQ8odSDxUwTRU2LPRUB6swNAA dezENGbnKoNu0Nb+qyGjnhXzLtZZ3jfz38ynV27riNnEBxbFXZDbctHrN8hqb/JRajxI jnmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757285730; x=1757890530; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VD/w/ZElqjMBQIHWe7yH8sZDP2Hr7kNros2/lsxyGMU=; b=rIsKdFtyx3trZuj/NpvUGJnbJab1Ml2XskL1R8xzgVU/F7JFl6d/cIRzbfpfE6SPhH 5UuSM3m9oIzdMXb8gvIoy9mgOLxtbzDtDiIQdB8PpeR5G1sQsqOVVWWnXDBidi0nw6u5 GdDY03hWnt9HBJuMHq+XgxzUnFqlV/Tg7ywMJPQ4VX0W/2wsJCZ4NsrKn4nqaKt1o/17 VdnZZQYMYPJj8e/14XC+0gYVPObJdXF9XTLr/tWH6tya8maPnS1C7cDZH81oKSG6d/b5 QKdmT9jJdTigi+IPVRZumscmCvBFPKRynyGNzgp6Xd2YBBUNwxxlCmZdpmvTIhPF44pL i1YA== X-Forwarded-Encrypted: i=1; AJvYcCVSQYomFOOLneFsy6sHDy8D91S6t+c9NQU26TmxqaAinSUdGw4BhA5abXlcH7F8hnhckxVNDXM8n+L6Vw==@sourceware.org X-Gm-Message-State: AOJu0Yy1C+6c+Dxjm6BJnxxYh1iQW32CpcjEMAG+JEXYBsnCDlagoamL Nt00UrBjqsUWG2YjWapV24G9Q3ftzdcoKGbzUf4/+nVGYNdnUbMni01M X-Gm-Gg: ASbGnctPeiPOgyovA4Kn8REWPZHJYTGaXEQc+wiigni3dmpqkPaXXVajaka0GZfe6NR iV4qBIQQsuNksauGmTen9av/k6NXyuZYrKfsVA6VZg3wrQ+nJLTFymXmXdKXs79iSf6bFHmkcCD 750R+z5avobKipsptGGWmxn8Ah1NAd6ZBvgO1bOeqvc+DqWuLbYIAda8Zhh+RtfuyLgaoT62tHz DvZl2jkRJg0WptQpvriymrEGr0f/Bb6PG5d00T8gltLx2C6qYK8lU2FlxOYvejiVIYO4GjNG29G gPea1kOJhMiZ/4SPlZ49byTYHdPiVbEz1vmhmrHTyxg7t/MvKB1yNQjHvblVgFFPSpaGjcBLONn 25GZcvM04Fp1gEeWo1Tn/yIHPBKZe15zP6qkK0suss1dpIZ5PLnmeBvCy X-Google-Smtp-Source: AGHT+IHNT9cSFwk3gauN2+b2faSGNlHqrqUhGUQ3Me+pKrrgZOKQt+X3g83RZ8rRO8Cfncl8Uph+Mg== X-Received: by 2002:a05:6000:2211:b0:3e7:463e:d606 with SMTP id ffacd0b85a97d-3e7463edae2mr2150233f8f.1.1757285730162; Sun, 07 Sep 2025 15:55:30 -0700 (PDT) Received: from [192.168.0.38] ([86.12.216.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45dda202112sm115545875e9.5.2025.09.07.15.55.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Sep 2025 15:55:29 -0700 (PDT) Message-ID: <606b962c-d505-4e68-9090-20c003a9c6ed@gmail.com> Date: Sun, 7 Sep 2025 23:55:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Luis Subject: Re: [RFC PATCH 1/5] gdb/aarch64: Enable FPMR for AArch64 in gdb on Linux To: Ezra.Sitorus@arm.com, gdb-patches@sourceware.org References: <20250905131707.77027-1-Ezra.Sitorus@arm.com> <20250905131707.77027-2-Ezra.Sitorus@arm.com> Content-Language: en-US In-Reply-To: <20250905131707.77027-2-Ezra.Sitorus@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Thanks for the patch. A few comment below. On 05/09/2025 14:17, Ezra.Sitorus@arm.com wrote: > From: Ezra Sitorus > > The Floating Point Mode Register controls the behaviours of FP8 > instructions. This patch add FPMR to GDB if it is enabled on the > target. > > Manually validated with Shrinkwrap (Arm FVP). > > For this patch: > * Are the FPMR fields useful? What to do if the format is not valid > (0x2)? What about the OSC/OSM fields with Inf/Nan, are these helpful > too? I think that's an implementation choice. Is it of any value to users using the debugger to have access to these fields in a clearer manner? If not, then it doesn´t seem very useful. Is gdb allowed to force-change fpmr bits to switch the format being used? Is that useful? > --- > gdb/aarch64-linux-nat.c | 58 ++++++++++++++++++++++++++++++++++- > gdb/aarch64-linux-tdep.c | 2 +- > gdb/aarch64-tdep.c | 18 +++++++++-- > gdb/aarch64-tdep.h | 7 +++++ > gdb/arch/aarch64.c | 4 +++ > gdb/arch/aarch64.h | 4 ++- > gdb/features/Makefile | 1 + > gdb/features/aarch64-fpmr.c | 44 ++++++++++++++++++++++++++ > gdb/features/aarch64-fpmr.xml | 55 +++++++++++++++++++++++++++++++++ > 9 files changed, 188 insertions(+), 5 deletions(-) > create mode 100644 gdb/features/aarch64-fpmr.c > create mode 100644 gdb/features/aarch64-fpmr.xml > > diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c > index 89ecedda57d..b524aa352be 100644 > --- a/gdb/aarch64-linux-nat.c > +++ b/gdb/aarch64-linux-nat.c > @@ -604,6 +604,48 @@ store_gcsregs_to_thread (regcache *regcache) > perror_with_name (_("Unable to store GCS registers")); > } > > +/* Fill GDB's REGCACHE with the FPMR register content from the s/FPMR register content/FPMR register set content > + thread associated with REGCACHE. If there is no active FPMR register state, > + make the FPMR register contents zero. */ The comment states not having an active FPMR register state. Is that how this is implemented? Or is it the usual situation where you either have kernel support or you don't. If you do, then you get whatever contents the kernel provides, and gdb doesn´t need to bother with it. The code doesn´t seem to set anything to zero. > + > +static void > +fetch_fpmr_from_thread (struct regcache *regcache) > +{ > + aarch64_gdbarch_tdep *tdep > + = gdbarch_tdep (regcache->arch ()); > + > + int tid = regcache->ptid ().lwp (); > + > + struct iovec iov; > + uint64_t val; > + iov.iov_base = &val; > + iov.iov_len = sizeof(val); > + > + if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_FPMR, &iov) < 0) > + perror_with_name (_("Unable to fetch FPMR")); Maybe "Unable to fetch FPMR register set" > + regcache->raw_supply (tdep->fpmr_regnum, &val); > +} > + > +/* Store the NT_ARM_FPMR register set contents from GDB's REGCACHE to the > + thread associated with REGCACHE. */ > +static void New line between comment and function declaration. > +store_fpmr_to_thread (struct regcache *regcache) > +{ > + aarch64_gdbarch_tdep *tdep > + = gdbarch_tdep (regcache->arch ()); > + > + int tid = regcache->ptid ().lwp (); > + > + struct iovec iov; > + uint64_t val; > + iov.iov_base = &val; > + iov.iov_len = sizeof(val); > + > + regcache->raw_collect (tdep->fpmr_regnum, (char *) &val); > + if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_FPMR, &iov) < 0) > + perror_with_name (_("Unable to store FPMR")); "Unable to store FPMR register set" > +} > + > /* The AArch64 version of the "fetch_registers" target_ops method. Fetch > REGNO from the target and place the result into REGCACHE. */ > > @@ -642,6 +684,9 @@ aarch64_fetch_registers (struct regcache *regcache, int regno) > > if (tdep->has_gcs_linux ()) > fetch_gcsregs_from_thread (regcache); > + > + if (tdep->has_fpmr ()) > + fetch_fpmr_from_thread (regcache); > } > /* General purpose register? */ > else if (regno < AARCH64_V0_REGNUM) > @@ -679,6 +724,9 @@ aarch64_fetch_registers (struct regcache *regcache, int regno) > && (regno == tdep->gcs_reg_base || regno == tdep->gcs_linux_reg_base > || regno == tdep->gcs_linux_reg_base + 1)) > fetch_gcsregs_from_thread (regcache); > + /* FP8/FPMR? */ For consistency maybe use FPMR only? Is FP8 important in this context? > + else if (tdep->has_fpmr () && (regno == tdep->fpmr_regnum)) > + fetch_fpmr_from_thread (regcache); > } > > /* A version of the "fetch_registers" target_ops method used when running > @@ -753,6 +801,9 @@ aarch64_store_registers (struct regcache *regcache, int regno) > > if (tdep->has_gcs_linux ()) > store_gcsregs_to_thread (regcache); > + > + if (tdep->has_fpmr ()) > + store_fpmr_to_thread (regcache); > } > /* General purpose register? */ > else if (regno < AARCH64_V0_REGNUM) > @@ -784,7 +835,9 @@ aarch64_store_registers (struct regcache *regcache, int regno) > && (regno == tdep->gcs_reg_base || regno == tdep->gcs_linux_reg_base > || regno == tdep->gcs_linux_reg_base + 1)) > store_gcsregs_to_thread (regcache); > - Unrelated removal of blank line. > + /* FPMR? */ > + else if (tdep->has_fpmr() && regno == tdep->fpmr_regnum) Formatting: space between function name and parenthesis. > + store_fpmr_to_thread (regcache); > /* PAuth registers are read-only. */ > } > > @@ -969,6 +1022,9 @@ aarch64_linux_nat_target::read_description () > if ((hwcap2 & HWCAP2_SME2) || (hwcap2 & HWCAP2_SME2P1)) > features.sme2 = supports_zt_registers (tid); > > + /* Check for FP8/FPMR. */ Use only FPMR? > + features.fpmr = hwcap2 & (1UL << 48); > + Based on previous issues, I think we need to use 1ULL here due to 32-bit arm. > return aarch64_read_description (features); > } > > diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c > index 76bde85188b..acb650db514 100644 > --- a/gdb/aarch64-linux-tdep.c > +++ b/gdb/aarch64-linux-tdep.c > @@ -1713,7 +1713,7 @@ aarch64_linux_core_read_description (struct gdbarch *gdbarch, > features.pauth = hwcap & AARCH64_HWCAP_PACA; > features.gcs = features.gcs_linux = hwcap & HWCAP_GCS; > features.mte = hwcap2 & HWCAP2_MTE; > - > + features.fpmr = hwcap2 & (1UL << 48); Same here, 1ULL. > /* Handle the TLS section. */ > asection *tls = bfd_get_section_by_name (abfd, ".reg-aarch-tls"); > if (tls != nullptr) > diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c > index 500ac77d75a..33bef91c44e 100644 > --- a/gdb/aarch64-tdep.c > +++ b/gdb/aarch64-tdep.c > @@ -4141,6 +4141,10 @@ aarch64_features_from_target_desc (const struct target_desc *tdesc) > != nullptr); > > return features; > + > + /* Check for FPMR feature. */ > + features.fpmr = (tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.fpmr") > + != nullptr); > } > > /* Implement the "cannot_store_register" gdbarch method. */ > @@ -4448,11 +4452,12 @@ static struct gdbarch * > aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > { > const struct tdesc_feature *feature_core, *feature_fpu, *feature_sve; > - const struct tdesc_feature *feature_pauth; > + const struct tdesc_feature *feature_pauth, *feature_fpmr; > bool valid_p = true; > int i, num_regs = 0, num_pseudo_regs = 0; > int first_pauth_regnum = -1, ra_sign_state_offset = -1; > int first_mte_regnum = -1, first_tls_regnum = -1; > + int fpmr_regnum = -1; > uint64_t vq = aarch64_get_tdesc_vq (info.target_desc); > uint64_t svq = aarch64_get_tdesc_svq (info.target_desc); > > @@ -4550,6 +4555,14 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > num_pseudo_regs += 32; /* add the Bn scalar register pseudos */ > } > > + feature_fpmr = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.fpmr"); > + if (feature_fpmr != nullptr) > + { > + fpmr_regnum = num_regs++; > + valid_p &= tdesc_numbered_register (feature_fpmr, tdesc_data.get (), > + fpmr_regnum, "fpmr"); > + } > + > int first_sme_regnum = -1; > int first_sme2_regnum = -1; > int first_sme_pseudo_regnum = -1; > @@ -4760,7 +4773,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > > /* Set the SME2 register set details. */ > tdep->sme2_zt0_regnum = first_sme2_regnum; > - Unrelated removal of blank line. > + /* Set the FPMR regnum. */ > + tdep->fpmr_regnum = fpmr_regnum; > set_gdbarch_push_dummy_call (gdbarch, aarch64_push_dummy_call); > set_gdbarch_frame_align (gdbarch, aarch64_frame_align); > > diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h > index 99e7d26ce4a..403743516df 100644 > --- a/gdb/aarch64-tdep.h > +++ b/gdb/aarch64-tdep.h > @@ -207,6 +207,13 @@ struct aarch64_gdbarch_tdep : gdbarch_tdep_base > { > return gcs_linux_reg_base != -1; > } > + /* Index of FPMR. This is -1 if FPMR/FP8 is not supported. */ Keeping the consistency with how the other sets were documented, I´d say: "First FPMR register. This is -1 if FPMR is not available." > + int fpmr_regnum = -1; > + > + bool has_fpmr () const > + { > + return fpmr_regnum != -1; > + } > }; > > const target_desc *aarch64_read_description (const aarch64_features &features); > diff --git a/gdb/arch/aarch64.c b/gdb/arch/aarch64.c > index dff2bc16003..622138f43b5 100644 > --- a/gdb/arch/aarch64.c > +++ b/gdb/arch/aarch64.c > @@ -20,6 +20,7 @@ > > #include "../features/aarch64-core.c" > #include "../features/aarch64-fpu.c" > +#include "../features/aarch64-fpmr.c" > #include "../features/aarch64-sve.c" > #include "../features/aarch64-pauth.c" > #include "../features/aarch64-mte.c" > @@ -73,6 +74,9 @@ aarch64_create_target_description (const aarch64_features &features) > if (features.gcs_linux) > regnum = create_feature_aarch64_gcs_linux (tdesc.get (), regnum); > > + if (features.fpmr) > + regnum = create_feature_aarch64_fpmr (tdesc.get (), regnum); > + > return tdesc.release (); > } > > diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h > index 679d845df74..731d4680248 100644 > --- a/gdb/arch/aarch64.h > +++ b/gdb/arch/aarch64.h > @@ -34,6 +34,7 @@ struct aarch64_features > uint64_t vq = 0; > bool pauth = false; > bool mte = false; > + bool fpmr = false; > > /* A positive TLS value indicates the number of TLS registers available. */ > uint8_t tls = 0; > @@ -68,7 +69,8 @@ inline bool operator==(const aarch64_features &lhs, const aarch64_features &rhs) > && lhs.svq == rhs.svq > && lhs.sme2 == rhs.sme2 > && lhs.gcs == rhs.gcs > - && lhs.gcs_linux == rhs.gcs_linux; > + && lhs.gcs_linux == rhs.gcs_linux > + && lhs.fpmr == rhs.fpmr; > } Do you also need to update the operator() to account for fpmr? It computes the hash of the feature based on what features are present. Unrelated, but looking at the code, it may be the case we missed adding gcs and gcs_linux to this operator. > > namespace std > diff --git a/gdb/features/Makefile b/gdb/features/Makefile > index d17c349b6cf..ed1b8bf119c 100644 > --- a/gdb/features/Makefile > +++ b/gdb/features/Makefile > @@ -201,6 +201,7 @@ $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl > # For targets with feature based target descriptions, > # the set of xml files we'll generate .c files for GDB from. > FEATURE_XMLFILES = aarch64-core.xml \ > + aarch64-fpmr.xml \ > aarch64-fpu.xml \ > aarch64-pauth.xml \ > aarch64-mte.xml \ > diff --git a/gdb/features/aarch64-fpmr.c b/gdb/features/aarch64-fpmr.c > new file mode 100644 > index 00000000000..a372b12530b > --- /dev/null > +++ b/gdb/features/aarch64-fpmr.c > @@ -0,0 +1,44 @@ > +/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: > + Original: aarch64-fpmr.xml */ > + > +#include "gdbsupport/tdesc.h" > + > +static int > +create_feature_aarch64_fpmr (struct target_desc *result, long regnum) > +{ > + struct tdesc_feature *feature; > + > + feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.fpmr"); > + tdesc_type_with_fields *type_with_fields; > + type_with_fields = tdesc_create_enum (feature, "fp8_fmt", 3); > + tdesc_add_enum_value (type_with_fields, 0, "E5M2"); > + tdesc_add_enum_value (type_with_fields, 1, "E4M3"); > + > + type_with_fields = tdesc_create_enum (feature, "osc", 1); > + tdesc_add_enum_value (type_with_fields, 0, "Inf/NaN"); > + tdesc_add_enum_value (type_with_fields, 1, "MaxNormal"); > + > + type_with_fields = tdesc_create_enum (feature, "osm", 1); > + tdesc_add_enum_value (type_with_fields, 0, "Inf"); > + tdesc_add_enum_value (type_with_fields, 1, "MaxNormal"); > + > + type_with_fields = tdesc_create_flags (feature, "fpmr_flags", 8); > + tdesc_type *field_type; > + field_type = tdesc_named_type (feature, "fp8_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "F8S1", 0, 2, field_type); > + field_type = tdesc_named_type (feature, "fp8_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "F8S2", 3, 5, field_type); > + field_type = tdesc_named_type (feature, "fp8_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "F8D", 6, 8, field_type); > + field_type = tdesc_named_type (feature, "osm"); > + tdesc_add_typed_bitfield (type_with_fields, "OSM", 14, 14, field_type); > + field_type = tdesc_named_type (feature, "osc"); > + tdesc_add_typed_bitfield (type_with_fields, "OSC", 15, 15, field_type); > + tdesc_add_bitfield (type_with_fields, "LSCALE", 16, 22); > + field_type = tdesc_named_type (feature, "int8"); > + tdesc_add_typed_bitfield (type_with_fields, "NSCALE", 24, 31, field_type); > + tdesc_add_bitfield (type_with_fields, "LSCALE2", 32, 37); > + > + tdesc_create_reg (feature, "fpmr", regnum++, 1, NULL, 64, "fpmr_flags"); > + return regnum; > +} > diff --git a/gdb/features/aarch64-fpmr.xml b/gdb/features/aarch64-fpmr.xml > new file mode 100644 > index 00000000000..1f2f9c0d4cf > --- /dev/null > +++ b/gdb/features/aarch64-fpmr.xml > @@ -0,0 +1,55 @@ > + > + > + > + > + > + > + I´d expand the comment a bit. As it is, it isn´t useful. If there isn´t anything useful to say about the register, leave it without a comment. Same for other cases below where the comment is just the register name. > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + A spotted some misc formatting issues, like space between function and parenthesis, 2 spaces after period, blank line between function declaration and comment. When working through the comment, please make sure those get addressed.