This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch (x86 SSE2): wrong code for movhlps
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: dalej at apple dot com (Dale Johannesen)
- Cc: gcc-patches at gcc dot gnu dot org (gcc-patches), dalej at apple dot com (Dale Johannesen)
- Date: Fri, 2 Dec 2005 18:50:41 -0500 (EST)
- Subject: Re: Patch (x86 SSE2): wrong code for movhlps
> /* { dg-do run { target i?86-*-* x86_64-*-* } } */
> /* { dg-options "-O2 -msse2" } */
> #include <xmmintrin.h>
> extern void abort();
> int untrue = 0;
> void foo (__v4sf, __v4sf) __attribute__((noinline));
> void foo (__v4sf a, __v4sf b) {
> float * fp = (float *)&b;
Aren't you violating C aliasing rules here?
I would use an union like all other vector tests do.
> if (fp[0] != 7.0 || fp[1] != 8.0 || fp[2] != 3.0 || fp[3] != 4.0)
> abort();
Thanks,
Andrew Pinski