对strcpy优化的一个核心要点

以前看到的哪篇博文里面提到过,后来没找到
#include <stdio.h>

int main(int argc, char *argv[])
{
    unsigned long num = 0x0F0F0F00;
    unsigned long sum = num + 0x7EFEFEFF;
    unsigned long un = 0xFFFFFFFF ^ num;
    unsigned long xor = un ^ sum;
    unsigned long test = xor & 0x81010100;
    printf("num  = 0x%08X\nsum  = 0x%08X\nun   = 0x%08X\nxor  = 0x%08X\ntest = 0x%08X\n",
        num, sum, un, xor, test);
    return 0;
}

你可能感兴趣的:(优化)