Removed the asm version of translate_bytes(). When both the C
version and the asm version are inlined, and everything is cached, the asm version is 1.75 times slower than the C version on P5's. On K6's, it is only 1.25 times slower.
This commit is contained in:
parent
2616cfa856
commit
69095f699e
@ -57,15 +57,6 @@ static char *wr_dma_buf[MAX_AUDIO_DEV];
|
||||
static int audio_format[MAX_AUDIO_DEV];
|
||||
static int local_conversion[MAX_AUDIO_DEV];
|
||||
|
||||
#if defined(NO_INLINE_ASM) || !defined(__i386__)
|
||||
static void
|
||||
translate_bytes(const u_char *table, u_char *buff, int n);
|
||||
|
||||
#else
|
||||
extern __inline void
|
||||
translate_bytes(const void *table, void *buff, int n);
|
||||
#endif
|
||||
|
||||
static int
|
||||
set_format(int dev, int fmt)
|
||||
{
|
||||
@ -148,7 +139,6 @@ audio_release(int dev, struct fileinfo * file)
|
||||
|
||||
}
|
||||
|
||||
#if defined(NO_INLINE_ASM) || !defined(__i386__)
|
||||
static void
|
||||
translate_bytes(const u_char *table, u_char *buff, int n)
|
||||
{
|
||||
@ -161,25 +151,6 @@ translate_bytes(const u_char *table, u_char *buff, int n)
|
||||
buff[i] = table[buff[i]];
|
||||
}
|
||||
|
||||
#else
|
||||
extern __inline void
|
||||
translate_bytes(const void *table, void *buff, int n)
|
||||
{
|
||||
if (n > 0) {
|
||||
__asm __volatile(
|
||||
"cld\n"
|
||||
"1:\tlodsb\n\t"
|
||||
"xlatb\n\t"
|
||||
"stosb\n\t"
|
||||
"loop 1b\n\t"
|
||||
: "=b" (table), "=c" (n), "=D" (buff), "=S" (buff)
|
||||
: "0" (table), "1" (n), "2" (buff), "3" (buff)
|
||||
: "ax", "memory");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
audio_write(int dev, struct fileinfo * file, snd_rw_buf * buf, int count)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user