[X86] Enable EVEX GFNI instructions without avx512bw.
authorCraig Topper <craig.topper@sifive.com>
Mon, 31 Oct 2022 17:04:36 +0000 (10:04 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 31 Oct 2022 17:31:45 +0000 (10:31 -0700)
commit06f640d3fb060e2e9cfed1d7c44636c7ffe3308b
treed81e3708a009290ce2a516453746c13cf5009c67
parentcc2e8e5075615ccad7d050a52937acec8c9ef93a
[X86] Enable EVEX GFNI instructions without avx512bw.

We only really need avx512bw for masking 256 or 512 bit GFNI
instructions due to the need for v32i1 or v64i1.

I wanted to enable 128-bit intrinsics with avx512vl, but the
__builtin_ia32_selectb_128 used in the header file requires avx512bw.
The codegen test for the same is also not using a masked instruction
because vselect with v16i1 mask and v16i8 is not legal so is expanded
before isel. To fix these issues we need a mask specific builtin and a
mask specific ISD opcode.

Fixes PR58687.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D137036
clang/include/clang/Basic/BuiltinsX86.def
clang/lib/Headers/gfniintrin.h
clang/test/CodeGen/X86/gfni-builtins.c
llvm/lib/Target/X86/X86InstrAVX512.td
llvm/lib/Target/X86/X86InstrSSE.td
llvm/test/CodeGen/X86/avx512-gfni-intrinsics.ll