Re: AltiVec compiler


Subject: Re: AltiVec compiler
kumar@chaos.ph.utexas.edu
Date: Wed Jul 11 2001 - 22:55:49 MDT


There is no glibc support for the altivec printf,scanf,etc. format
strings. The easiest way to do this is to place a union on top of the
vector and then access the portions you are interested in printing via the
union.

union foo {
  vector bool b;
  int x[4];
}

printf ("%d %d %d %d\n",x[0], x[1], x[2], x[3]);

 
On Wed, 11 Jul 2001, Bob Jones wrote:

> Hello,
>
> Has anybody here used the altivec compilers from the rpms found at the
> altivec.org web site?
>
> The vector types seem to be recognized but printf
> only prints out the fmt of the printf statement. Based on the linker
> cross reference output it looks like it's linking with the shared library
> file /lib/libc.so.6. The rpms don't seem to have a an altivec aware
> replacement libc.a Any ideas?
>
> Example code and output follows.
>
> #include "stdio.h"
>
> int main()
> {
> vector signed int a = ( vector signed int ) ( 1, 2, 3, 4);
> vector float b = ( vector float ) ( 3.14, 9.32, 1.0, 2.0);
>
> printf("%vd\n",a);
> printf("%vf\n",b);
> }
>
> gcc-vec -fvec test1.c
>
> output from a.out
>
> %vd
> %vf
>

-- 

ignorance is bliss.



This archive was generated by hypermail 2a24 : Wed Jul 11 2001 - 22:00:32 MDT