Created
October 22, 2015 20:14
-
-
Save antonshkurenko/635a99250463396e6281 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int a = in0[i], b = in1[i]; | |
| int cmp = a < b; //if TRUE, cmp has all bits 1, if FALSE all bits 0 | |
| // & bitwise AND | |
| // | bitwise OR | |
| // ~ flips all bits | |
| out[i] = (a&cmp) | (b&~cmp); //a when TRUE and b when FALSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment