10 #include <sys/resource.h>
12 #define panic(args...) { fprintf (stderr, args); abort(); }
14 extern vector signed int vec_init ();
15 extern void vec_print (vector signed int v);
17 vector signed int vec_stack (int count);
22 printf ("&vec_stack = %016lx\n", (unsigned long) vec_stack);
31 register vector signed int v1;
32 register vector signed int v2;
33 register vector signed int v3;
34 register vector signed int v4;
35 register vector signed int v5;
36 register vector signed int v6;
37 register vector signed int v7;
38 register vector signed int v8;
39 register vector signed int v9;
49 /* if (count == 0) return vec_init(); */
54 if (unw_init_local (&cursor, &uc) < 0)
56 panic ("unw_init_local failed!\n");
62 if ((ret = unw_get_reg (&cursor, UNW_REG_IP, &ip)) < 0)
64 panic ("FAILURE: unw_get_reg returned %d for UNW_REG_IP\n",
67 if ((ret = unw_get_reg (&cursor, UNW_REG_SP, &sp)) < 0)
69 panic ("FAILURE: unw_get_reg returned %d for UNW_REG_SP\n",
72 if ((ret = unw_get_fpreg (&cursor, UNW_PPC64_V30, &vr)) < 0)
75 ("FAILURE: unw_get_vreg returned %d for UNW_PPC64_V30\n",
82 const char *regname = unw_regname (UNW_PPC64_V30);
83 char proc_name_buffer[256];
85 unsigned int * vec_half1, * vec_half2;
86 vec_half1 = (unsigned int *)&vr;
87 vec_half2 = vec_half1 + 1;
88 printf ("ip = %016lx, sp=%016lx\n", (long) ip, (long) sp);
89 printf ("vr30 = %08x %08x %08x %08x\n",
90 (unsigned int) (*vec_half1 >> 16),
91 (unsigned int) (*vec_half1 & 0xffffffff),
92 (unsigned int) (*vec_half2 >> 16),
93 (unsigned int) (*vec_half2 & 0xffffffff));
95 unw_get_proc_name (&cursor, proc_name_buffer,
96 sizeof (proc_name_buffer), &offset);
99 printf ("proc name = %s, offset = %lx\n",
100 proc_name_buffer, offset);
104 panic ("unw_get_proc_name returned %d\n", ret);
106 printf ("unw_regname(UNW_PPC_V30) = %s\n\n", regname);
109 ret = unw_step (&cursor);
112 unw_get_reg (&cursor, UNW_REG_IP, &ip);
113 panic ("FAILURE: unw_step() returned %d for ip=%lx\n", ret,
128 /* make use of all of the registers in some calculation */
130 vec_nor (v1, vec_add (v2, vec_sub (v3, vec_and (v4, vec_or (v5, v6)))));
133 * "force" the registers to be non-volatile by making a call and also
134 * using the registers after the call.
136 v8 = vec_stack (count - 1);
139 * Use the result from the previous call, plus all of the non-volatile
140 * registers in another calculation.
146 vec_and (v4, vec_or (v5, vec_xor (v6, v8))))));