public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* other/8048: xmmintrin.h typos
@ 2002-09-25 15:26 iano
  0 siblings, 0 replies; 2+ messages in thread
From: iano @ 2002-09-25 15:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8048
>Category:       other
>Synopsis:       xmmintrin.h typos
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 25 15:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Ian Ollmann
>Release:        gcc version 3.3 20020925 (experimental)
>Organization:
>Environment:
Red Hat Linux 7.3 (P4/2530)
>Description:
There are several problems with xmmintrin.h in the new SSE2 section:

1) The type for __B should be double*

static __inline __m128d
_mm_loadh_pd (__m128d __A, __m128d *__B)
{
  return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, (__v2si *)__B);
}

static __inline void
_mm_storeh_pd (__m128d *__A, __m128d __B)
{
  __builtin_ia32_storehpd ((__v2si *)__A, (__v2df)__B);
}

static __inline __m128d
_mm_loadl_pd (__m128d __A, __m128d *__B)
{
  return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, (__v2si *)__B);
}

static __inline void
_mm_storel_pd (__m128d *__A, __m128d __B)
{
  __builtin_ia32_storelpd ((__v2si *)__A, (__v2df)__B);
}


2) The last C should be __C:

#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (C)))


3) Writing all of these as inline functions makes it *really* hard to debug using a source level debugger such as ddd. The reason is that stepping through the code jumps from the internals of inline function to inline function. It all works much better if these are #defines. May I suggest that you do things like this:

#if defined (USE_SSE_MACROS )
   #define _mm_load_ps( ptr )  (__m128) __builtin_ia32_loadaps(ptr)
#else
static __inline __m128
_mm_load_ps (float *__P)
{
  return (__m128) __builtin_ia32_loadaps (__P);
}
#endif

This lets people pass -DUSE_SSE_MACROS for facile debugging, and for those cases where gcc (for whatever reason) doesn't inline the function.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: other/8048: xmmintrin.h typos
@ 2002-10-17  8:46 hubicka
  0 siblings, 0 replies; 2+ messages in thread
From: hubicka @ 2002-10-17  8:46 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, iano, nobody

Synopsis: xmmintrin.h typos

State-Changed-From-To: open->closed
State-Changed-By: hubicka
State-Changed-When: Thu Oct 17 08:46:56 2002
State-Changed-Why:
    Fixed by my patch.  Thanks for checking SSE support.  This is badly needed. Zdenek is going to investigate the other missing builtins, I will check the alignment

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8048


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

end of thread, other threads:[~2002-10-17 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-25 15:26 other/8048: xmmintrin.h typos iano
2002-10-17  8:46 hubicka

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).