[X86] Simplify vpternlog immediate selection.
authorCraig Topper <craig.topper@intel.com>
Sat, 1 Aug 2020 00:07:20 +0000 (17:07 -0700)
committerCraig Topper <craig.topper@intel.com>
Sat, 1 Aug 2020 00:16:27 +0000 (17:16 -0700)
commit93c678a79b0a8914954d77973593ea36706db5d5
tree3cf4f0d5a291f7ba75696c902e42deee1765f2b1
parent1b35c4fed29d6136ce241a692ce0a7165e59bf81
[X86] Simplify vpternlog immediate selection.

Rather than hardcoding immediate values for 12 different combinations
in a nested pair of switches, we can perform the matched logic
operation on 3 magic constants to calculate the immediate.

Special thanks to this tweet https://twitter.com/rygorous/status/1187034321992871936
for making me realize I could do this.
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp