Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.

_popcnt32 intel c++ 2022

SGold21
Beginner
920 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
786 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.

 

 

SGold21
Beginner
727 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).

 

DitiD_Intel
Moderator
629 Views

Hi,

 

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

 

Thanks and Regards,

Ditipriya.

 

cw_intel
Moderator
554 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


cw_intel
Moderator
416 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



Reply