Page MenuHomePhabricator

[X86] Enable intrinsics of AVX512_BF16, which are supported for BFLOAT16 in Cooper Lake
ClosedPublic

Authored by liutianle on Apr 10 2019, 6:55 PM.

Details

Summary
  1. Enable infrastructure of AVX512_BF16, which is supported for BFLOAT16 in Cooper Lake;
  2. Enable intrinsics for VCVTNE2PS2BF16, VCVTNEPS2BF16 and DPBF16PS instructions, which are Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision.

For more details about BF16 intrinsic, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference

Diff Detail

Repository
rL LLVM

Event Timeline

liutianle created this revision.Apr 10 2019, 6:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2019, 6:55 PM
craig.topper retitled this revision from Enable intrinsics of AVX512_BF16, which are supported for BFLOAT16 in Cooper Lake to [X86] Enable intrinsics of AVX512_BF16, which are supported for BFLOAT16 in Cooper Lake.Apr 10 2019, 7:13 PM
craig.topper added reviewers: spatel, RKSimon.
RKSimon added inline comments.Apr 17 2019, 1:32 PM
lib/Headers/avx512bf16intrin.h
23 ↗(On Diff #194625)

All of these need proper doxygen based descriptions - see xmmintrin.h etc. for examples.

test/CodeGen/avx512bf16-builtins.c
9 ↗(On Diff #194625)

add ret/arg types?

liutianle updated this revision to Diff 196195.Tue, Apr 23, 1:49 AM

@RKSimon I add doxygen based descriptions in header files and return type check in test files. Please review again.

@RKSimon @craig.topper , could you please review again?

We seem to be missing test cases in test/Driver/x86-target-feature.c to test the command line options work. And test/Preprocessor/x86_target_features.c to make sure -mavx512bf16 enables avx512vl and avx512bw. Also need tests to make sure "-mavx512bf16 -mno-avx512bw" will leave bf16 disabled. Same for "-mavx512bf16 -mno-avx512vl"

lib/Basic/Targets/X86.cpp
667 ↗(On Diff #196195)

Need to also disable avx512fp16 when we disable "avx512vbmi" and "avx512vbmi2".

Need a new if to disable "avx512fp16" when "if (Name == "avx512vl" && !Enabled)"

craig.topper added inline comments.Mon, Apr 29, 4:40 PM
lib/Basic/Targets/X86.cpp
667 ↗(On Diff #196195)

That should have said avx512bf16.

liutianle updated this revision to Diff 198168.Sat, May 4, 11:57 PM
This revision is now accepted and ready to land.Sun, May 5, 10:15 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMon, May 6, 1:23 AM