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
19sse_text:		db "SSE",0
20sse2_text:		db "SSE2",0
21sse3_text:		db "SSE3",0
22ssse3_text:	db "SSSE3",0
23sse4_1_text:	db "SSE4.1",0
24sse4_2_text:	db "SSE4.2",0
25
26			section .text
27			global main
28main:
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
52noflags:
53			mov esp, ebp			; cleanout stackframe
54			pop ebp
55			mov eax, 1			; return 1
56			jmp quit
57print:
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
63quit:
64			ret
65
66
67
68