-
Notifications
You must be signed in to change notification settings - Fork 2
riscv_zhinx_quick_fix
- Status: Merged for 2.39 (all but non-functional part)
- Branch:
riscv-zhinx-quick-fix - Tracking PR: #9 (view Pull Request and Diff)
- Mailing List:
- PATCH v1:
PATCH 1/2 - PATCH v2/v3: none
This is a duplicate of riscv-h-canonical. See this for details.
This patch is independently applied to master and removed in PATCH v2.
- PATCH v1:
PATCH 2/2 - PATCH v2:
PATCH 1/1 - PATCH v3:
PATCH 1/2
Following instructions have INSN_CLASS_D_AND_ZFH_INX:
fcvt.h.dfcvt.d.h
Following instructions have INSN_CLASS_Q_AND_ZFH_INX:
fcvt.h.qfcvt.q.h
I noticed that feature gates on those instruction classes are most likely incorrect.
Quoting ISA Manual 24.5 "Zhinxmin":
If the
Zdinxextension is present, theFCVT.D.HandFCVT.H.Dinstructions 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
Dextension is present,FCVT.D.HorFCVT.H.Dconverts a half-precision floating-point number to a double-precision floating-point number, or vice-versa, respectively. If theQextension is present,FCVT.Q.HorFCVT.H.Qconverts a half-precision floating-point number to a quad-precision floating-point number, or vice-versa, respectively.
And 24.4 "Zhinx":
The
Zhinxextension adds all of the instructions that theZfhextension adds, except for the transfer instructionsFLH,FSH,FMV.H.X, andFMV.X.H. TheZhinxvariants of theseZfh-extension instructions have the same semantics, except that (cont...)
On INSN_CLASS_D_AND_ZFH_INX:
| Implementation | Feature Gate |
|---|---|
| Li's implementation | (D && Zfh) or Zhinx |
| This patch | (D && Zfh) or (Zdinx && Zhinx) |
|
My combined float patchset (PATCH v1/v2) |
(D && Zfhmin) or (Zdinx && Zhinxmin) |
- PATCH v1/v2: none
- PATCH v3:
PATCH 2/2
On riscv_supported_std_z_ext in bfd/elfxx-riscv.c, extension entries should be ordered by its canonical order (it says must on the comment but not strictly required; Zvl* extensions are not strictly ordered now).
So, Zhinx should be moved after all Zv* extensions.