This is an archive of the discontinued LLVM Phabricator instance.

[x86] wbnoinvd intrinsic
ClosedPublic

Authored by GBuella on Feb 27 2018, 5:34 AM.

Details

Summary

The WBNOINVD instruction writes back all modified
cache lines in the processor’s internal cache to main memory
but does not invalidate (flush) the internal caches.

Diff Detail

Event Timeline

GBuella created this revision.Feb 27 2018, 5:34 AM
craig.topper added inline comments.Feb 27 2018, 10:01 AM
docs/ClangCommandLineReference.rst
2405

Did you manually add these? This file is normally generated by a tool and should be in alphabetical order.

lib/Basic/Targets/X86.cpp
157

Is this based on an old repo? Icelake features have been coded here since late December. But as I said in the llvm patch we probably can't enable this on all icelakes.

lib/Headers/ia32intrin.h
79 ↗(On Diff #136065)

Can you separate wbinvd out of this patch? This has some Microsoft compatibility issues that need to be carefully checked. We seem to already have __wbinvd() defined in intrin.h but I'm not sure it does anything.

lib/Headers/wbnoinvdintrin.h
32

Use an inline function, not a macro.

GBuella updated this revision to Diff 136510.Mar 1 2018, 6:21 AM
GBuella edited the summary of this revision. (Show Details)

Added Ice Lake Server architecture.
Removed wbinvd related code.

GBuella marked an inline comment as done.Mar 1 2018, 6:21 AM
This revision is now accepted and ready to land.Mar 1 2018, 8:35 AM
GBuella updated this revision to Diff 141904.Apr 10 2018, 1:45 PM

Rebased the patch.

GBuella edited the summary of this revision. (Show Details)Apr 10 2018, 1:48 PM
craig.topper added inline comments.Apr 10 2018, 1:57 PM
lib/Basic/Targets/X86.cpp
188

Not related to this patch, but does IcelakeServer have SGX? The adding icelake-server patch and removing sgx from skylakeserver intersected here.

GBuella added inline comments.Apr 11 2018, 4:21 AM
lib/Basic/Targets/X86.cpp
188

As far as I know both icelake-client & icelake-server has it.
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf
says:
"ENCLV - Ice Lake Server and later ; Future Tremont and later"
enclv is an SGX leaf.

This revision was automatically updated to reflect the committed changes.