Commit graph

26 commits

Author SHA1 Message Date
Frédéric Recoules
abc9f32cf4 pcm: dmix: assembly: give more freedom over the constraints
Minor changes that could help the compiler to produce a
better (smaller/faster) code.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:27:40 +02:00
Frédéric Recoules
79c6ba99c4 pcm: dmix: assembly: refactor the PIC mode
Newer versions of GCC (> 5.0) accept that ebx is declared
in the clobber list even in PIC mode. Meanwhile, even
unlikely, the compiler may use ebx as base address of
one of the memory entry, making subsequent access to
them unreliable ('size', 'dst_step', 'src_step', 'sum_step').

Adding ebx in the clobber solves the problem.
By the way, the entry 'old_ebx' is no longer required.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:27:11 +02:00
Frédéric Recoules
0fd7f0cdc5 pcm: dmix: assembly: fix the interface for safety (mmx)
- add mm0 in the clobber list if the compiler
  is aware of the mmx technology;
- otherwise, add the mmx aliased x87 floating point
  registers in the clobbers;
- the configure now checks if the compiler is aware of
  the MMX technology.

  The compiler assumes none of the mmx or x87 registers are used
  by the function. If it chooses to store some data in them, they
  will be overwritten by the chunk.
  Recall that any mmx instruction invalidate the whole set of
  x87 floating point registers.

  Note: currently does not impact the binary output.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:26:04 +02:00
Frédéric Recoules
01d8a6e03a pcm: dmix: assembly: fix the interface for safety
- move 'size' and 'old_ebx' in the output section
  since they are clobbered;
- add the "memory" clobber since input pointers
  are accessed;
- (minor) add the "cc" clobber since flags are
  clobbered.

  The compiler is missing some dataflow information
  about the execution of the assembly chunks.
  For instance, it assumes that 'size' remains unchanged
  and that no input pointer is accessed.
  The compiler optimizer may take advantage of these
  assumption and produce a wrong code.

Note: currently produces the same binary output.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:25:15 +02:00
Frédéric Recoules
b315f21bf7 pcm: dmix: assembly: change the token by symbolic names
It eases the refactoring of assembly chunk since we can now
add/remove/move entries without worrying about maintaining
the token numbering in the template.

Note: does not impact the binary output.

Signed-off-by: Frédéric Recoules <frederic.recoules@orange.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-05-06 22:24:48 +02:00
Jaroslav Kysela
5b9041bced Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:29:26 +01:00
Jaroslav Kysela
e94f3cfdf9 pcm dmix plugin: fix MIX_AREAS_24 routine for i386 & x86_64 platforms
The code was copied from ALSA bug#4577 from CannibalZerg.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-06-16 20:10:19 +02:00
Josh Green
2076b88a77 Fix segfault with dmix of 3-bytes formats
The i386 and x86-64 dmix may cause segfaults when 3-bytes formats are used
due to btsl asm code, which may overcome the buffer end-boundary.
The patch changes btsl to btsw so that it doesn't happen.

ALSA bug#3341:
	https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3341

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-07 10:10:49 +02:00
Jaroslav Kysela
70b11d614d Implemented snd_pcm_rewind() for the dmix plugin 2008-01-10 10:01:14 +01:00
Clemens Ladisch
79db4a6bfa dmix: rename mix_areas*
Rename all mix_areas* symbols so that they contain the sample width
instead of some meaningless number.
2007-12-10 12:31:29 +01:00
Jaroslav Kysela
d25e281230 Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
Clemens Ladisch
45f63a8735 dmix: add S24_3LE support
Add to the dmix plugin support for the S24_3LE sample format which is
used by 24-bit USB devices.

The optimized assembler version uses only 23 bits for sample data so
that the lowest bit can be used for synchronization because there is no
24-bit cmpxchg instruction.
2005-12-19 07:39:03 +00:00
Jaroslav Kysela
0c468bf109 Fixed wrong jump for 32-bit mixing 2004-05-24 18:40:11 +00:00
Jaroslav Kysela
be1c1d0a96 A new try to fix the SIGSEGV 2004-03-12 19:08:27 +00:00
Jaroslav Kysela
795a7f9f0b Cleanups, returned zero size checking 2004-03-12 12:41:06 +00:00
Jaroslav Kysela
75190c6ed2 Don't use register ebx - it's GOT pointer for -fPIC libraries 2004-02-04 08:25:19 +00:00
Jaroslav Kysela
b798d89c0f <atlka@pg.gda.pl>
- shm memory patch
- optimized a bit sample mixing routines in c and x_86 asm
2004-01-24 16:34:35 +00:00
Takashi Iwai
243027a824 - support of dmix asm code for x86-64. 2003-09-17 17:09:45 +00:00
Takashi Iwai
af0c81d4af fixed 32bit sample dmix code for i386. 2003-09-17 15:39:12 +00:00
Jaroslav Kysela
2e7fe2865a Moved send_fd/receive_fd routines to src/socket.c . 2003-03-18 18:00:05 +00:00
Jaroslav Kysela
9ccf002f54 Added 32-bit sample support to dmix plugin 2003-03-18 14:15:19 +00:00
Jaroslav Kysela
6ed583287a Reverted to 1.3 version (race window is smaller) 2003-03-01 14:23:29 +00:00
Jaroslav Kysela
75d9142a83 Reverted back to 1.1 version 2003-03-01 11:13:12 +00:00
Jaroslav Kysela
b53b043c43 Fixed small errors (size == 0 test) 2003-02-28 20:33:01 +00:00
Jaroslav Kysela
e873672469 Fixed wrong result problem in sum code 2003-02-25 12:45:25 +00:00
Jaroslav Kysela
1c908a75c1 Moved asm i386 code to pcm_dmix_i386.h; UP optimization 2003-02-20 17:10:22 +00:00