Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
Listed below is my code. I don't know how to tanslate C++ code to SSE?

C#
int i,j;
   for ( i = 1; i < NGRAY - mlevel; i++) // t1
     {
#pragma omp parallel for
      for ( j = i + 1; j < NGRAY - mlevel + 1; j++) // t2
       {
       float Sq = H[1][i] + H[i + 1][j] + H[j + 1][255];
         if (maxSig < Sq)
            {
                t[1] = i;
                t[2] = j;
                 maxSig = Sq;
             }
       }


I think the code like:
C#
__m128 mmaxSig=_mm_set_ps1((float)0);
 for ( i = 1; i < NGRAY - mlevel; i++) // t1
    {
#pragma omp parallel for
        for ( j = i + 1; j < NGRAY - mlevel + 1; j+2) // t2
          {
            __m128 h1,h2,h3,msq;
            h3=_mm_load_pd((double *)H[j+1][255]);
            h2=_mm_load_pd((double *)H[i+1][j]);
            h1=_mm_set_ps1((double)*H[1][i]);
            msq=_mm_add_pd(h1,_mm_add_ps(h2,h3));
            __m128 mask=_mm_cmplt_pd(mmaxSig,msq);
            ......

But ,I can't go on.Anyone could help me?
Thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 18-Nov-12 12:27pm    
"I can't go on" is not informative. What's the problem, exactly?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900