Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

_popcnt32 intel c++ 2022

SGold21
Beginner
1,903 Views

Hi

I am trying to compile working code with intel c++ 2022.

I get the error _popcnt32 is undefined

Previously, including <immintrin.h> was all that was needed. 

Why it is an error?

Thanks

Sorin

0 Kudos
5 Replies
DitiD_Intel
Moderator
1,769 Views

Hi,

 

Thank you for posting in Intel Communities.

 

Could you please provide us with a sample reproducer so that we can investigate your issue from our end?

 

You have mentioned that you are using C++ compiler 2022 meaning nextgen compiler on Visual Studio. In that case, can you please share the version of Visual Studio that you are using?

 

Thanks and Regards,

Ditipriya.

 

 

0 Kudos
SGold21
Beginner
1,710 Views

Cannot post all the code

 

but 

 

I include:

 

#include <immintrin.h>

 

int mCmp = _mm256_movemask_epi8(Cmp);
int NewErrors = _popcnt32(mCmp);

 

The error is the same for Visual Studio 2019 and 2022

 

(it works with Intel compiler 19.2 and Visual studio 2017).

 

0 Kudos
DitiD_Intel
Moderator
1,612 Views

Hi,

 

We are working on your issue internally and will get back to you soon.

 

Thanks and Regards,

Ditipriya.

 

0 Kudos
cw_intel
Moderator
1,537 Views

Hi,

I can't reproduce your issue with icx 2022.0.0 and VS2019 16.11.11.


// source.cpp

#include <immintrin.h>

int main()

{

int NewErrors = _popcnt32(8);

return 0;

}

And I used command " icx source.cpp " to compile the source code, it worked successfully.

Please confirm the below information on your end,

Do you use the compiler icx? And please tell us the version you used, and please tell us the visual studio version of VS 2019 you used.

Could you try the above simple code? And check if it can be compiled successfully.


Thanks


0 Kudos
cw_intel
Moderator
1,399 Views

Hi,


We haven't heard back from you for a long time so we are assuming that your issue has been fixed. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Thanks



0 Kudos
Reply