FreeBSD: add file descriptor tracking for _umtx_op
[valgrind.git] / none / tests / s390x / bic.c
blobc7d7412307d0219017672bb29fa45196b013844d
1 #include <stdio.h>
3 #define HEAD "agfi %[i], -8\n" \
4 "jl 1f\n" \
5 "larl %[table], 6f\n" \
6 "sllg %[i], %[i], 3(0)\n" \
7 "clgfi %[i], 4*8\n"
9 #define TAIL "0: lghi %[i], 200\n" \
10 "j 7f\n" \
11 "1: lghi %[i], 100\n" \
12 "j 7f\n" \
13 "2: lghi %[i], 111\n" \
14 "j 7f\n" \
15 "3: lghi %[i], 122\n" \
16 "j 7f\n" \
17 "4: lghi %[i], 133\n" \
18 "j 7f\n" \
19 "5: lghi %[i], 144\n" \
20 "j 7f\n" \
21 "6:\n" \
22 ".quad 2b\n" \
23 ".quad 3b\n" \
24 ".quad 4b\n" \
25 ".quad 5b\n" \
26 ".quad 5b\n" \
27 "7:\n"
29 static long bic0(long i)
31 void *table;
32 asm volatile(HEAD
33 "brcl 10, 0f\n"
34 ".insn rxy, 0xe30000000047, 0, 8(%[i],%[table])\n"
35 "lg %[table],0(%[i],%[table])\n"
36 "br %[table]\n"
37 TAIL
38 : [i] "+a" (i)
39 , [table] "=a" (table)
40 :: "cc");
41 return i;
44 static long bic4(long i)
46 void *table;
47 asm volatile(HEAD
48 ".insn rxy, 0xe30000000047, 4, 0(%[i],%[table])\n"
49 TAIL
50 : [i] "+a" (i)
51 , [table] "=a" (table)
52 :: "cc");
53 return i;
56 static long bic15(long i)
58 void *table;
59 asm volatile(HEAD
60 "brcl 10, 0f\n"
61 ".insn rxy, 0xe30000000047, 15, 0(%[i],%[table])\n"
62 TAIL
63 : [i] "+a" (i)
64 , [table] "=a" (table)
65 :: "cc");
66 return i;
69 int main()
71 long i;
73 for (i = 0; i < 16; i++) {
74 printf("bic0: %ld -> %ld\n", i, bic0(i));
75 printf("bic4: %ld -> %ld\n", i, bic4(i));
76 printf("bic15: %ld -> %ld\n", i, bic15(i));