1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 12:03:41 +01:00
libunwind-eh_elf/tests/ppc64-test-altivec-utils.c

33 lines
617 B
C
Raw Normal View History

2007-08-02 17:59:43 +02:00
#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]);
}