4
copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
5
see COPYING and AUTHORS files in distribution or http://mpg123.org
6
initially written by Stefan Bieschewski
8
synth_1to1 works the same way as the c version of this
9
file. only two types of changes have been made:
10
- reordered floating point instructions to
11
prevent pipline stalls
12
- made WRITE_SAMPLE use integer instead of
13
(slower) floating point
14
all kinds of x86 processors should benefit from these
17
useful sources of information on optimizing x86 code include:
19
Intel Architecture Optimization Manual
20
http://www.intel.com/design/pentium/manuals/242816.htm
22
Cyrix 6x86 Instruction Set Summary
23
ftp://ftp.cyrix.com/6x86/6x-dbch6.pdf
25
AMD-K5 Processor Software Development
26
http://www.amd.com/products/cpg/techdocs/appnotes/20007e.pdf
28
Stefan Bieschewski <stb@acm.org>
30
$Id: decode_i586.s 1 2004-09-18 13:30:08Z thomas $
47
/* int synth_1to1_i586_asm(real *bandPtr, int channel, unsigned char *out, unsigned char *buffs, int *bo, real *decwin); */
48
.globl ASM_NAME(synth_1to1_i586_asm)
49
ASM_NAME(synth_1to1_i586_asm):
55
/* stack: 0=ebx, 4=esi, 8=edi, 12=ebp, 16,20,24=local, 28=back, 32=bandPtr, 36=channel, 40=out, 44=buffs, 48=bo, 52=decwin */
56
movl 32(%esp),%eax /* *bandPtr */
57
movl 40(%esp),%esi /* *out */
58
movl 48(%esp),%edi /* *bo */
59
movl (%edi),%ebp /* store bo value in ebp */
62
jne .L48 /* if(!channel) */
64
andl $15,%ebp /* bo &= 0xf */
65
movl 48(%esp), %edi /* *bo */
66
movl %ebp,(%edi) /* write back bo */
67
xorl %edi,%edi /* restore %edi to 0; it's used later */
68
movl 44(%esp),%ecx /* use buffs */
70
.L48: /* if(channel) use buffs+2176 */
72
movl 44(%esp),%ecx /* *buffs */
81
leal (%ebx,%edx,4),%eax
86
leal 1088(,%eax,4),%eax
94
leal 1092(%ecx,%ebp,4),%eax
96
leal (%ecx,%ebp,4),%eax
99
call ASM_NAME(dct64_i386)
101
/* stack now back on track */
104
movl 52(%esp),%eax /* decwin */
182
1: movw $32767,(%esi)
184
2: movw $-32768,(%esi)
232
1: movw $32767,(%esi)
234
2: movw $-32768,(%esi)
241
leal -128(%ecx,%edx,8),%ecx
317
1: movw $32767,(%esi)
319
2: movw $-32768,(%esi)