]> git.sesse.net Git - x264/blob - common/x86/cpu-64.asm
a1ab0cbfdbaa515f542feea1c4c8a249ea66e6aa
[x264] / common / x86 / cpu-64.asm
1 ;*****************************************************************************
2 ;* cpu-64.asm: h264 encoder library
3 ;*****************************************************************************
4 ;* Copyright (C) 2003-2008 x264 project
5 ;*
6 ;* Authors: Laurent Aimar <fenrir@via.ecp.fr>
7 ;*
8 ;* This program is free software; you can redistribute it and/or modify
9 ;* it under the terms of the GNU General Public License as published by
10 ;* the Free Software Foundation; either version 2 of the License, or
11 ;* (at your option) any later version.
12 ;*
13 ;* This program is distributed in the hope that it will be useful,
14 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ;* GNU General Public License for more details.
17 ;*
18 ;* You should have received a copy of the GNU General Public License
19 ;* along with this program; if not, write to the Free Software
20 ;* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21 ;*****************************************************************************
22
23 %include "x86inc.asm"
24
25 SECTION .text
26
27 ;-----------------------------------------------------------------------------
28 ; int x264_cpu_cpuid( int op, int *eax, int *ebx, int *ecx, int *edx )
29 ;-----------------------------------------------------------------------------
30 cglobal x264_cpu_cpuid
31     firstpush rbx
32     pushreg   rbx
33     endprolog
34
35     mov     r10,   r3
36     mov     r11,   r2
37     mov     r9,    r1
38 %ifdef WIN64
39     mov     r8,    [rsp+40+8]
40 %endif
41
42     mov     eax,   r0d
43     cpuid
44
45     mov     [r9],  eax
46     mov     [r11], ebx
47     mov     [r10], ecx
48     mov     [r8],  edx
49
50     pop     rbx
51     ret
52     endfunc
53
54 ;-----------------------------------------------------------------------------
55 ; void x264_emms( void )
56 ;-----------------------------------------------------------------------------
57 cglobal x264_emms
58     emms
59     ret
60