[llvm-dev] New x86-64 micro-architecture levels

Florian Weimer via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 12 23:49:41 PDT 2020


* H. J. Lu:

> Looks good.  I like it.

Thanks.  What do you think about Level B?  Should we keep it?

> My only concerns are
>
> 1. Names like “x86-100”, “x86-101”, what features do they support?

I think we can add more diagnostic output to ld.so --help.  My patch
does not show individual CPU flags, but I agree this could be useful.
(It's not needed for the legacy HWCAP subdirectories because in general,
those are named & defined by the kernel, not by individually named CPU
feature flags.)

> 2. I have a library with AVX2 and FMA, which directory should it go?
>
> Can we pass such info to ld.so and ld.so prints out the best directory
> name?

I think this would require generating matching GNU property notes (list
the CPU features required by the binary).  Once we have that, we can add
something to binutils or indeed ld.so to analyze them and print the
recommended directory.  But I think this is something that could come
later.

We can also write a GCC header which looks at macros such as __AVX2__
and prints a #warning with the recommended directory name.  Checking for
excess flags will be tricky in this context, though, and if we miss
something, a wrong recommendation will be the result.

Thanks,
Florian



More information about the llvm-dev mailing list