This file contains 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
These commands are based on a askubuntu answer http://askubuntu.com/a/581497 and https://askubuntu.com/questions/26498/choose-gcc-and-g-version | |
To install gcc-7 (gcc-7.2.0), I had to do more stuff as shown below. | |
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
ABSOLUTELY NO WARRANTY. | |
If you are still reading let's carry on with the code. | |
sudo apt-get update && \ | |
sudo apt-get install build-essential software-properties-common -y && \ | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
This file contains 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
static const __m128i zero = {0}; | |
inline bool compare128(__m128i a, __m128i b) { | |
__m128i c = _mm_xor_si128(a, b); | |
return _mm_testc_si128(zero, c); | |
} |
This file contains 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
// Sample file using the Google C++ coding standard. | |
// | |
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml | |
// | |
// General rules: | |
// - Indents are two spaces. No tabs should be used anywhere. | |
// - Each line must be at most 80 characters long. | |
// - Comments can be // or /* but // is most commonly used. | |
// - File names should be lower_case.c or lower-case.c | |
// |