1 ;*****************************************************************************
2 ;* cpu-a.asm: x86 cpu utilities
3 ;*****************************************************************************
4 ;* Copyright (C) 2003-2013 x264 project
6 ;* Authors: Laurent Aimar <fenrir@via.ecp.fr>
7 ;* Loren Merritt <lorenm@u.washington.edu>
8 ;* Fiona Glaser <fiona@x264.com>
10 ;* This program is free software; you can redistribute it and/or modify
11 ;* it under the terms of the GNU General Public License as published by
12 ;* the Free Software Foundation; either version 2 of the License, or
13 ;* (at your option) any later version.
15 ;* This program is distributed in the hope that it will be useful,
16 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;* GNU General Public License for more details.
20 ;* You should have received a copy of the GNU General Public License
21 ;* along with this program; if not, write to the Free Software
22 ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
24 ;* This program is also available under a commercial proprietary license.
25 ;* For more information, contact us at license @ x265.com.
26 ;*****************************************************************************
32 ;-----------------------------------------------------------------------------
33 ; void cpu_cpuid( int op, int *eax, int *ebx, int *ecx, int *edx )
34 ;-----------------------------------------------------------------------------
35 cglobal cpu_cpuid, 5,7
55 ;-----------------------------------------------------------------------------
56 ; void cpu_xgetbv( int op, int *eax, int *edx )
57 ;-----------------------------------------------------------------------------
58 cglobal cpu_xgetbv, 3,7
71 ;-----------------------------------------------------------------------------
72 ; void stack_align( void (*func)(void*), void *arg );
73 ;-----------------------------------------------------------------------------
78 sub rsp, 32 ; shadow space
91 ;-----------------------------------------------------------------------------
92 ; int cpu_cpuid_test( void )
93 ; return 0 if unsupported
94 ;-----------------------------------------------------------------------------
95 cglobal cpu_cpuid_test
135 ;-----------------------------------------------------------------------------
136 ; void cpu_emms( void )
137 ;-----------------------------------------------------------------------------
142 ;-----------------------------------------------------------------------------
143 ; void cpu_sfence( void )
144 ;-----------------------------------------------------------------------------
149 cextern intel_cpu_indicator_init
151 ;-----------------------------------------------------------------------------
152 ; void safe_intel_cpu_indicator_init( void );
153 ;-----------------------------------------------------------------------------
154 cglobal safe_intel_cpu_indicator_init
175 sub rsp, 32 ; shadow space
178 call intel_cpu_indicator_init