Useful to know. If a given problem is possible to encode as a function of three bits (eight states), then there's an efficient instruction to process it.
The naming is unfortunate, though, since TERNLOG implies ternary logic - an operation working on trits, with possible values being -1, 0, 1, instead of just 0 and 1. Instead, it's ternary in the same vein where C's
foo ? bar : baz
takes three operands, and is therefore ternary, and it performs logical operations - hence TERN-LOG.
> In a reduction, each application of the binary operator decrements the number of values by 2−1=1, but each application of the ternary operator decrements it by 3−1=2!
Ha, there's an exclamation mark there! It's not 2, it's actually 2 factorial, which i... Oh.
More comments of possible interest here,
https://news.ycombinator.com/item?id=41759112 ("AVX Bitwise ternary logic instruction busted (arnaud-carre.github.io)", 68 comments)
Useful to know. If a given problem is possible to encode as a function of three bits (eight states), then there's an efficient instruction to process it.
The naming is unfortunate, though, since TERNLOG implies ternary logic - an operation working on trits, with possible values being -1, 0, 1, instead of just 0 and 1. Instead, it's ternary in the same vein where C's
takes three operands, and is therefore ternary, and it performs logical operations - hence TERN-LOG.> In a reduction, each application of the binary operator decrements the number of values by 2−1=1, but each application of the ternary operator decrements it by 3−1=2!
Ha, there's an exclamation mark there! It's not 2, it's actually 2 factorial, which i... Oh.