[X86] Add CRC32 feature.
authorTianqing Wang <tianqing.wang@intel.com>
Mon, 6 Sep 2021 05:55:17 +0000 (13:55 +0800)
committerTianqing Wang <tianqing.wang@intel.com>
Mon, 6 Sep 2021 09:24:30 +0000 (17:24 +0800)
commit12fa608af44a80de8b655a8a984cd095908e7e80
tree2684e19f9f51a0a909caff90ac78809644fe4705
parentcc9260a0fb7c42ac8a8bb87eac1e11900c25ed20
[X86] Add CRC32 feature.

d8faf03807ac implemented general-regs-only for X86 by disabling all features
with vector instructions. But the CRC32 instruction in SSE4.2 ISA, which uses
only GPRs, also becomes unavailable. This patch adds a CRC32 feature for this
instruction and allows it to be used with general-regs-only.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D105462
35 files changed:
clang/docs/ClangCommandLineReference.rst
clang/include/clang/Basic/BuiltinsX86.def
clang/include/clang/Basic/BuiltinsX86_64.def
clang/include/clang/Driver/Options.td
clang/lib/Basic/Targets/X86.cpp
clang/lib/Basic/Targets/X86.h
clang/lib/Headers/CMakeLists.txt
clang/lib/Headers/crc32intrin.h [new file with mode: 0644]
clang/lib/Headers/ia32intrin.h
clang/lib/Headers/smmintrin.h
clang/lib/Headers/x86gprintrin.h
clang/test/CodeGen/X86/x86-crc-builtins.c
clang/test/CodeGen/attr-cpuspecific.c
clang/test/CodeGen/attr-target-crc32-x86.c [new file with mode: 0644]
clang/test/CodeGen/attr-target-x86.c
clang/test/Driver/x86-mcrc32.c [new file with mode: 0644]
clang/test/Driver/x86-mgeneral-regs-only-crc32.c [new file with mode: 0644]
clang/test/Driver/x86-target-features.c
clang/test/Preprocessor/x86_target_features.c
llvm/include/llvm/Support/X86TargetParser.def
llvm/lib/Support/Host.cpp
llvm/lib/Support/X86TargetParser.cpp
llvm/lib/Target/X86/X86.td
llvm/lib/Target/X86/X86InstrFormats.td
llvm/lib/Target/X86/X86InstrInfo.td
llvm/lib/Target/X86/X86InstrSSE.td
llvm/lib/Target/X86/X86Subtarget.h
llvm/test/CodeGen/X86/crc32-intrinsics-fast-isel-x86_64.ll [moved from llvm/test/CodeGen/X86/sse42-intrinsics-fast-isel-x86_64.ll with 85% similarity]
llvm/test/CodeGen/X86/crc32-intrinsics-x86.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/crc32-intrinsics-x86_64.ll [moved from llvm/test/CodeGen/X86/sse42-intrinsics-x86_64.ll with 74% similarity]
llvm/test/CodeGen/X86/crc32-target-feature.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/function-subtarget-features.ll
llvm/test/CodeGen/X86/sse42-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/sse42-intrinsics-x86.ll
llvm/test/CodeGen/X86/stack-folding-int-sse42.ll