mips64el: Fix nan encoding probe impreciseness with ieee754=emulated

The ieee754=emulated option was added in Linux 6.11, and with Linux >=
5.16 we can get the hardware nan encoding from /proc/cpuinfo.  So we
prefer the cpuinfo report, and only use the custom probe code if cpuinfo
does not have the info (indicating an old kernel which cannot support
ieee754=emulated).
This commit is contained in:
Xi Ruoyao 2025-02-01 20:23:24 +08:00
parent 44599dcb48
commit 42e78cc389
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -86,7 +86,8 @@ int main()
}</literal> }</literal>
EOF EOF
gcc nan2008.c -o nan2008 gcc nan2008.c -o nan2008
if ./nan2008; then if ! grep -q nan_legacy /proc/cpuinfo &amp;&amp;
(grep -q nan_2008 /proc/cpuinfo || ./nan2008) then
NAN_SWITCH=--with-nan=2008 NAN_SWITCH=--with-nan=2008
fi</userinput></screen> fi</userinput></screen>
@ -226,13 +227,6 @@ fi</userinput></screen>
<xref linkend='ch-tools-chroot'/> to fail), or produce bad results <xref linkend='ch-tools-chroot'/> to fail), or produce bad results
(causing test failures building some packages, for example Glibc (causing test failures building some packages, for example Glibc
and Python).</para> and Python).</para>
<!-- TODO: If the kernel is booted with ieee754=emulated, we'll
be just using the default of the toolchain but that's not
always the best. If the host toolchain already uses an NaN
encoding different from the hardware FPU, the FPU will be
disabled and all FP instructions are emulated by the kernel.
That's obviously very slow. But I've not figured out a
method to probe. -->
</listitem> </listitem>
</varlistentry> </varlistentry>