1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-25 08:37:38 +01:00
libunwind-eh_elf/tests/ppc64-test-altivec-utils.c
Jose Flavio Aguilar Paulino b33021e4b2 Add PPC64 support.
2007-08-02 09:59:43 -06:00

32 lines
617 B
C

#include <stdio.h>
#include <altivec.h>
union si_overlay
{
vector signed int v;
int ints[4];
};
vector signed int
vec_init ()
{
vector signed int v;
static int count = 1;
((union si_overlay *) &v)->ints[0] = count++;
((union si_overlay *) &v)->ints[1] = count++;
((union si_overlay *) &v)->ints[2] = count++;
((union si_overlay *) &v)->ints[3] = count++;
return v;
}
void
vec_print (vector signed int v)
{
printf ("%08x %08x %08x %08x",
((union si_overlay *) &v)->ints[0],
((union si_overlay *) &v)->ints[1],
((union si_overlay *) &v)->ints[2],
((union si_overlay *) &v)->ints[3]);
}