0
我想知道如果Microsofts SSE intrinsics比标准有所不同,因为我尝试编译此代码与GCC与标志-msse -msse2 -msse3 -msse4
SSE内在函数编译带有GCC错误的MSDN代码?
#include <stdio.h>
#include <smmintrin.h>
int main()
{
__m128i a, b;
a.m128i_u64[0] = 0x000000000000000;
b.m128i_u64[0] = 0xFFFFFFFFFFFFFFF;
a.m128i_u64[1] = 0x000000000000000;
b.m128i_u64[1] = 0x000000000000000;
int res1 = _mm_testnzc_si128(a, b);
a.m128i_u64[0] = 0x000000000000001;
int res2 = _mm_testnzc_si128(a, b);
printf_s("First result should be 0: %d\nSecond result should be 1: %d\n",
res1, res2);
return 0;
}
,它给了我下面的错误:
sse_test_not_zero.c||In function 'main':|
sse_test_not_zero.c|8|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|9|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|9|warning: integer constant is too large for 'long' type|
sse_test_not_zero.c|11|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|12|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|16|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|20|warning: implicit declaration of function 'printf_s'|
似乎对我而言,我需要为__m128i
创建struct
,但如果其他人知道这个问题,可能会有更好的解决方案。
这是我指责微软的另一个原因。顺便说一句,他们的土地正在腐蚀。 – pandoragami
@ user2555139:对于向量,Microsoft的扩展比GNU少得多,所以您的评论有点奇怪。 –