public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25500]  New: REGREGRESSION: SSE2 vectorized code is many times slower on 4.x.x than on 3.4.4
@ 2005-12-20  5:25 yuri at tsoft dot com
  2005-12-20  5:34 ` [Bug c/25500] " yuri at tsoft dot com
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: yuri at tsoft dot com @ 2005-12-20  5:25 UTC (permalink / raw)
  To: gcc-bugs

The following testcase when compiled with 'g++ -O3 -msse3 -o testcase
testcase.C'
finishes in 0m0.277s if compiled with gcc-3.4.4 and in 0m44.843s if compiled
with gcc-4.0.2 (similar on all 4.x.x).

Yuri


-----------------------------------------------------------------------

typedef float __v2df __attribute__ ((__vector_size__ (16)));
typedef __v2df __m128;

static __inline __m128 _mm_sub_pd (__m128 __A, __m128 __B) { return
(__m128)__builtin_ia32_subps ((__v2df)__A, (__v2df)__B); }
static __inline __m128 _mm_add_pd (__m128 __A, __m128 __B) { return
(__m128)__builtin_ia32_addps ((__v2df)__A, (__v2df)__B); }
static __inline __m128 _mm_setr_ps (float __Z, float __Y, float __X, float __W)
{ return __extension__ (__m128)(__v2df){ __Z, __Y, __X, __W }; }

struct FF {
  __m128 d;

  __inline FF() { }
  __inline FF(__m128 new_d) : d(new_d) { }
  __inline FF(float f) : d(_mm_setr_ps(f, f, f, f)) { }

  __inline FF operator+(FF other) { return (FF(_mm_add_pd(d,other.d))); }
  __inline FF operator-(FF other) { return (FF(_mm_sub_pd(d,other.d))); }
};

float f[1024*1024];

int main() {
  int i;

  for (i = 0; i < 1024*1024; i++) { f[i] = 1.f/(1024*1024 + 10 - i); }

  FF total(0.f);

  for (int rpt = 0; rpt < 1000; rpt++) {
  FF p1(0.f), p2(0.), c;

  __m128 *pf = (__m128*)f;
  for (i = 0; i < 1024*1024/4; i++) {
    FF c(*pf++);

    total = total + c - p2 + p1;

    p1 = p2;
    p2 = c;
  }
  }
}


-- 
           Summary: REGREGRESSION: SSE2 vectorized code is many times slower
                    on 4.x.x than on 3.4.4
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yuri at tsoft dot com


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2006-11-20 20:29 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-20  5:25 [Bug c/25500] New: REGREGRESSION: SSE2 vectorized code is many times slower on 4.x.x than on 3.4.4 yuri at tsoft dot com
2005-12-20  5:34 ` [Bug c/25500] " yuri at tsoft dot com
2005-12-20  5:55 ` [Bug target/25500] " pinskia at gcc dot gnu dot org
2005-12-20  6:01 ` yuri at tsoft dot com
2005-12-20  6:03 ` yuri at tsoft dot com
2005-12-20  6:19 ` yuri at tsoft dot com
2005-12-20  6:33 ` pinskia at gcc dot gnu dot org
2005-12-20  6:36 ` pinskia at gcc dot gnu dot org
2005-12-20  6:51 ` yuri at tsoft dot com
2005-12-20  6:55 ` pinskia at gcc dot gnu dot org
2005-12-20  7:40 ` yuri at tsoft dot com
2005-12-25  1:02 ` [Bug target/25500] [4.0/4.1/4.2 Regression]: " pinskia at gcc dot gnu dot org
2005-12-28 16:53 ` jakub at gcc dot gnu dot org
2006-01-15 22:13 ` [Bug target/25500] [4.0/4.1/4.2 Regression]: SSE2 vectorized code is " mmitchel at gcc dot gnu dot org
2006-02-24  0:31 ` mmitchel at gcc dot gnu dot org
2006-05-25  2:38 ` [Bug target/25500] [4.0/4.1/4.2 Regression]: SSE2 vectorized code is slower on 4.x.x than previous mmitchel at gcc dot gnu dot org
2006-07-05  9:50 ` pinskia at gcc dot gnu dot org
2006-08-07  7:55 ` bonzini at gnu dot org
2006-08-07  7:59 ` bonzini at gnu dot org
2006-08-07 15:36 ` pinskia at gcc dot gnu dot org
2006-08-17  8:16 ` bonzini at gnu dot org
2006-08-18 16:16 ` bonzini at gnu dot org
2006-11-12  8:07 ` [Bug target/25500] [4.0/4.1/4.2/4.3 " pinskia at gcc dot gnu dot org
2006-11-15  0:38 ` pinskia at gcc dot gnu dot org
2006-11-20 20:29 ` pinskia at gcc dot gnu dot org
2006-11-20 20:29 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).