test-ovf.c (544B)
1#include <unistd.h> 2 3static long test_subqv (long a, long b) 4{ 5 long res; 6 7 asm ("subq/v %1,%2,%0" 8 : "=r" (res) : "r" (a), "r" (b)); 9 return res; 10} 11static struct { 12 long (*func)(long, long); 13 long a; 14 long b; 15 long r; 16} vectors[] = 17 { 18 {test_subqv, 0, 0x7d54000, 0xfffffffff82ac000L} 19 }; 20 21int main (void) 22{ 23 int i; 24 25 for (i = 0; i < sizeof (vectors)/sizeof(vectors[0]); i++) 26 if ((*vectors[i].func)(vectors[i].a, vectors[i].b) != vectors[i].r) { 27 write(1, "Failed\n", 7); 28 } 29 write(1, "OK\n", 3); 30 return 0; 31}