Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646
7594 Discussions

_mm_popcnt_u64 undefined identifier on 32bit linux icpc version 12.0.4

andy-nisbet
Beginner
336 Views
Hello,
apologies I'm sure there is a quick workaround to this regarding compiler flags or moving to a 64bit OS, Im running on 32bit ubuntu 11.04 ...

apt@apt-Precision-T1600:~/SPARSE/examples$ uname -a
Linux apt-Precision-T1600 2.6.38-13-generic-pae #56-Ubuntu SMP Tue Feb 14 14:32:30 UTC 2012 i686 i686 i386 GNU/Linux

The processor is sandybridge, whoch has pipcnt, but I get error: identifier "_mm_popcnt_u64" is undefined, when compiling some code, it is defined in an intrinsics related header that is included.


Thanks,

Andy






0 Kudos
1 Reply
SergeyKostrov
Valued Contributor II
336 Views
Quoting Andy Nisbet
...The processor is sandybridge, whoch has pipcnt, but I get error: identifier "_mm_popcnt_u64" is undefined,

[SergeyK] It is undefinedon 32-bit platforms.

when compiling some code, it is defined in an intrinsics related header that is included...

There are two versions of '_mm_popcnt_u..' intrinsic function. That is, one isfor a 32-bit platform and another one is
for a 64-bit platform. I would consider a fix like ( pseudo code ):

...
#if _LINUX32_
__int32 iValue = _mm_popcnt_u32( ... );
#endif
#if _LINUX64_
__int64 iValue = _mm_popcnt_u64( ... );
#endif
...
Reply