]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/pixops/have_mmx.S
0ae7f199e5eb4ab87ef170d2de47da508fcdbcac
[~andy/gtk] / gdk-pixbuf / pixops / have_mmx.S
1         .file   "have_mmx.S"
2         .version        "01.01"
3 gcc2_compiled.:
4 .text
5         .align 16
6
7 #if !defined(__MINGW32__) && !defined(__CYGWIN__)       
8
9 /* Magic indicating no need for an executable stack */
10 #if !defined __powerpc64__ && !defined __ia64__
11 .section .note.GNU-stack;  .previous
12 #endif
13         
14 .globl _pixops_have_mmx
15         .type    _pixops_have_mmx,@function
16 _pixops_have_mmx:
17
18 #else
19
20 .globl __pixops_have_mmx
21 __pixops_have_mmx:
22
23 #endif
24         
25         push    %ebx
26
27 # Check if bit 21 in flags word is writeable
28
29         pushfl  
30         popl    %eax
31         movl    %eax,%ebx
32         xorl    $0x00200000, %eax
33         pushl   %eax
34         popfl
35         pushfl
36         popl    %eax
37
38         cmpl    %eax, %ebx
39
40         je .notfound
41
42 # OK, we have CPUID
43
44         movl    $1, %eax
45         cpuid
46         
47         test    $0x00800000, %edx
48         jz      .notfound
49
50         movl    $1, %eax
51         jmp     .out
52
53 .notfound:
54         movl    $0, %eax
55 .out:   
56         popl    %ebx
57         ret
58