我正在尝试使HADDPS
指令起作用,但似乎无法__256
在此代码中声明。
#include <xmmintrin.h>
#include <emmintrin.h>
#include <pmmintrin.h>
#include <stdio.h>
#include <stdint.h>
#include <iostream>
__m256 HADDPS(__m256 __X, __m256 __Y)
{
return _mm256_hadd_ps (__X, __Y);
}
int main()
{
//horizontal add packed single-------------------------------------------------
__m256 HADDPSA = _mm_set_ps(4.0f, 3.0f, 2.0f, 1.0f);
__m256 HADDPSB = _mm_set_ps(4.0f, 3.0f, 2.0f, 1.0f);
__m256 HADDPSR = HADDPS(HADDPSA, HADDPSB);
return 0;
}
我将 g++ 与-msse -msse2 -msse3 -msse4
.
这是错误。
HADDPS.cpp|8|error: '__m256' does not name a type|
HADDPS.cpp||In function 'int main()':|
HADDPS.cpp|15|error: '__m256' was not declared in this scope|
HADDPS.cpp|15|error: expected ';' before 'HADDPSA'|
HADDPS.cpp|16|error: expected ';' before 'HADDPSB'|
HADDPS.cpp|17|error: expected ';' before 'HADDPSR'|