public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Kito Cheng <kito.cheng@sifive.com>,
	Nelson Chu <nelson.chu@sifive.com>,
	Weiwei Li <liweiwei@iscas.ac.cn>
Cc: binutils@sourceware.org
Subject: [PATCH 0/2] RISC-V: QUICK fix on Li's Zhinx implementation
Date: Sun,  5 Jun 2022 13:43:06 +0900	[thread overview]
Message-ID: <cover.1654404125.git.research_trasio@irq.a4lg.com> (raw)

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


             reply	other threads:[~2022-06-05  4:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05  4:43 Tsukasa OI [this message]
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

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=cover.1654404125.git.research_trasio@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=binutils@sourceware.org \
    --cc=kito.cheng@sifive.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=nelson.chu@sifive.com \
    --cc=palmer@dabbelt.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).