比如x=0x3,倒置后变成0xA000 0000 0000 0000
#define reverse(x) \ (x=x>>16|(0x0000ffff&x)<<16, \ x=(0xff00ff00&x)>>8|(0x00ff00ff&x)<<8, \ x=(0xf0f0f0f0&x)>>4|(0x0f0f0f0f&x)<<4, \ x=(0xcccccccc&x)>>2|(0x33333333&x)<<2, \ x=(0xaaaaaaaa&x)>>1|(0x55555555&x)<<1)
阅读(859) | 评论(0) | 转发(0) |