Similar to the wbinvd instruction, except this
one does not invalidate caches. Ring 0 only.
The encoding matches a wbinvd instruction with
an F3 prefix.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Can you add a disassembler test as well?
lib/Support/Host.cpp | ||
---|---|---|
1222 ↗ | (On Diff #136063) | Can you line up the '=' in the clzero line above? This way it's consistent with the HasExtLeaf1 and HasLeaf7 code where everything is nicely lined up. |
lib/Target/X86/X86.td | ||
751 ↗ | (On Diff #136063) | Isn't this instruction only on icelake server? Not icelake desktop/mobile. We may need to separate a icelake server like we do skylake and skylake-avx512. |
Removed wbinvd related code.
Added Ice Lake Server architecture.
Added disassembly tests.
LGTM other than that one comment.
include/llvm/IR/IntrinsicsX86.td | ||
---|---|---|
6426 ↗ | (On Diff #136508) | This comment is misleading. WBNOINVD writes back the entire cache hierarchy not just a cache line. |
lib/Target/X86/X86InstrSystem.td | ||
---|---|---|
488 ↗ | (On Diff #141902) | Do you know if 0xf3 0x0f 0x09 behaves as wbinvd on older processors. Or was 0xf3 0x0f 0x09 a #UD fault on previous CPUs? Wondering whether WBINVD should have TB or PS. I'm guess since wbinvd is super old the prefixes have always been ignored, but I'm not sure. |
lib/Target/X86/X86InstrSystem.td | ||
---|---|---|
488 ↗ | (On Diff #141902) | Well, the ISA says about the REP prefix: So, one should not use the 0xf3 prefix with winvd. On the other hand, this still doesn't tell us whether it would be #UD on older CPUs, or ignored. Since the disassembler I think doesn't use flags like -mwbnoinvd, I guess we can modify wbinvd's description to mention PS. |
Based on the discussion here https://patchwork.kernel.org/patch/10175159/ I think 0xf3 + wbinvd was previously equivalent to wbinvd so I think TB was correct.
Changing it from TB to PS will affect the behavior of 0xf2 0x0f 0x09 and 0x66 0x0f 0x09. Which I think we still want to disassemble to just wbinvd.