Re: State of AVX512 support in NetBSD?

RVP <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
On Mon, 29 Jul 2024, Thomas Klausner wrote:

> For my recent build trouble of lang/ghc98 that only I can see but pho@
> can't[1], upstream has suggested it might be a problem with AVX512
> support[2] in NetBSD. (My CPU supports AVX512, pho's doesn't.)
>
> I'll give their suggestion (using -D__STDC_NO_ATOMICS__) a try, but
> does anyone know the actual state of AVX512 support on NetBSD?
>

I don't think this is AVX-512-related. The programs would've crashed with
an `Illegal instruction' like my test progs (attached) did on OpenBSD.

I think it may due to how the *BSDs handle conversions of multi-byte
chars. in non-UTF-8 locales:

In my test program, glibc's mbstowcs(3) returns -1 when fed UTF-8 chars
and the locale is C/POSIX.

*BSDs treat the same string as a byte sequence--ie. mbstowcs() == strlen()
if LC_ALL=C/POSIX.

If, however, the locale is some UTF-8 one (say, C.UTF-8), then both Linux
and the BSDs behave the same.

Try the attached like so on NetBSD and Linux:

```
$ make clean; LC_ALL=C.UTF-8 make
$ make clean; LC_ALL=C make
```

compare the hs*.txt files on Linux and NetBSD and notice that when LC_ALL=C
_hs_text_measure_off() returns a negative number (as it says it will in the
code when the buffer is short) for LC_ALL=C.

HTH,

-RVP
hask-test.tar.bz2 (application/octet-stream, 4.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.