Home > other >  C - m256_f32 GCC equivalent value
C - m256_f32 GCC equivalent value

Time:09-30

I have such AVX C code, compile well under Visual Studio 2010:

#include
#include

Int main () {
Float data []={0, 1, 2, 3, 4, 5, 6, 7};
__m256 ymm0=_mm256_loadu_ps (data);
//..
Float r0=ymm0. M256_f32 [0];
Float r4.=ymm0 m256_f32 [4];
STD: : cout & lt; }

But, GCC will appear the following error:

Foo. CPP: 8:18: error: request for member 'm256_f32' in 'ymm0', which is of non - class type '__m256 {aka __vector float (8)}
'Therefore foo. CPP: : error: request for member 'm256_f32' in 'ymm0', which is of non - class type '__m256 {aka __vector float (8)}
'
. I did some research, it seems that ymm0 m256_f32 is Microsoft specific instructions, used to extract from long AVX register a single floating point number. But I can use GCC/Linux to do the same thing?

CodePudding user response:

GCC index vector in C language, but can not be index in C language. You can consider a small part of the code rewritten as c.
Another option is to explicitly use the shuffle, extract and conversion function - _mm256_shuffle_pd, inner _mm256_extractf128_pd, _mm_cvtsd_f64.

CodePudding user response:

I also met the same problem, is solved, please, how to solve of,
  • Related