2001-06-29 17:55:35 +00:00
|
|
|
# this code comes under GPL
|
|
|
|
# This code was taken from http://www.mpg123.org
|
|
|
|
# See ChangeLog of mpg123-0.59s-pre.1 for detail
|
|
|
|
# Applied to mplayer by Nick Kurshev <nickols_k@mail.ru>
|
|
|
|
#
|
2001-07-03 09:25:16 +00:00
|
|
|
# Local ChangeLog:
|
|
|
|
# - Partial loops unrolling and removing MOVW insn from loops
|
2001-06-29 17:55:35 +00:00
|
|
|
#
|
|
|
|
|
2001-07-03 09:25:16 +00:00
|
|
|
.data
|
|
|
|
.align 8
|
|
|
|
null_one: .long 0x0000ffff, 0x0000ffff
|
|
|
|
one_null: .long 0xffff0000, 0xffff0000
|
2001-07-04 09:47:56 +00:00
|
|
|
.globl costab_mmx
|
|
|
|
costab_mmx:
|
|
|
|
.long 1056974725
|
|
|
|
.long 1057056395
|
|
|
|
.long 1057223771
|
|
|
|
.long 1057485416
|
|
|
|
.long 1057855544
|
|
|
|
.long 1058356026
|
|
|
|
.long 1059019886
|
|
|
|
.long 1059897405
|
|
|
|
.long 1061067246
|
|
|
|
.long 1062657950
|
|
|
|
.long 1064892987
|
|
|
|
.long 1066774581
|
|
|
|
.long 1069414683
|
|
|
|
.long 1073984175
|
|
|
|
.long 1079645762
|
|
|
|
.long 1092815430
|
|
|
|
.long 1057005197
|
|
|
|
.long 1057342072
|
|
|
|
.long 1058087743
|
|
|
|
.long 1059427869
|
|
|
|
.long 1061799040
|
|
|
|
.long 1065862217
|
|
|
|
.long 1071413542
|
|
|
|
.long 1084439708
|
|
|
|
.long 1057128951
|
|
|
|
.long 1058664893
|
|
|
|
.long 1063675095
|
|
|
|
.long 1076102863
|
|
|
|
.long 1057655764
|
|
|
|
.long 1067924853
|
|
|
|
.long 1060439283
|
2001-07-03 09:25:16 +00:00
|
|
|
|
2001-06-29 17:55:35 +00:00
|
|
|
.text
|
|
|
|
|
|
|
|
.globl synth_1to1_MMX_s
|
2001-07-06 12:08:32 +00:00
|
|
|
//
|
|
|
|
// void synth_1to1_MMX_s(real *bandPtr, int channel, short *samples,
|
|
|
|
// short *buffs, int *bo);
|
|
|
|
//
|
2001-06-29 17:55:35 +00:00
|
|
|
synth_1to1_MMX_s:
|
|
|
|
pushl %ebp
|
|
|
|
pushl %edi
|
|
|
|
pushl %esi
|
|
|
|
pushl %ebx
|
2001-07-05 09:44:18 +00:00
|
|
|
movl 24(%esp),%ecx
|
|
|
|
movl 28(%esp),%edi
|
2001-06-29 17:55:35 +00:00
|
|
|
movl $15,%ebx
|
2001-07-05 09:44:18 +00:00
|
|
|
movl 36(%esp),%edx
|
2001-06-29 17:55:35 +00:00
|
|
|
leal (%edi,%ecx,2),%edi
|
|
|
|
decl %ecx
|
2001-07-05 09:44:18 +00:00
|
|
|
movl 32(%esp),%esi
|
|
|
|
movl (%edx),%eax
|
2001-06-29 17:55:35 +00:00
|
|
|
jecxz .L1
|
|
|
|
decl %eax
|
2001-07-05 09:44:18 +00:00
|
|
|
andl %ebx,%eax
|
|
|
|
leal 1088(%esi),%esi
|
|
|
|
movl %eax,(%edx)
|
2001-06-29 17:55:35 +00:00
|
|
|
.L1:
|
2001-07-05 09:44:18 +00:00
|
|
|
leal (%esi,%eax,2),%edx
|
|
|
|
movl %eax,%ebp
|
|
|
|
incl %eax
|
|
|
|
pushl 20(%esp)
|
|
|
|
andl %ebx,%eax
|
|
|
|
leal 544(%esi,%eax,2),%ecx
|
|
|
|
incl %ebx
|
2001-06-29 17:55:35 +00:00
|
|
|
testl $1, %eax
|
2001-07-05 09:44:18 +00:00
|
|
|
jnz .L2
|
2001-06-29 17:55:35 +00:00
|
|
|
xchgl %edx,%ecx
|
|
|
|
incl %ebp
|
2001-07-05 09:44:18 +00:00
|
|
|
leal 544(%esi),%esi
|
2001-06-29 17:55:35 +00:00
|
|
|
.L2:
|
|
|
|
emms
|
|
|
|
pushl %edx
|
|
|
|
pushl %ecx
|
|
|
|
call *dct64_MMX_func
|
|
|
|
leal 1(%ebx), %ecx
|
2001-07-05 09:44:18 +00:00
|
|
|
subl %ebp,%ebx
|
2001-07-03 09:25:16 +00:00
|
|
|
pushl %ecx
|
2001-06-29 17:55:35 +00:00
|
|
|
leal decwins(%ebx,%ebx,1), %edx
|
2001-07-03 09:25:16 +00:00
|
|
|
shrl $1, %ecx
|
|
|
|
.align 16
|
2001-06-29 17:55:35 +00:00
|
|
|
.L3:
|
|
|
|
movq (%edx),%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 64(%edx),%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd (%esi),%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd 32(%esi),%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
movq 8(%edx),%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 72(%edx),%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd 8(%esi),%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd 40(%esi),%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
movq 16(%edx),%mm2
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 80(%edx),%mm6
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd 16(%esi),%mm2
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd 48(%esi),%mm6
|
2001-06-29 17:55:35 +00:00
|
|
|
movq 24(%edx),%mm3
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 88(%edx),%mm7
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd 24(%esi),%mm3
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd 56(%esi),%mm7
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm1,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm5,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm2,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm6,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm3,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm7,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
movq %mm0,%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
movq %mm4,%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
psrlq $32,%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
psrlq $32,%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm1,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm5,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
psrad $13,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
psrad $13,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
packssdw %mm0,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
packssdw %mm4,%mm4
|
|
|
|
|
|
|
|
movq (%edi), %mm1
|
|
|
|
punpckldq %mm4, %mm0
|
|
|
|
pand one_null, %mm1
|
|
|
|
pand null_one, %mm0
|
|
|
|
por %mm0, %mm1
|
|
|
|
movq %mm1,(%edi)
|
|
|
|
|
|
|
|
leal 64(%esi),%esi
|
|
|
|
leal 128(%edx),%edx
|
|
|
|
leal 8(%edi),%edi
|
2001-06-29 17:55:35 +00:00
|
|
|
|
|
|
|
decl %ecx
|
|
|
|
jnz .L3
|
|
|
|
|
2001-07-03 09:25:16 +00:00
|
|
|
popl %ecx
|
|
|
|
andl $1, %ecx
|
|
|
|
jecxz .next_loop
|
2001-06-29 17:55:35 +00:00
|
|
|
|
2001-07-03 09:25:16 +00:00
|
|
|
movq (%edx),%mm0
|
|
|
|
pmaddwd (%esi),%mm0
|
|
|
|
movq 8(%edx),%mm1
|
|
|
|
pmaddwd 8(%esi),%mm1
|
|
|
|
movq 16(%edx),%mm2
|
|
|
|
pmaddwd 16(%esi),%mm2
|
|
|
|
movq 24(%edx),%mm3
|
|
|
|
pmaddwd 24(%esi),%mm3
|
|
|
|
paddd %mm1,%mm0
|
|
|
|
paddd %mm2,%mm0
|
|
|
|
paddd %mm3,%mm0
|
|
|
|
movq %mm0,%mm1
|
|
|
|
psrlq $32,%mm1
|
|
|
|
paddd %mm1,%mm0
|
|
|
|
psrad $13,%mm0
|
|
|
|
packssdw %mm0,%mm0
|
|
|
|
movd %mm0,%eax
|
|
|
|
movw %ax, (%edi)
|
|
|
|
leal 32(%esi),%esi
|
|
|
|
leal 64(%edx),%edx
|
|
|
|
leal 4(%edi),%edi
|
|
|
|
|
|
|
|
.next_loop:
|
2001-06-29 17:55:35 +00:00
|
|
|
subl $64,%esi
|
2001-07-03 09:25:16 +00:00
|
|
|
movl $7,%ecx
|
|
|
|
.align 16
|
2001-06-29 17:55:35 +00:00
|
|
|
.L4:
|
|
|
|
movq (%edx),%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 64(%edx),%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd (%esi),%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd -32(%esi),%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
movq 8(%edx),%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 72(%edx),%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd 8(%esi),%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd -24(%esi),%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
movq 16(%edx),%mm2
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 80(%edx),%mm6
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd 16(%esi),%mm2
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd -16(%esi),%mm6
|
2001-06-29 17:55:35 +00:00
|
|
|
movq 24(%edx),%mm3
|
2001-07-03 09:25:16 +00:00
|
|
|
movq 88(%edx),%mm7
|
2001-06-29 17:55:35 +00:00
|
|
|
pmaddwd 24(%esi),%mm3
|
2001-07-03 09:25:16 +00:00
|
|
|
pmaddwd -8(%esi),%mm7
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm1,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm5,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm2,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm6,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm3,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm7,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
movq %mm0,%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
movq %mm4,%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
psrlq $32,%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
psrlq $32,%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
paddd %mm0,%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
paddd %mm4,%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
psrad $13,%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
psrad $13,%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
packssdw %mm1,%mm1
|
2001-07-03 09:25:16 +00:00
|
|
|
packssdw %mm5,%mm5
|
2001-06-29 17:55:35 +00:00
|
|
|
psubd %mm0,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
psubd %mm4,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
psubsw %mm1,%mm0
|
2001-07-03 09:25:16 +00:00
|
|
|
psubsw %mm5,%mm4
|
2001-06-29 17:55:35 +00:00
|
|
|
|
2001-07-03 09:25:16 +00:00
|
|
|
movq (%edi), %mm1
|
|
|
|
punpckldq %mm4, %mm0
|
|
|
|
pand one_null, %mm1
|
|
|
|
pand null_one, %mm0
|
|
|
|
por %mm0, %mm1
|
|
|
|
movq %mm1,(%edi)
|
|
|
|
|
|
|
|
subl $64,%esi
|
|
|
|
addl $128,%edx
|
|
|
|
leal 8(%edi),%edi
|
2001-06-29 17:55:35 +00:00
|
|
|
decl %ecx
|
|
|
|
jnz .L4
|
2001-07-03 09:25:16 +00:00
|
|
|
|
|
|
|
movq (%edx),%mm0
|
|
|
|
pmaddwd (%esi),%mm0
|
|
|
|
movq 8(%edx),%mm1
|
|
|
|
pmaddwd 8(%esi),%mm1
|
|
|
|
movq 16(%edx),%mm2
|
|
|
|
pmaddwd 16(%esi),%mm2
|
|
|
|
movq 24(%edx),%mm3
|
|
|
|
pmaddwd 24(%esi),%mm3
|
|
|
|
paddd %mm1,%mm0
|
|
|
|
paddd %mm2,%mm0
|
|
|
|
paddd %mm3,%mm0
|
|
|
|
movq %mm0,%mm1
|
|
|
|
psrlq $32,%mm1
|
|
|
|
paddd %mm0,%mm1
|
|
|
|
psrad $13,%mm1
|
|
|
|
packssdw %mm1,%mm1
|
|
|
|
psubd %mm0,%mm0
|
|
|
|
psubsw %mm1,%mm0
|
|
|
|
movd %mm0,%eax
|
|
|
|
movw %ax,(%edi)
|
|
|
|
|
2001-06-29 17:55:35 +00:00
|
|
|
emms
|
|
|
|
popl %ebx
|
|
|
|
popl %esi
|
|
|
|
popl %edi
|
|
|
|
popl %ebp
|
|
|
|
ret
|