Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
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.
Posted 18-Nov-12 5:58am
wuling8.1K
Comments
Sergey Alexandrovich Kryukov at 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)

  Print Answers RSS
0 OriginalGriff 693
1 George Jonsson 345
2 BillWoodruff 337
3 PIEBALDconsult 280
4 Sergey Alexandrovich Kryukov 244
0 Sergey Alexandrovich Kryukov 10,764
1 Maciej Los 5,474
2 OriginalGriff 5,472
3 CPallini 3,819
4 BillWoodruff 3,594


Advertise | Privacy | Mobile
Web03 | 2.8.141030.1 | Last Updated 18 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100