public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/1] RISC-V: Fix mask for some fcvt instructions
@ 2022-01-10  8:22 Tsukasa OI
  2022-01-10  8:22 ` [PATCH 1/1] " Tsukasa OI
  0 siblings, 1 reply; 4+ messages in thread
From: Tsukasa OI @ 2022-01-10  8:22 UTC (permalink / raw)
  To: Tsukasa OI; +Cc: binutils

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


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

end of thread, other threads:[~2022-02-25  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10  8:22 [PATCH 0/1] RISC-V: Fix mask for some fcvt instructions Tsukasa OI
2022-01-10  8:22 ` [PATCH 1/1] " Tsukasa OI
2022-01-10 23:56   ` Andrew Waterman
2022-02-25  9:08     ` Nelson Chu

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