You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should also define what HasV actually means. Does it mean that Version 1.0 of the RISC-V Vector extension is supported or some earlier version? This is an issue as there are some boards on the market, e.g., Sipeed LicheePi that implement a draft version of the Vector specification (v0.7), and unfortunately, v0.7 and the ratified v1.0 are not binary compatible. Presumably we want HasV to be set to true only if the underlying CPU supports the ratified 1.0 version of the Vector specification or a backwardly compatible future version.
Assuming this is the case, there's another problem. It seems that the LicheePi has a custom kernel that reports support for the 'V' extension via hwcap, even though it only supports v0.7 of the standard. Any Go programs that were to use hwcap to detect the vector extension before executing V1.0 vector code would most likely crash on the LicheePi. This is not just a hypothetical concern. An issue was raised in OpenJDK this week reporting binary incompatibility vector related crashes on the LicheePi in the JVM. The solution adopted in the OpenJDK was to stop using hwcap to detect the Vector extension and to instead rely exclusively riscv_hwprobe, as proposed in #61416, to detect Vector . riscv_hwprobe does not have these issues as the extensions it reports are explicitly versioned.
Since Linux 6.5 will be released with riscv vector support, I proposal adding a vector feature detection for it.
Linux source code: https://github.com/torvalds/linux/blob/v6.5-rc7/arch/riscv/include/uapi/asm/hwcap.h
The API change in x/sys is simple by adding:
Other Linux architecture had already supported aux reading, nothing changed in
*_linux
.FreeBSD has not support riscv as Tier 1 platform, nothing changed in freebsd/riscv64.
p.s. In CL 508676, Mills wants a proposal for riscv64 vector extension detection.
Related #61416
The text was updated successfully, but these errors were encountered: