有时如果仅仅将属性-》c/c++->常规中的sdl改成否不能解决这个报错,这不是错误只是个警告而已,在程序开头加一句这个就好了,示例如下:
#include<stdlib.h> #include<iostream> #pragma warning (disable:4146)//加的就是这个 using namespace std; unsigned __int64 _pdep_u64(unsigned __int64 val, unsigned __int64 mask) { ?? ?unsigned __int64 res = 0; ?? ?for (unsigned __int64 bb = 1; mask; bb += bb) { ?? ??? ?if (val & bb) ?? ??? ??? ?res |= mask & -mask; ?? ??? ?mask &= mask - 1; ?? ?} ?? ?return res; } unsigned __int64 _pext_u64(unsigned __int64 val, unsigned __int64 mask) { ?? ?unsigned __int64 res = 0; ?? ?for (unsigned __int64 bb = 1; mask; bb += bb) { ?? ??? ?if (val & mask & -mask) ?? ??? ??? ?res |= bb; ?? ??? ?mask &= mask - 1; ?? ?} ?? ?return res; } int main() { ?? ?unsigned __int64 src = 30; ?? ?unsigned __int64 mask = 26; ?? ?unsigned __int64 reg = 0; ?? ?//reg = _pdep_u64(src, mask); ?? ?reg = _pext_u64(src, mask); ?? ?//reg = _pdep_u64(reg, mask); ?? ?unsigned __int64 reg1 = _pdep_u64(reg, mask); ?? ?cout << "src:" << src << endl; ?? ?cout << "reg1:" << reg1 << endl; ?? ?return 0; }
(98条消息) Intel 64/x86_64/IA-32/x86处理器 - 通用指令(9/E) - 比特位操控指令(BMI1 & BMI2)_一凡stkeke-CSDN博客_bmi2指令集
|