Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ezra Sitorus <ezra.sitorus@arm.com>
To: Tom Tromey <tom@tromey.com>
Cc: <gdb-patches@sourceware.org>, <luis.machado.foss@gmail.com>,
	<pedro@palves.net>
Subject: Re: [RFC PATCH] gdb/py: Add pretty printer for __mfp8 for aarch64
Date: Wed, 19 Nov 2025 21:28:11 +0000	[thread overview]
Message-ID: <aR42a_cf5FcpuOI6@D2G2X7XGD1> (raw)
In-Reply-To: <87qztuqak2.fsf@tromey.com>

> I don't really know anything about this type.  Could you say what it
> really is?
> 
> If it's just a float of some kind, then I don't see why it couldn't be
> emitted that way (i.e., base type with DW_ATE_Float and the appropriate
> size), and then if gdb needs special support, that could be added using
> the usual approach (floatformat or whatever).

There are 2 FP8 formats: e4m3 and e5m2. However, instead of introducing 2
new types, we have a single FP8 type called __mfp8. To specify which format
is being used for instructions, there is a new Floating Point Mode Register
(FPMR), which specifies which format is used for source/destination register.
Support for this has just been added to GDB.

Whenever we have an __mfp8/mfloat8_t variable, it's not clear which format
it is using so things like arithmetic or casting aren't allowed. In GCC,
we have also used a uint8_t as the base type which is why it's emitting
DW_ATE_unsigned.

My previous approach was to add new e4m3 and e5m2 floatformats but this was
rejected because:
* there might be slight differences between different architectures
* it's still not a 'real' type so addition etc shouldn't really be allowed.
* all I'm trying to do really is just to present the __mfp8 (uint8_t) in a
  specific way so it's better as a pretty printer.

I think that's a brief summary of Pedro's email here:
https://inbox.sourceware.org/gdb-patches/5ec9ce76-d614-405f-96e8-f490e035aefb@palves.net/

Ezra

  reply	other threads:[~2025-11-19 21:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18 14:14 Ezra.Sitorus
2025-11-18 17:12 ` Andrew Burgess
2025-11-18 18:37   ` Ezra Sitorus
2025-11-26 16:08   ` Ezra Sitorus
2025-11-18 18:42 ` Tom Tromey
2025-11-19 13:12   ` Ezra Sitorus
2025-11-19 15:58     ` Tom Tromey
2025-11-19 21:28       ` Ezra Sitorus [this message]
2025-12-16 16:39       ` Ezra Sitorus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aR42a_cf5FcpuOI6@D2G2X7XGD1 \
    --to=ezra.sitorus@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado.foss@gmail.com \
    --cc=pedro@palves.net \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox