[Notice] This is a work in progress patch.
This patch is to support cpu_specific() function multiversioning for the latest X86 cpu.
Meanwhile update attr-target-mv.c with missing cpu test.
Differential D111778
[WIP][X86] Update CPU_SPECIFIC list. FreddyYe on Oct 13 2021, 11:40 PM. Authored by
Details [Notice] This is a work in progress patch. This patch is to support cpu_specific() function multiversioning for the latest X86 cpu.
Diff Detail
Event TimelineComment Actions As mentioned before: I met some issues to discuss with you.
Comment Actions Supporting these types requires changes to the library so that we can check these, right? Do you have the library changes for these as well? The constants used to check for these features/etc needs to be present in the glibc library. Comment Actions Yes. It's highly related to the ProcessorFeatures I mentioned above. Does the library changes refer to the compiler-rt/cpu_model.c? I think that change depends on libgcc. For now libgcc has no strong will to update that table. Comment Actions Every feature gcc knows about should be in libgcc. The unfortunate problem now is that cpu_features2 in libgcc is an array thats size may be different with every version of gcc. Clang can’t know how big that array is without reading the libgcc.a symbol table at compile time. Without knowing the size we can’t access any bits past the first 32 bits of cpu_features2. Comment Actions libgcc entries are the ones I was concerned about. We need to make sure this list matches that one (and we don't generate checks that it does not have). @craig.topper can better clarify what needs to happen with the library lookup, but I THINK we keep a version of this in compiler-rt instead of using libgcc? Comment Actions I don't know what needs to be done for the library lookup. I'm not sure if the compiler knows whether we are linking with compiler-rt or libgcc. That information is on the linker command line not necessarily the compiler command line. Comment Actions It seems @craig.topper supported __cpu_features2 in compiler-rt revision 94ccb2acbf2c5. Anything else that we need to address before landing the patch? |