This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_ia32_loadaps not available(?)
- From: Ian Lance Taylor <iant at google dot com>
- To: Thomas Zimmermann <kuhundbaer at web dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 13 Jun 2011 14:01:50 -0700
- Subject: Re: __builtin_ia32_loadaps not available(?)
- References: <1307877908.8608.8.camel@homer.springfield>
Thomas Zimmermann <kuhundbaer@web.de> writes:
> I have a question regarding SIMD built-ins.
>
> The built-in '__builtin_ia32_loadaps' is mentioned in the GCC manual,
> but seems unavailable. Code like
>
> <quote>
> int
> main(int argc, char **argv)
> {
> float __attribute__((aligned(16))) f[4] = {1, 1, 1, 1};
>
> v4sf v;
> v = __builtin_ia32_loadaps(f);
>
> exit(EXIT_SUCCESS);
> }
> </quote>
>
> results in an error message
>
> <quote>
> gcc -D_GNU_SOURCE=1 -Wall -march=core2 -m64 -mmmx -msse -msse2 -O2 -c -o
> main.o main.c
> main.c: In function âmainâ:
> main.c:13: warning: implicit declaration of function
> â__builtin_ia32_loadapsâ
> main.c:13: error: incompatible types when assigning to type âv4sfâ from
> type âintâ
> make: *** [main.o] Fehler 1
> </quote>
>
> However, the same code with the built-in '__builtin_ia32_loadups'
> works.
>
> I've seen this with GCC 4.4 and 4.6. What am I doing wrong?
I recommend using the Intel-define intrinsics from <xmmintrin.h>
instead.
The __builtin_ia32_loadaps builtin function was removed and the
documentation is out of date. The movaps instruction from memory is
easily generated using code like
#include <xmmintrin.h>
__m128
f (__m128 *p)
{
return *p;
}
This is another instance of http://gcc.gnu.org/PR20049 .
Ian