xref: /illumos-gate/usr/src/tools/smatch/src/validation/asm-goto-lables.c (revision 05ede3db5e3b7d540afbccdc872c735770e82ef3)
1 static inline int __static_cpu_has(unsigned char bit)
2 {
3        asm goto("1: jmp %l[t_no]\n"
4                 "2:\n"
5                 ".section .altinstructions,\"a\"\n"
6                 "\n"
7                 "1b\n"
8                 "0\n"         /* no replacement */
9                 " .byte %P0\n"         /* feature bit */
10                 " .byte 2b - 1b\n"     /* source len */
11                 " .byte 0\n"           /* replacement len */
12                 " .byte 0xff + 0 - (2b-1b)\n"  /* padding */
13                 ".previous\n"
14                 : : "i" (bit) : : t_no, ble);
15        return 1;
16 t_no:
17        return 0;
18 }
19 /*
20  *  check-name: Asm with goto labels.
21  */
22 
23