public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/12902] Invalid assembly generated when using SSE / xmmintrin.h Date: Mon, 13 Dec 2004 20:54:00 -0000 [thread overview] Message-ID: <20041213205416.12484.qmail@sourceware.org> (raw) In-Reply-To: <20031105013127.12902.kbowers@lanl.gov> ------- Additional Comments From bangerth at dealii dot org 2004-12-13 20:54 ------- I really have not much of an idea what I am doing here, but this is a shorter testcase: ------------------------- #include <xmmintrin.h> typedef struct { int i; float f[3]; } a_t; typedef struct { float f[8]; } b_t; typedef union { int i[4]; float f[4]; __m128 v; } vector4; void swizzle( const void *a0, const void *a1, const void *a2, const void *a3, vector4 *a, vector4 *b, vector4 *c, vector4 *d ) { __m128 t, u; a->v = _mm_loadl_pi(a->v, (__m64 *)a0); c->v = _mm_loadl_pi(c->v,((__m64 *)a0)+1); a->v = _mm_loadh_pi(a->v, (__m64 *)a1); c->v = _mm_loadh_pi(c->v,((__m64 *)a1)+1); t = _mm_loadl_pi(b->v, (__m64 *)a2); u = _mm_loadl_pi(d->v,((__m64 *)a2)+1); a->v = _mm_shuffle_ps(a->v,t,0); b->v = _mm_shuffle_ps(b->v,t,0); c->v = _mm_shuffle_ps(c->v,u,0); d->v = _mm_shuffle_ps(d->v,u,0); } int main () { a_t a[128]; b_t b[128]; vector4 ai, a0, a1, a2, b0, v0, v1, v2; __m128 *p0, *p1, *p2, *p3; int n = 1; for(;n;n--) { swizzle(a,a+1,a+2,a+3,&ai,&a0,&a1,&a2); p0 = (__m128 *)(b + ai.i[0]); p1 = (__m128 *)(b + ai.i[1]); p2 = (__m128 *)(b + ai.i[2]); p3 = (__m128 *)(b + ai.i[3]); swizzle(p0++,p1++,p2++,p3++,&b0,&v0,&v1,&v2); _mm_add_ps(_mm_add_ps(b0.v,_mm_mul_ps(a1.v,v0.v)), _mm_mul_ps(a2.v,_mm_add_ps(v1.v,_mm_mul_ps(a1.v,v2.v)))); } } ----------------------------- It fails on 3.4 and mainline, but not with icc: g/x> /home/bangerth/bin/gcc-3.4.*-pre/bin/g++ -O -msse2 -g x.cc ; ./a.out Segmentation fault g/x> /home/bangerth/bin/gcc-4.*-pre/bin/g++ -O -msse2 -g x.cc ; ./a.out Segmentation fault g/x> icc x.cc ; ./a.out On mainline, I get this from a gdb session: (gdb) r Starting program: /home/bangerth/tmp/g/x/a.out Program received signal SIGSEGV, Segmentation fault. swizzle (a0=0xbfffe250, a1=0xbfffe260, a2=0xbfffe270, a3=0xbfffe280, a=0xbfffeac0, b=0xbfffeab0, c=0xbfffeaa0, d=0xbfffea90) at x.cc:23 (gdb) i reg [...] eip 0x80483ba 0x80483ba (gdb) disass 0x080483ba <_Z7swizzlePKvS0_S0_S0_P7vector4S2_S2_S2_+38>: movaps 0x8 (%esi),%xmm0 As I said, I have no idea what this program does, and if it is wellformed after my attempts to reduce it at all. Maybe it helps anyway. W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12902
next prev parent reply other threads:[~2004-12-13 20:54 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-11-05 1:31 [Bug c++/12902] New: " kbowers at lanl dot gov 2003-11-05 4:08 ` [Bug c++/12902] " pinskia at gcc dot gnu dot org 2003-11-05 5:51 ` kbowers at lanl dot gov 2003-11-06 18:53 ` kbowers at lanl dot gov 2003-11-07 1:02 ` kbowers at lanl dot gov 2003-11-07 10:42 ` kbowers at lanl dot gov 2003-12-09 18:01 ` kbowers at lanl dot gov 2003-12-09 20:14 ` [Bug target/12902] " dhazeghi at yahoo dot com 2003-12-09 20:17 ` dhazeghi at yahoo dot com 2003-12-11 16:07 ` bangerth at dealii dot org 2004-12-13 20:54 ` bangerth at dealii dot org [this message] 2004-12-14 10:54 ` uros at kss-loka dot si 2005-01-05 9:43 ` [Bug target/12902] [4.0 Regression] " uros at kss-loka dot si 2005-01-05 12:14 ` rth at gcc dot gnu dot org 2005-01-05 19:14 ` cvs-commit at gcc dot gnu dot org 2005-01-05 20:04 ` rth at gcc dot gnu dot org 2005-01-06 8:25 ` uros at kss-loka dot si
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20041213205416.12484.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).