~ubuntu-branches/ubuntu/intrepid/x264/intrepid

« back to all changes in this revision

Viewing changes to common/x86/cpu-32.asm

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-05-03 01:12:18 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080503011218-3l7ra58egb7gezht
Tags: 1:0.svn20080408-0.0ubuntu1
* Merge from debian-multimedia. Remaining Ubuntu changes:
 - Maintainer field
 - Set epoch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;*****************************************************************************
 
2
;* cpu-32.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_test( void )
 
29
; return 0 if unsupported
 
30
;-----------------------------------------------------------------------------
 
31
cglobal x264_cpu_cpuid_test
 
32
    pushfd
 
33
    push    ebx
 
34
    push    ebp
 
35
    push    esi
 
36
    push    edi
 
37
    pushfd
 
38
    pop     eax
 
39
    mov     ebx, eax
 
40
    xor     eax, 0x200000
 
41
    push    eax
 
42
    popfd
 
43
    pushfd
 
44
    pop     eax
 
45
    xor     eax, ebx
 
46
    pop     edi
 
47
    pop     esi
 
48
    pop     ebp
 
49
    pop     ebx
 
50
    popfd
 
51
    ret
 
52
 
 
53
;-----------------------------------------------------------------------------
 
54
; int x264_cpu_cpuid( int op, int *eax, int *ebx, int *ecx, int *edx )
 
55
;-----------------------------------------------------------------------------
 
56
cglobal x264_cpu_cpuid, 0,6
 
57
    mov     eax,    r0m
 
58
    cpuid
 
59
    mov     esi,    r1m
 
60
    mov     [esi],  eax
 
61
    mov     esi,    r2m
 
62
    mov     [esi],  ebx
 
63
    mov     esi,    r3m
 
64
    mov     [esi],  ecx
 
65
    mov     esi,    r4m
 
66
    mov     [esi],  edx
 
67
    RET
 
68
 
 
69
;-----------------------------------------------------------------------------
 
70
; void x264_emms( void )
 
71
;-----------------------------------------------------------------------------
 
72
cglobal x264_emms
 
73
    emms
 
74
    ret
 
75
 
 
76
;-----------------------------------------------------------------------------
 
77
; void x264_stack_align( void (*func)(void*), void *arg );
 
78
;-----------------------------------------------------------------------------
 
79
cglobal x264_stack_align
 
80
    push ebp
 
81
    mov  ebp, esp
 
82
    sub  esp, 4
 
83
    and  esp, ~15
 
84
    mov  ecx, [ebp+8]
 
85
    mov  edx, [ebp+12]
 
86
    mov  [esp], edx
 
87
    call ecx
 
88
    leave
 
89
    ret
 
90