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:
Bruce Evans 1999-01-09 13:50:52 +00:00
parent d18c16d45b
commit b2aa114118
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42431

View file

@ -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)
{