0

I have the following code extract written in C,

  double* res;
  posix_memalign((void **)&res, 32, sizeof(double)*4);

  __m256 ymm0, ymm1, ymm2, ymm3;

  ymm0 = _mm256_load_pd(vector_a);
  ymm1 = _mm256_load_pd(vector_b);

  ymm2 = _mm256_mul_pd(ymm1, ymm2); 

  ymm3 = _mm256_store_pd((double*)res, ymm3); <--- problem line, 

When I compile, I get the following error message,

 error: assigning to '__m256' from incompatible type 'void'
    ymm3 = _mm256_store_pd((double*)res, ymm3);

I thought casting it to double pointer for 'res' would solve the issue but with no luck..

can anyone please help?

compiler - clang 3.4 - x86 ubuntu

lukieleetronic
  • 623
  • 7
  • 10
  • 23

1 Answers1

2

_mm256_store_pd does not return anything. Remove assignment to ymm3: _mm256_store_pd((double*)res, ymm3);

Also you don't need to cast res as it is already double*

doqtor
  • 8,414
  • 2
  • 20
  • 36