[Bug middle-end/31307] Interaction between x86_64 builtin function and inline functions causes poor code
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Apr 10 13:38:00 GMT 2007
------- Comment #6 from rguenth at gcc dot gnu dot org 2007-04-10 14:37 -------
Reduced testcase:
typedef long long __m128i __attribute__ ((__vector_size__ (16),
__may_alias__));
typedef long long __v2di __attribute__ ((__vector_size__ (16)));
typedef char __v16qi __attribute__ ((__vector_size__ (16)));
union __attribute__((aligned(16))) MY_M128
{
__m128i i;
};
struct RegFile
{
MY_M128 dst[4];
};
__inline__ __attribute__((always_inline)) static void
MEM_OPT_LOAD(MY_M128* reg, __m128i* mem)
{
reg[0].i = *mem;
}
__inline__ __attribute__((always_inline)) static void
MEM_OPT_STORE(MY_M128* reg, __m128i* mem)
{
__builtin_ia32_movntdq ((__v2di *)mem, (__v2di)reg[0].i);
}
static __inline __m128i __attribute__((__always_inline__))
_mm_adds_epu8 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B);
}
int test(unsigned char *d)
{
RegFile r;
MEM_OPT_LOAD((r.dst) , ((__m128i*) d));
r.dst[0].i = _mm_adds_epu8(r.dst[0].i, r.dst[0].i);
MEM_OPT_STORE((r.dst), (__m128i*) d);
return 0;
}
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-04-10 14:37:48
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31307
More information about the Gcc-bugs
mailing list