~ubuntu-branches/ubuntu/saucy/darktable/saucy

« back to all changes in this revision

Viewing changes to cmake/modules/cpuid.asm

  • Committer: Bazaar Package Importer
  • Author(s): David Bremner
  • Date: 2011-04-14 23:42:12 UTC
  • Revision ID: james.westby@ubuntu.com-20110414234212-kuffcz5wiu18v6ra
Tags: upstream-0.8
ImportĀ upstreamĀ versionĀ 0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;  This file is part of darktable,
 
2
;    copyright (c) 2009--2010 henrik andersson.
 
3
;
 
4
;   darktable is free software: you can redistribute it and/or modify
 
5
;    it under the terms of the GNU General Public License as published by
 
6
;    the Free Software Foundation, either version 3 of the License, or
 
7
;    (at your option) any later version.
 
8
;
 
9
;    darktable is distributed in the hope that it will be useful,
 
10
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
;    GNU General Public License for more details.
 
13
;
 
14
;    You should have received a copy of the GNU General Public License
 
15
;    along with darktable.  If not, see <http://www.gnu.org/licenses/>.
 
16
                
 
17
                        extern printf
 
18
                        section .data
 
19
sse_text:               db "SSE",0
 
20
sse2_text:              db "SSE2",0
 
21
sse3_text:              db "SSE3",0
 
22
ssse3_text:     db "SSSE3",0
 
23
sse4_1_text:    db "SSE4.1",0
 
24
sse4_2_text:    db "SSE4.2",0
 
25
                
 
26
                        section .text
 
27
                        global main
 
28
main:
 
29
                        mov eax, 1                      ; Call cpuid with function number 1
 
30
                        cpuid
 
31
                        push ebp                                ; setup stackframe for _printf call
 
32
                        mov ebp, esp
 
33
                        
 
34
                        bt edx,20                               ; test sse4_2
 
35
                        push sse4_2_text
 
36
                        je print
 
37
                        bt edx,19                               ; test sse4_1
 
38
                        push sse4_1_text
 
39
                        je print
 
40
                        bt ecx,9                                ; test ssse3
 
41
                        push ssse3_text
 
42
                        je print
 
43
                        bt ecx,0                                ; test sse3
 
44
                        push sse3_text
 
45
                        je print
 
46
                        bt edx,26                               ; test sse2
 
47
                        push sse2_text
 
48
                        je print
 
49
                        bt edx,25                               ; test sse
 
50
                        push sse_text
 
51
                        je print
 
52
noflags:
 
53
                        mov esp, ebp                    ; cleanout stackframe
 
54
                        pop ebp
 
55
                        mov eax, 1                      ; return 1
 
56
                        jmp quit
 
57
print:
 
58
                        call printf
 
59
                        add esp, 4                      ; pop stack 4 bytes
 
60
                        mov esp, ebp                    ; cleanout stackframe
 
61
                        pop ebp
 
62
                        mov eax, 0                      ; return 0
 
63
quit:
 
64
                        ret
 
65
                
 
66
 
 
67