public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] RISC-V: QUICK fix on Li's Zhinx implementation
@ 2022-06-05  4:43 Tsukasa OI
  2022-06-05  4:43 ` [PATCH 1/2] RISC-V: Add 'H' to canonical extension ordering Tsukasa OI
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tsukasa OI @ 2022-06-05  4:43 UTC (permalink / raw)
  To: Tsukasa OI, Palmer Dabbelt, Kito Cheng, Nelson Chu, Weiwei Li; +Cc: binutils

Hello,

I understand that my Zfinx fixes + Zfhmin/Zhinxmin patchset requires
some time to review.

Meanwhile, there's a quick fix to Li's Zhinx implementation.  My
patchset already contains equivalent fix but I extracted the most
important one (that should definately be fixed before 2.39).

My combined float patchset:
<https://sourceware.org/pipermail/binutils/2022-June/121138.html>

Li Weiwei's Zhinx implementation:
<https://sourceware.org/pipermail/binutils/2022-May/121038.html>



PATCH 1:

Again, this is a duplicate of:
<https://sourceware.org/pipermail/binutils/2022-June/121115.html>
<https://sourceware.org/pipermail/binutils/2022-June/121139.html> (in my combined fixes)

PATCH 2 required a test to give -march including **both** Zqinx and
Zhinx.  As a result, this patch is mandatory for the next patch is to be
applied.  Otherwise, it would need likely non-canonical ordering on
-march.



PATCH 2:

Following instructions have INSN_CLASS_D_AND_ZFH_INX:

-   fcvt.h.d
-   fcvt.d.h

Following instructions have INSN_CLASS_Q_AND_ZFH_INX:

-   fcvt.h.q
-   fcvt.q.h

I noticed that feature gates on those instruction classes are most
likely incorrect.

Quoting ISA Manual 24.5 "Zhinxmin":
> If the Zdinx extension is present, the FCVT.D.H and FCVT.H.D
> instructions are also included.

Although no such limitation is explicitly specified on "Zhinx" itself,
it's very unlikely that FCVT.D.H and FCVT.H.D can be supported without
Zdinx extension.

Quoting Manual 16.3 "Half-Precision Conversion and Move Instructions" from Zfh:
> If the D extension is present, FCVT.D.H or FCVT.H.D converts a half-
> precision floating-point number to a double-precision floating-point
> number, or vice-versa, respectively. If the Q extension is present,
> FCVT.Q.H or FCVT.H.Q converts a half-precision floating-point number
> to a quad-precision floating-point number, or vice-versa,
> respectively.

And 24.4 "Zhinx":
> The Zhinx extension adds all of the instructions that the Zfh
> extension adds, except for the transfer instructions FLH, FSH,
> FMV.H.X, and FMV.X.H. The Zhinx variants of these Zfh-extension
> instructions have the same semantics, except that (cont...)


On INSN_CLASS_D_AND_ZFH_INX:

Li's implementation        : (D && Zfh) || Zhinx
This patch                 : (D && Zfh) || (Zdinx && Zhinx)
My combined float patchset : (D && Zfhmin) || (Zdinx && Zhinxmin)

This commit fixes feature gates and their diagnostics.



Thanks,
Tsukasa




Tsukasa OI (2):
  RISC-V: Add 'H' to canonical extension ordering
  RISC-V: Fix requirement handling on Zhinx+{D,Q}

 bfd/elfxx-riscv.c                        | 32 +++++++++++++++++++-----
 gas/testsuite/gas/riscv/fp-zhinx-insns.d |  2 +-
 2 files changed, 27 insertions(+), 7 deletions(-)


base-commit: c8eab1d7c92ad72089c98e5753ebc96419e3674a
-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-07-07  4:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-05  4:43 [PATCH 0/2] RISC-V: QUICK fix on Li's Zhinx implementation Tsukasa OI
2022-06-05  4:43 ` [PATCH 1/2] RISC-V: Add 'H' to canonical extension ordering Tsukasa OI
2022-06-22 10:39   ` Nelson Chu
2022-06-22 11:08     ` Tsukasa OI
2022-06-05  4:43 ` [PATCH 2/2] RISC-V: Fix requirement handling on Zhinx+{D,Q} Tsukasa OI
2022-06-24  2:59 ` [PATCH v2 0/1] RISC-V: QUICK fix on Li's Zhinx implementation Tsukasa OI
2022-06-24  2:59   ` [PATCH v2 1/1] RISC-V: Fix requirement handling on Zhinx+{D,Q} Tsukasa OI
2022-06-24  3:51   ` [PATCH v3 0/2] RISC-V: QUICK fix on Li's Zhinx implementation Tsukasa OI
2022-06-24  3:51     ` [PATCH v3 1/2] RISC-V: Fix requirement handling on Zhinx+{D,Q} Tsukasa OI
2022-07-07  3:02       ` Kito Cheng
2022-07-07  4:25         ` Nelson Chu
2022-06-24  3:51     ` [PATCH v3 2/2] RISC-V: Reorder Zhinx extension Tsukasa OI

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).