3 ms·
Testing if a value is in one of two sets reminds me of this article: http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaax.htm http://www.hugi.scene.or
by userbinator 11y ago
Testing if a value is in one of two sets reminds me of this article:
http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaax.htm http://www.hugi.scene.org/online/coding/hugi%2017%20-%20coaa...
Depending on whether the sets line up, this can be done in 2(!) instructions totaling to 4 bytes, and around 25 clock cycles. Nowhere near as fast as the bit-table lookup approach, but possibly the smallest.