c++ - How do I pass an immediate 4 bit value to the last argument of _mm256_blend_pd -



c++ - How do I pass an immediate 4 bit value to the last argument of _mm256_blend_pd -

i'm trying utilize _mm256_blend_pd, maintain encountering compiler error. in case, error gcc wants "the lastly argument must 4-bit immediate". can pass in hard coded value, calculated value produces error.

here contrived , useless programme demonstrates error. run error gcc 4.6.3 , gcc 4.8.3.

#include <immintrin.h> #include <stdlib.h> int main() { __m256d zerohit = {0}; int j=rand()%3; int imm=(0x01); // line compile _mm256_store_pd(0,_mm256_blend_pd(zerohit,*reinterpret_cast<__m256d*>(0),imm&0x0f)); imm=(0x01 & (j!=0)); // line produce error _mm256_store_pd(0,_mm256_blend_pd(zerohit,*reinterpret_cast<__m256d*>(0),imm&0x0f)); homecoming 0; }

it's called "immediate" reason. needs compile time constant. – mysticial

c++ gcc avx

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -