I ran into this problem while compiling my project with Clang. I want to use the intrinsic function _m_prefetchw for that I included x86intrin.h, but for some reason my flow is not reaching the _m_prefetchw definition. I checked the x86intrin.h header file of Clang and I dont have the __PRFCHW__ defined in order to include prfchwintrin.h although I do have PREFETCHW supported by my PC (I ran coreinfo to know this).
does anyone know why __PRFCHW__ isn't defined although I have PREFETCHW supported?
code example:
#include <x86intrin.h>
int main(){
int i = 10;
_m_prefetchw(&i);
return 0;
}
After running I get the error error LNK2019: unresolved external symbol _m_prefetchw referenced in function main
I dug into my clang include header files and found this in x86intrin.h:
#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PRFCHW__)
#include <prfchwintrin.h>
#endif
And _m_prefetchw
is defined in the prfchwintrin.h file.
My processor is Intel Xeon E5-2690, Clang version is 9.0.1.