This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
What header is needed "__vector" when using altivec support?
- From: "Ernest L. Williams Jr." <ernesto at ornl dot gov>
- To: GCC-Help <gcc-help at gcc dot gnu dot org>
- Cc: ernesto at ornl dot gov
- Date: Sat, 25 Feb 2006 19:40:20 -0500
- Subject: What header is needed "__vector" when using altivec support?
Hi,
I am trying to build altivec code using GCC and I can't get past first
base:
========================================================================
The following functions are made available by including <altivec.h> and
using -maltivec and -mabi=altivec. The functions implement the
functionality described in Motorola's AltiVec Programming Interface
Manual.
========================================================================
My code snippet looks like:
========================================================
#include <altivecLib.h>
void testFormattedIO()
{
__vector unsigned char s;
__vector signed int I;
__vector signed short SI;
__vector __pixel P;
__vector float F;
/* 8-bits per element */
s = (__vector unsigned char)
{â0â,â1â,â2â,â3â,â4â,â5â,â6â,â7â,â8â,â9â,âAâ,âBâ,âCâ,âDâ,âEâ,âFâ};
====================================================================
The header does not define "__vector". What is the deal?
Can anyone point me in the right direction?
I keep getting:
/ade/vxWorks/6.2/gnu/3.3.2-vxworks-6.2/x86-linux2/bin/ccppc -c
-D_POSIX_SOURCE -DCPU=PPC604 -DvxWorks
-include /ade/vxWorks/6.2/vxworks-6.2/target/h/vxWorks.h -ansi -O3
-Wall -mcpu=604 -mstrict-align -mlongcall -maltivec -mabi=altivec
-fno-builtin -I. -I.. -I../../../include/os/vxWorks -I../../../include
-I/ade/epics/supTop/base/R3.14.8.2/include/os/vxWorks
-I/ade/epics/supTop/base/R3.14.8.2/include
-I/ade/epics/supTop/extensions/R3.14.8.2/include/os/vxWorks
-I/ade/epics/supTop/extensions/R3.14.8.2/include
-I/ade/vxWorks/6.2/vxworks-6.2/target/h
-I/ade/vxWorks/6.2/vxworks-6.2/target/h/wrn/coreip ../altivecTest.c
../altivecTest.c: In function `testFormattedIO':
../altivecTest.c:7: error: `__vector' undeclared (first use in this
function)
Thanks,
Ernesto