Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: <Ezra.Sitorus@arm.com>
To: <gdb-patches@sourceware.org>
Cc: <eliz@gnu.org>, <luis.machado.foss@gmail.com>,
	Ezra Sitorus <ezra.sitorus@arm.com>
Subject: [PATCH 1/4] libiberty: Add fp8 float formats
Date: Thu, 25 Sep 2025 22:18:01 +0100	[thread overview]
Message-ID: <20250925211804.21967-2-Ezra.Sitorus@arm.com> (raw)
In-Reply-To: <20250925211804.21967-1-Ezra.Sitorus@arm.com>

From: Ezra Sitorus <ezra.sitorus@arm.com>

Add the 8 bit floating point formats E5M2 and E4M3 to libiberty.

E5M2 follows the IEEE convention on special values while E4M3 increases
the dynamic range by reducing the number of values. Note that this patch
only adds the values required for struct floatformat - another patch is
sent in gdb to determine the output of these values.

Technical information on FP8 can be found here:
https://arxiv.org/abs/2209.05433

The gcc patch is here: https://sourceware.org/pipermail/gcc-patches/2025-September/696165.html
---
 libiberty/floatformat.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index fe82e019cc9..96ab956aef0 100644
--- a/libiberty/floatformat.c
+++ b/libiberty/floatformat.c
@@ -269,6 +269,38 @@ const struct floatformat floatformat_arm_ext_littlebyte_bigword =
   floatformat_always_valid,
   NULL
 };
+const struct floatformat floatformat_fp8_e5m2_big =
+{
+  floatformat_big, 8, 0, 1, 5, 15, 31, 6, 2,
+  floatformat_intbit_no,
+  "floatformat_fp8_e5m2_big",
+  floatformat_always_valid,
+  NULL
+};
+const struct floatformat floatformat_fp8_e5m2_little =
+{
+  floatformat_little, 8, 0, 1, 5, 15, 31, 6, 2,
+  floatformat_intbit_no,
+  "floatformat_fp8_e5m2_little",
+  floatformat_always_valid,
+  NULL
+};
+const struct floatformat floatformat_fp8_e4m3_big =
+{
+  floatformat_big, 8, 0, 1, 4, 7, 15, 5, 3,
+  floatformat_intbit_no,
+  "floatformat_fp8_e4m3_big",
+  floatformat_always_valid,
+  NULL
+};
+const struct floatformat floatformat_fp8_e4m3_little =
+{
+  floatformat_little, 8, 0, 1, 4, 7, 15, 5, 3,
+  floatformat_intbit_no,
+  "floatformat_fp8_e4m3_little",
+  floatformat_always_valid,
+  NULL
+};
 const struct floatformat floatformat_ia64_spill_big =
 {
   floatformat_big, 128, 0, 1, 17, 65535, 0x1ffff, 18, 64,
-- 
2.45.2


  reply	other threads:[~2025-09-25 21:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 21:18 [PATCH 0/4] gdb: Display fp8 format for AArch64 registers Ezra.Sitorus
2025-09-25 21:18 ` Ezra.Sitorus [this message]
2025-09-25 21:18 ` [PATCH] gdb: Add support for fp8 formats Ezra.Sitorus
2025-09-25 21:18 ` [PATCH 3/4] gdb/aarch64: Display fp8 formats in registers Ezra.Sitorus
2025-10-11 13:10   ` Luis
2025-10-14  0:56     ` Ezra Sitorus
2025-10-17 10:20       ` Luis
2025-09-25 21:18 ` [PATCH 4/4] gdb/aarch64: Tests for verifying fp8 register formats Ezra.Sitorus
2025-09-29 17:55 ` [PATCH 0/4] gdb: Display fp8 format for AArch64 registers Pedro Alves

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=20250925211804.21967-2-Ezra.Sitorus@arm.com \
    --to=ezra.sitorus@arm.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado.foss@gmail.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