http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55645



--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-11 10:03:27 
UTC ---

(In reply to comment #0)

> // possible syntax

> void compute() {

>   for (int i=0;i!=1024;++i) {

>     if likely(a[i]<b[i])  // very often

>     c[i]=a[i]+b[i];

>     else // rare

>     c[i]=a[i]-b[i];

>   }

> }



You may want to make the rare computation more expensive than that, I am not

sure there is a real speed improvement here (mask+compare+branch might take

about as long as minus+blend).



Interesting idea. First step would be to create a REDUC_TRUTH_AND_EXPR or

something like that to be able to represent _mm256_movemask_ps(mask) == 255 at

tree level.

Reply via email to