Click here to Skip to main content

wuling asked:

Open original thread
Hi all,
Listed below is my code. I don't know how to tanslate C++ code to SSE?
 
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:
__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.
Tags: C++

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).



Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid