From: Kito Cheng <kito.cheng@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Christoph Muellner <christoph.muellner@vrull.eu>,
binutils@sourceware.org, Nelson Chu <nelson@rivosinc.com>,
Andrew Waterman <andrew@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Jim Wilson <jim.wilson.gcc@gmail.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Jeff Law <jeffreyalaw@gmail.com>,
Tsukasa OI <research_trasio@irq.a4lg.com>
Subject: Re: [RFC PATCH v2 2/2] RISC-V: Add support for the Zfa extension
Date: Mon, 27 Mar 2023 16:53:21 +0800 [thread overview]
Message-ID: <CA+yXCZBQiW9JsV5rzc8U-ksWno8pvaARmCQe+0j-t_h6nFJ55Q@mail.gmail.com> (raw)
In-Reply-To: <981c0ad5-3e84-d2f3-c14a-4c7bb70749a9@suse.com>
Wait, I mean the hex floating point format defined in C99/C++17, not
the raw hex value.
so something like 0x1p-16 (0.0000152587890625), 0x1p-2 (0.25) 0x1p+0,
-0x1p+0 could be used for fli.* instruction.
You could use printf with %a to get those values.
https://gcc.gnu.org/onlinedocs/gcc/Hex-Floats.html
https://developer.arm.com/documentation/dui0375/latest/Compiler-Coding-Practices/Hexadecimal-floating-point-numbers-in-C99
On Mon, Mar 27, 2023 at 4:39 PM Jan Beulich via Binutils
<binutils@sourceware.org> wrote:
>
> On 27.03.2023 10:01, Christoph Muellner wrote:
> > --- a/opcodes/riscv-opc.c
> > +++ b/opcodes/riscv-opc.c
> > @@ -110,6 +110,16 @@ const char * const riscv_vma[2] =
> > "mu", "ma"
> > };
> >
> > +/* The FLI.[HSDQ] value constants. */
> > +const char * const riscv_fli_value[32] =
> > +{
> > + "-1.0", "min", "0.0000152587890625", "0.000030517578125",
> > + "0.00390625", "0.0078125", "0.0625", "0.125",
> > + "0.25", "0.3125", "0.375", "0.4375", "0.5", "0.625", "0.75", "0.875",
> > + "1.0", "1.25", "1.5", "1.75", "2.0", "2.5", "3.0", "4.0",
> > + "8.0", "16.0", "128.0", "256.0", "32768.0", "65536.0", "inf", "nan",
> > +};
>
> Especially for values like 1.0x2^^-n (entries 2 and onwards) I question
> the spelled out numbers to be the most suitable ones usability wise. At
> least some alternative spelling (e.g. 2.e-16) ought to be recognized as
> well. But since there are meany reasonable spellings (leading 0 omitted
> in 0.<fraction> or trailing zero omitted in <num>.0), I guess I'd prefer
> if values were actually parsed as a floating point number (e.g. via
> ieee_md_atof()), and then matched against values stored in the table.
> One might further consider to also permit the 2nd form accepted
> elsewhere, see read.c:parse_one_float().
>
> Jan
next prev parent reply other threads:[~2023-03-27 8:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 8:01 [RFC PATCH v2 0/2] " Christoph Muellner
2023-03-27 8:01 ` [RFC PATCH v2 1/2] RISC-V: Allocate "various" operand type Christoph Muellner
2023-03-27 8:01 ` [RFC PATCH v2 2/2] RISC-V: Add support for the Zfa extension Christoph Muellner
2023-03-27 8:09 ` Kito Cheng
2023-03-27 8:26 ` Christoph Müllner
2023-03-27 8:38 ` Jan Beulich
2023-03-27 8:53 ` Kito Cheng [this message]
2023-03-27 9:08 ` Christoph Müllner
2023-03-27 9:54 ` Jan Beulich
2023-03-30 10:30 ` Christoph Müllner
2023-03-30 10:54 ` Jan Beulich
2023-03-30 12:18 ` Jan Beulich
2023-03-30 15:36 ` Christoph Müllner
2023-03-30 16:13 ` Jan Beulich
2023-03-30 16:59 ` Christoph Müllner
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=CA+yXCZBQiW9JsV5rzc8U-ksWno8pvaARmCQe+0j-t_h6nFJ55Q@mail.gmail.com \
--to=kito.cheng@gmail.com \
--cc=andrew@sifive.com \
--cc=binutils@sourceware.org \
--cc=christoph.muellner@vrull.eu \
--cc=jbeulich@suse.com \
--cc=jeffreyalaw@gmail.com \
--cc=jim.wilson.gcc@gmail.com \
--cc=nelson@rivosinc.com \
--cc=palmer@dabbelt.com \
--cc=philipp.tomsich@vrull.eu \
--cc=research_trasio@irq.a4lg.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).