File: mmxflags_asm.S

package info (click to toggle)
smpeg 0.4.5%2Bcvs20030824-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,160 kB
  • sloc: cpp: 14,970; sh: 8,042; ansic: 2,322; asm: 544; makefile: 122
file content (61 lines) | stat: -rw-r--r-- 844 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

.section .note.GNU-stack,"",%progbits

#if defined(i386) && defined(USE_MMX)

.data
	.align 16
	.type	 flags,@object
flags: .long 0

.text
	.align 4
.globl cpu_flags
	.type	 cpu_flags,@function
cpu_flags: 
        pushfl
        popl %eax

        movl %eax,%ecx

        xorl $0x040000,%eax
        pushl %eax

        popfl
        pushfl

        popl %eax
        xorl %ecx,%eax
        jz cpu_flags.L1   # Processor is 386

        pushl %ecx
        popfl

        movl %ecx,%eax
        xorl $0x200000,%eax

        pushl %eax
        popfl
        pushfl

        popl %eax
        xorl %ecx,%eax
        je cpu_flags.L1

        pusha

        movl $1,%eax
        cpuid

        movl %edx,flags

        popa

        movl flags,%eax

cpu_flags.L1: 
        ret
.Lfe1:
	.size	 cpu_flags,.Lfe1-cpu_flags

#endif /* i386 && USE_MMX */