Hi, Am Mittwoch, 21. Dezember 2022, 17:37:07 CET schrieb Dirk Müller:
Hi Bruno,
Am Mi., 21. Dez. 2022 um 17:01 Uhr schrieb Bruno Pitrus <brunopitrus@hotmail.com>:
Hwcaps wastes disk space for a niche use case (moving an installation frequently between machines with different CPUs)
only for the case where you want the performance increase of going with a newer microarchitecture, for the libraries that you select to install, and where the recompiled library is actually worth it.
The question is what's more niche, moving installations or hwcaps being worth it? I think we might end up needing both hwcaps libs + -vX specific packages. Fortunately there's overlap between building packages for hwcaps and arch-level specific packages, so we can experiment around. Dirk is doing tests beyond just libraries as well.
and IIRC is currently broken bc glibc and GCC have different ideas of what a given microarch corresponds to.
A fix for that has been submitted by Fabian as far as I know.
The main divergence was missing BMI(2) in glibc, which is fixed in master meanwhile (2.37+, not in TW yet). I thought that OSXSAVE was also missing, but that's actually already checked, just implicitly in a different place.
the right way to do this is what glibc does with i586/i686.
Are you referring to IFUNCs? e.g. per function differently compiled code that by runtime resolves to a different implementation? Otherwise, please elaborate?
While custom IFUNCs are a nicer solution, it also requires either a compiler that can automatically produce it (afaik no open source implementation exists) or a lot of manual implementation to get upstream. It can still be mixed with this approach.
There's the target_clones attribute which handles clones and dispatching automatically. It's supported by GCC as well as Clang: __attribute__((target_clones("default", "avx", "avx512f"))) float sum(float a[], int c) { float ret = 0; for(int i = 0; i < c; ++i) ret += a[i]; return ret; } (for best results build with -ffast-math) Cheers, Fabian
Greetings, Dirk