This rarely comes up because most vselect are lowered with actually
avx512 mask instructions, but is an improvement in the rare cases.
blendv only uses the sign-bit of the control. For vpternlog to be a replacement, the control needs to be in mask form (elements either -1/0). pcmpgt is just a check for "is the control in mask form". Maybe (sext (setcc ...)) would also work but didn't see any codegen changes from it.
What is numsignbits check?
Ill use CurDAG->computeNumSignBits, if we are being correct that should prove it.
AVX512F basically means knights landing - and even though you'd have to use the zmm variant - vpternlogq is a LOT faster than vpblendvb on KNL
Could maybe see for ymm->zmm, but xmm->zmm will then req a vzeroupper, will require a stall for core to prepare zmm usage (if no zmm around), and increase license.
Also could potentially be dangerous if its SSE encoding around it.