Subversion Repositories Open64

[/] [regression_test/] [open64/] [x86_64/] [compile/] [bug963.c] - Blame information for rev 3921

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3921 yug
//OBJ
2
static inline __attribute__((always_inline)) __attribute__((pure)) unsigned char __static_cpu_has(unsigned short bit)
3
{
4
  unsigned char flag;
5
 
6
  asm volatile("1: movb $0,%0\n"
7
        "2:\n"
8
        ".section .altinstructions,\"a\"\n"
9
        " " ".balign 8" " " "\n"
10
        " " ".quad" " " "1b\n"
11
        " " ".quad" " " "3f\n"
12
        " .word %P1\n"
13
        " .byte 2b - 1b\n"
14
        " .byte 4f - 3f\n"
15
        ".previous\n"
16
        ".section .discard,\"aw\",@progbits\n"
17
        " .byte 0xff + (4f-3f) - (2b-1b)\n"
18
        ".previous\n"
19
        ".section .altinstr_replacement,\"ax\"\n"
20
        "3: movb $1,%0\n"
21
        "4:\n"
22
        ".previous\n"
23
        : "=qm" (flag) : "i" (bit));
24
  return flag;
25
 
26
}
27
 
28
unsigned char f(void){
29
  return __static_cpu_has(24) ;
30
}
31