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>
Cc: binutils@sourceware.org
Subject: [PATCH 0/1] RISC-V: Fix mask for some fcvt instructions
Date: Mon, 10 Jan 2022 17:22:10 +0900	[thread overview]
Message-ID: <cover.1641802855.git.research_trasio@irq.a4lg.com> (raw)

This patch fixes wrong mask used in following RISC-V instructions:

-   fcvt.s.wu
-   fcvt.s.lu
-   fcvt.d.lu
-   fcvt.q.lu

For instance, 'fcvt.s.wu' instruction should have mask value
"MASK_FCVT_S_WU|MASK_RM", not "MASK_FCVT_S_W|MASK_RM".  Fortunately,
this kind of error will not cause functional problem since MASK_FCVT_S_W
and MASK_FCVT_S_WU have exactly the same value of 0xfff0007f.

However, it's always good to fix this kind of stuff because it's
definately an error and can be a code clarity problem.

... More of that, it can grow.  Actually, I found this issue while
implementing 'Zfh' and 'Zfhmin' instructions (yes, I copied 'F'
instructions to make 'fcvt.h.wu' and 'fcvt.h.lu' instructions and found
something is wrong).

This is not hypothetical situation and happened before.  For first three
instructions ('fcvt.s.wu', 'fcvt.s.lu' and 'fcvt.d.lu'), it contained
errors from very first (commit e23eba971dd409b999dd83d8df0f842680c1c642;
the first time RISC-V is merged into GNU Binutils) and 'fcvt.q.lu' with
an error is added in commit cc917fd93d2a836adfd61b91df021cf835e88fd1
(apparently, the author copied the 'D' instructions code without
realizing a problem behind it).

I machine-checked the entire riscv_opcodes and it should be the first
**and** the last.




Tsukasa OI (1):
  RISC-V: Fix mask for some fcvt instructions

 opcodes/riscv-opc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


base-commit: 4cfa9e3f28c8c5156b9773cc94192233947d351c
-- 
2.32.0


             reply	other threads:[~2022-01-10  8:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10  8:22 Tsukasa OI [this message]
2022-01-10  8:22 ` [PATCH 1/1] " Tsukasa OI
2022-01-10 23:56   ` Andrew Waterman
2022-02-25  9:08     ` Nelson Chu

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.1641802855.git.research_trasio@irq.a4lg.com \
    --to=research_trasio@irq.a4lg.com \
    --cc=binutils@sourceware.org \
    /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).