~ubuntu-branches/ubuntu/intrepid/transcode/intrepid-proposed

« back to all changes in this revision

Viewing changes to aclib/memcpy.s

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2005-10-10 19:12:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051010191247-uq4j6t947df71v7m
Tags: 2:1.0.1-0.0ubuntu1
* New upstream release.
* debian/:
  + Remove 03_rescale.c and 04_average.c dpatches, applied upstream.
  + Force amd64 to link against the correct _pic libs, fixing FTBFS.
  + Disable mjpegtools support on ppc until post-Breezy (FTBFS).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
;;/*
2
 
;; *  memcpy.s
3
 
;; *
4
 
;; *  Copyright (C) Thomas �streich - November 2002
5
 
;; *
6
 
;; *  This file is part of transcode, a linux video stream processing tool
7
 
;; *
8
 
;; *  transcode 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, or (at your option)
11
 
;; *  any later version.
12
 
;; *
13
 
;; *  transcode 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 GNU Make; see the file COPYING.  If not, write to
20
 
;; *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21
 
;; *
22
 
;; */
23
 
        
24
 
bits 32
25
 
 
26
 
%macro cglobal 1 
27
 
        %ifdef PREFIX
28
 
                global _%1 
29
 
                %define %1 _%1
30
 
        %else
31
 
                global %1
32
 
        %endif
33
 
%endmacro
34
 
 
35
 
section .data
36
 
 
37
 
align 16
38
 
unused  times 4 dw 1
39
 
 
40
 
section .text
41
 
 
42
 
        ;; 
43
 
        ;; int ac_memcpy_mmx(char *dest, char *src, int bytes);
44
 
        ;;
45
 
 
46
 
cglobal  ac_memcpy_mmx
47
 
 
48
 
align 16
49
 
ac_memcpy_mmx:
50
 
 
51
 
        push ebx
52
 
        push ecx
53
 
        push edi
54
 
        push esi
55
 
 
56
 
        mov ebx, [esp+20]       ; dest
57
 
        mov eax, [esp+24]       ; src   
58
 
        mov ecx, [esp+28]       ; bytes 
59
 
 
60
 
.64entry:       
61
 
        mov esi, ecx
62
 
        shr esi, 6              ; /64
63
 
        jz .rest
64
 
        
65
 
.64loop:                
66
 
        movq mm0, [eax   ]
67
 
        movq mm1, [eax+ 8]
68
 
        movq mm2, [eax+16]
69
 
        movq mm3, [eax+24]
70
 
        movq mm4, [eax+32]
71
 
        movq mm5, [eax+40]
72
 
        movq mm6, [eax+48]
73
 
        movq mm7, [eax+56]                                              
74
 
                
75
 
        movq [ebx   ], mm0
76
 
        movq [ebx+ 8], mm1
77
 
        movq [ebx+16], mm2
78
 
        movq [ebx+24], mm3
79
 
        movq [ebx+32], mm4
80
 
        movq [ebx+40], mm5
81
 
        movq [ebx+48], mm6
82
 
        movq [ebx+56], mm7      
83
 
 
84
 
        add eax, 64
85
 
        add ebx, 64
86
 
        sub ecx, 64
87
 
        dec esi
88
 
        jg .64loop
89
 
 
90
 
.rest:
91
 
        mov esi, eax
92
 
        mov edi, ebx
93
 
        std
94
 
        rep movsb
95
 
        
96
 
.exit:          
97
 
        xor eax, eax            ; exit
98
 
 
99
 
        pop esi
100
 
        pop edi
101
 
        pop ecx
102
 
        pop ebx
103
 
        
104
 
        ret                     
105
 
 
106
 
 
107
 
        ;; 
108
 
        ;; int ac_memcpy_sse(char *dest, char *src, int bytes);
109
 
        ;;
110
 
 
111
 
cglobal  ac_memcpy_sse
112
 
 
113
 
align 16
114
 
ac_memcpy_sse:
115
 
 
116
 
        push ebx
117
 
        push ecx
118
 
        push edi
119
 
        push esi
120
 
 
121
 
        mov ebx, [esp+20]       ; dest
122
 
        mov eax, [esp+24]       ; src   
123
 
        mov ecx, [esp+28]       ; bytes 
124
 
 
125
 
.64entry:       
126
 
        mov esi, ecx
127
 
        shr esi, 6              ; /64
128
 
        jz .rest
129
 
        
130
 
.64loop:                
131
 
        prefetchnta [eax]
132
 
        prefetchnta [eax+32]            
133
 
 
134
 
        movaps xmm0, [eax   ]
135
 
        movaps xmm1, [eax+16]
136
 
        movaps xmm2, [eax+32]
137
 
        movaps xmm3, [eax+48]
138
 
 
139
 
        movntps [ebx   ], xmm0
140
 
        movntps [ebx+16], xmm1
141
 
        movntps [ebx+32], xmm2
142
 
        movntps [ebx+48], xmm3
143
 
 
144
 
        add eax, 64
145
 
        add ebx, 64
146
 
        sub ecx, 64
147
 
        dec esi
148
 
        jg .64loop
149
 
 
150
 
.rest:
151
 
        prefetchnta [eax]       
152
 
        mov esi, eax
153
 
        mov edi, ebx
154
 
        std
155
 
        rep movsb
156
 
        
157
 
.exit:          
158
 
        sfence
159
 
 
160
 
        xor eax, eax            ; exit
161
 
 
162
 
        pop esi
163
 
        pop edi
164
 
        pop ecx
165
 
        pop ebx
166
 
        
167
 
        ret                     
168
 
 
169
 
 
170
 
        ;; 
171
 
        ;; int ac_memcpy_sse2(char *dest, char *src, int bytes);
172
 
        ;;
173
 
 
174
 
cglobal  ac_memcpy_sse2
175
 
 
176
 
align 16
177
 
ac_memcpy_sse2:
178
 
 
179
 
        push ebx
180
 
        push ecx
181
 
        push edi
182
 
        push esi
183
 
 
184
 
        mov ebx, [esp+20]       ; dest
185
 
        mov eax, [esp+24]       ; src   
186
 
        mov ecx, [esp+28]       ; bytes 
187
 
 
188
 
.64entry:       
189
 
        mov esi, ecx
190
 
        shr esi, 6              ; /64
191
 
        jz .rest
192
 
        
193
 
.64loop:                
194
 
        prefetchnta [eax]
195
 
        prefetchnta [eax+32]            
196
 
 
197
 
        movdqa xmm0, [eax   ]
198
 
        movdqa xmm1, [eax+16]
199
 
        movdqa xmm2, [eax+32]
200
 
        movdqa xmm3, [eax+48]
201
 
 
202
 
        movntdq [ebx   ], xmm0
203
 
        movntdq [ebx+16], xmm1
204
 
        movntdq [ebx+32], xmm2
205
 
        movntdq [ebx+48], xmm3
206
 
 
207
 
        add eax, 64
208
 
        add ebx, 64
209
 
        sub ecx, 64
210
 
        dec esi
211
 
        jg .64loop
212
 
 
213
 
.rest:
214
 
        prefetchnta [eax]       
215
 
        mov esi, eax
216
 
        mov edi, ebx
217
 
        std
218
 
        rep movsb
219
 
        
220
 
.exit:          
221
 
        sfence
222
 
 
223
 
        xor eax, eax            ; exit
224
 
 
225
 
        pop esi
226
 
        pop edi
227
 
        pop ecx
228
 
        pop ebx
229
 
        
230
 
        ret                     
231
 
                
 
 
b'\\ No newline at end of file'