This is an archive of the discontinued LLVM Phabricator instance.

AMD k8 family does not support SSE4.x which are required by x86-64-v2+
ClosedPublic

Authored by serge-sans-paille on Jun 11 2021, 6:45 AM.

Details

Summary

So don't define __tune__k8__ for these micro architecture.

SSE, SSE2 and SSE3 appear in https://www.amd.com/system/files/TechDocs/25112.PDF
but not SSE4.x.

Diff Detail

Event Timeline

serge-sans-paille requested review of this revision.Jun 11 2021, 6:45 AM
serge-sans-paille created this revision.
serge-sans-paille edited the summary of this revision. (Show Details)Jun 11 2021, 6:47 AM
MaskRay accepted this revision.Jun 13 2021, 11:07 AM

Looks great!

This revision is now accepted and ready to land.Jun 13 2021, 11:07 AM

Thanks for the fast review!

Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2021, 10:18 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
RKSimon added a subscriber: RKSimon.

This leaves the question - what hardware should we align each of the CK_x86_64_v* targets with?

This leaves the question - what hardware should we align each of the CK_x86_64_v* targets with?

I'm not quite sure I get it. If I understand correctly, each CK_x86_64_v* implies a mimal set of requirements, but doesn't map to a particular hardware, right?

This change is generating warnings when building with clang:

/usr/bin/clang++ -DCLANG_ROUND_TRIP_CC1_ARGS=ON -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/Basic -I/mnt/vss/_work/1/s/clang/lib/Basic -I/mnt/vss/_work/1/s/clang/include -Itools/clang/include -Iinclude -I/mnt/vss/_work/1/s/llvm/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -fno-common -Woverloaded-virtual -Wno-nested-anon-types -g  -fno-exceptions -fno-rtti -std=c++14 -MD -MT tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/X86.cpp.o -MF tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/X86.cpp.o.d -o tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/X86.cpp.o -c /mnt/vss/_work/1/s/clang/lib/Basic/Targets/X86.cpp
/mnt/vss/_work/1/s/clang/lib/Basic/Targets/X86.cpp:396:11: error: enumeration values 'CK_x86_64_v2', 'CK_x86_64_v3', and 'CK_x86_64_v4' not handled in switch [-Werror,-Wswitch]
  switch (CPU) {

Rather than removing the cases from the switch entirely, they should still be handled without defining k8.