File: cpuid.asm

package info (click to toggle)
darktable 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 65,660 kB
  • sloc: ansic: 367,579; cpp: 102,778; xml: 20,091; lisp: 15,099; sh: 3,771; javascript: 3,264; perl: 1,925; python: 1,551; ruby: 975; makefile: 543; asm: 46; sql: 38; awk: 21
file content (67 lines) | stat: -rw-r--r-- 1,705 bytes parent folder | download | duplicates (11)
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
62
63
64
65
66
67
;  This file is part of darktable,
;    copyright (c) 2009--2010 henrik andersson.
;
;   darktable is free software: you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation, either version 3 of the License, or
;    (at your option) any later version.
;
;    darktable is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.
;
;    You should have received a copy of the GNU General Public License
;    along with darktable.  If not, see <http://www.gnu.org/licenses/>.
		
			extern printf
			section .data
sse_text:		db "SSE",0
sse2_text:		db "SSE2",0
sse3_text:		db "SSE3",0
ssse3_text:	db "SSSE3",0
sse4_1_text:	db "SSE4.1",0
sse4_2_text:	db "SSE4.2",0
		
			section .text
			global main
main:
			mov eax, 1			; Call cpuid with function number 1
			cpuid
			push ebp				; setup stackframe for _printf call
			mov ebp, esp
			
			bt edx,20				; test sse4_2
			push sse4_2_text
			je print
			bt edx,19				; test sse4_1
			push sse4_1_text
			je print
			bt ecx,9				; test ssse3
			push ssse3_text
			je print
			bt ecx,0				; test sse3
			push sse3_text
			je print
			bt edx,26				; test sse2
			push sse2_text
			je print
			bt edx,25				; test sse
			push sse_text
			je print
noflags:
			mov esp, ebp			; cleanout stackframe
			pop ebp
			mov eax, 1			; return 1
			jmp quit
print:
			call printf
			add esp, 4			; pop stack 4 bytes
			mov esp, ebp			; cleanout stackframe
			pop ebp
			mov eax, 0			; return 0
quit:
			ret