~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/decode_mmx.s

Tags: upstream-0.66
ImportĀ upstreamĀ versionĀ 0.66

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/       decode_MMX.s: MMX optimized synth
2
 
 
3
 
/       copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
4
 
/       see COPYING and AUTHORS files in distribution or http://mpg123.de
5
 
/       initially written by the mysterious higway (apparently)
6
 
 
7
 
/ Thomas' words about a note:
8
 
/ Initially, I found the note "this code comes under GPL" in this file.
9
 
/ After asking Michael about legal status of the MMX files, he said that he got them without any comment and thus I believe that the GPL comment was made by Michael, since he made mpg123 GPL at some time - and marked some files that way, but not all.
10
 
/ Based on that thought, I now consider this file along with the other parts of higway's MMX optimization to be licensed under LGPL 2.1 by Michael's decision.
11
 
 
12
 
.text
13
 
 
14
 
.globl synth_1to1_MMX
15
 
 
16
 
synth_1to1_MMX: 
17
 
        pushl %ebp
18
 
        pushl %edi
19
 
        pushl %esi
20
 
        pushl %ebx
21
 
        movl 24(%esp),%ecx              
22
 
        movl 28(%esp),%edi              
23
 
        movl $15,%ebx
24
 
        movl 36(%esp),%edx              
25
 
        leal (%edi,%ecx,2),%edi
26
 
        decl %ecx
27
 
        movl 32(%esp),%esi              
28
 
        movl (%edx),%eax                
29
 
        jecxz .L1
30
 
        decl %eax
31
 
        andl %ebx,%eax                  
32
 
        leal 1088(%esi),%esi                            
33
 
        movl %eax,(%edx)                
34
 
.L1:
35
 
        leal (%esi,%eax,2),%edx         
36
 
        movl %eax,%ebp                  
37
 
        incl %eax                       
38
 
        pushl 20(%esp)                  
39
 
        andl %ebx,%eax                  
40
 
        leal 544(%esi,%eax,2),%ecx      
41
 
        incl %ebx                       
42
 
        testl $1, %eax
43
 
        jnz .L2                       
44
 
        xchgl %edx,%ecx
45
 
        incl %ebp
46
 
        leal 544(%esi),%esi           
47
 
.L2: 
48
 
        pushl %edx
49
 
        pushl %ecx
50
 
        call dct64_MMX
51
 
        addl $12,%esp
52
 
        leal 1(%ebx), %ecx
53
 
        subl %ebp,%ebx                
54
 
 
55
 
        leal decwins(%ebx,%ebx,1), %edx
56
 
.L3: 
57
 
        movq  (%edx),%mm0
58
 
        pmaddwd (%esi),%mm0
59
 
        movq  8(%edx),%mm1
60
 
        pmaddwd 8(%esi),%mm1
61
 
        movq  16(%edx),%mm2
62
 
        pmaddwd 16(%esi),%mm2
63
 
        movq  24(%edx),%mm3
64
 
        pmaddwd 24(%esi),%mm3
65
 
        paddd %mm1,%mm0
66
 
        paddd %mm2,%mm0
67
 
        paddd %mm3,%mm0
68
 
        movq  %mm0,%mm1
69
 
        psrlq $32,%mm1
70
 
        paddd %mm1,%mm0
71
 
        psrad $13,%mm0
72
 
        packssdw %mm0,%mm0
73
 
        movd %mm0,%eax
74
 
        movw %ax, (%edi)
75
 
 
76
 
        leal 32(%esi),%esi
77
 
        leal 64(%edx),%edx
78
 
        leal 4(%edi),%edi                
79
 
        loop .L3
80
 
 
81
 
 
82
 
        subl $64,%esi                    
83
 
        movl $15,%ecx
84
 
.L4: 
85
 
        movq  (%edx),%mm0
86
 
        pmaddwd (%esi),%mm0
87
 
        movq  8(%edx),%mm1
88
 
        pmaddwd 8(%esi),%mm1
89
 
        movq  16(%edx),%mm2
90
 
        pmaddwd 16(%esi),%mm2
91
 
        movq  24(%edx),%mm3
92
 
        pmaddwd 24(%esi),%mm3
93
 
        paddd %mm1,%mm0
94
 
        paddd %mm2,%mm0
95
 
        paddd %mm3,%mm0
96
 
        movq  %mm0,%mm1
97
 
        psrlq $32,%mm1
98
 
        paddd %mm0,%mm1
99
 
        psrad $13,%mm1
100
 
        packssdw %mm1,%mm1
101
 
        psubd %mm0,%mm0
102
 
        psubsw %mm1,%mm0
103
 
        movd %mm0,%eax
104
 
        movw %ax,(%edi)
105
 
 
106
 
        subl $32,%esi
107
 
        addl $64,%edx
108
 
        leal 4(%edi),%edi                
109
 
        loop .L4
110
 
        emms
111
 
        popl %ebx
112
 
        popl %esi
113
 
        popl %edi
114
 
        popl %ebp
115
 
        ret
116
 
 
117