Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

_mm_clmulepi64_si128

projection
Beginner
1,980 Views
hi, I am trying to use the carry-less multiplication instruction but I am running into errors that I was unable to resolve.

the cpu i am using is Intel Xeon CPU E31270.

the code I am trying to run is the one found on page 22 of the white paper: Intel Carry-Less Multiplication Instruction and its Usage for Computing the GCM Mode.

the errors I am getting is:

j.cpp:12:7: error: request for member m128i_i64 in a, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:13:7: error: request for member m128i_i64 in a, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:14:7: error: request for member m128i_i64 in b, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:15:7: error: request for member m128i_i64 in b, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:21:27: error: request for member m128i_i64 in a, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:21:44: error: request for member m128i_i64 in b, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:22:27: error: request for member m128i_i64 in a, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:22:44: error: request for member m128i_i64 in b, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:23:27: error: request for member m128i_i64 in a, which is of non-class type __m128i {aka__vector(2) long long int}
j.cpp:23:44: error: request for member m128i_i64 in b, which is of non-class type __m128i {aka__vector(2) long long int}


this error is the one that really is giving me trouble.
j.cpp:25:60: error: _mm_clmulepi64_si128 was not declared in this scope



0 Kudos
3 Replies
Thomas_W_Intel
Employee
1,980 Views

Please excuse if I'm asking the obvious: Are you including wmmintrin.h? Which compiler are you using and are you using the apropriate options to generate AESni?

0 Kudos
projection
Beginner
1,980 Views
yes, i am including the header. the compiler i am using is g++ and the options are -maes -msse4.
0 Kudos
Thomas_W_Intel
Employee
1,980 Views
Please note that there is a separate option -mpclmul. Have you tried this one?

Since your system supports AVX, it is highly recommended that you use -mavx, which includes pclmul.
0 Kudos
Reply