File: asm-goto-lables.c

package info (click to toggle)
sparse 0.4.5~rc1-1
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie-kfreebsd
  • size: 1,752 kB
  • sloc: ansic: 27,795; perl: 237; sh: 225; makefile: 162
file content (22 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
static inline int __static_cpu_has(unsigned char bit)
{
       asm goto("1: jmp %l[t_no]\n"
                "2:\n"
                ".section .altinstructions,\"a\"\n"
                "\n"
                "1b\n"
                "0\n"         /* no replacement */
                " .byte %P0\n"         /* feature bit */
                " .byte 2b - 1b\n"     /* source len */
                " .byte 0\n"           /* replacement len */
                " .byte 0xff + 0 - (2b-1b)\n"  /* padding */
                ".previous\n"
                : : "i" (bit) : : t_no, ble);
       return 1;
t_no:
       return 0;
}
/*
 *  check-name: Asm with goto labels.
 */