The KTEST instruction sets the C flag if the result of anding both operands together is all 1s. We can use this to lower (icmp eq/ne (bitcast (vXi1 X), -1)
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/CodeGen/X86/avx512-mask-op.ll | ||
---|---|---|
2839 ↗ | (On Diff #132299) | Fix the comment |
Comment Actions
Turns out KTEST doesn't actually compare with all 1s. Only KORTEST does that. KTEST sets the C flag based on the result of ANDN being 0 like ptest.
Comment Actions
Use KORTEST instead of KTEST since it has the correct flag behavior. Use KORTEST for all 0s check too. Enable usage of KORTEST on AVX512F for v16i1. KTEST v16i1 was added with AVX512DQ but AVX512F had KTEST.
test/CodeGen/X86/avx512-mask-op.ll | ||
---|---|---|
2839 ↗ | (On Diff #132731) | ktest->kortest |