summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-08-26 19:29:21 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-08-27 10:44:52 +0200
commit59070892ed070d0c42d8d9b91d267a39c5763a9c (patch)
treeefadd82d6bf89462068dceb13685f3e7fbe9b9dc /src
parent9d254679649fe3810ec9885251999a084bb7bacb (diff)
remap: cleanup assembler a little
Diffstat (limited to 'src')
-rw-r--r--src/pulsecore/remap_mmx.c43
-rw-r--r--src/pulsecore/remap_sse.c12
2 files changed, 26 insertions, 29 deletions
diff --git a/src/pulsecore/remap_mmx.c b/src/pulsecore/remap_mmx.c
index 00252dac..b5fe82ee 100644
--- a/src/pulsecore/remap_mmx.c
+++ b/src/pulsecore/remap_mmx.c
@@ -51,7 +51,7 @@
" punpckl"#s" %%mm4, %%mm4 \n\t" \
" punpckh"#s" %%mm5, %%mm5 \n\t" \
" punpckl"#s" %%mm6, %%mm6 \n\t" \
- " punpckh"#s" %%mm7, %%mm7 \n\t" \
+ " punpckh"#s" %%mm7, %%mm7 \n\t"
#define STORE_SAMPLES \
" movq %%mm0, (%0) \n\t" \
@@ -67,32 +67,31 @@
#define HANDLE_SINGLE(s) \
" movd (%1), %%mm0 \n\t" \
- " movq %%mm0, %%mm1 \n\t" \
" punpckl"#s" %%mm0, %%mm0 \n\t" \
" movq %%mm0, (%0) \n\t" \
" add $4, %1 \n\t" \
" add $8, %0 \n\t"
-#define MONO_TO_STEREO(s) \
- " mov %3, %2 \n\t" \
- " sar $3, %2 \n\t" \
- " cmp $0, %2 \n\t" \
- " je 2f \n\t" \
- "1: \n\t" \
- LOAD_SAMPLES \
- UNPACK_SAMPLES(s) \
- STORE_SAMPLES \
- " dec %2 \n\t" \
- " jne 1b \n\t" \
- "2: \n\t" \
- " mov %3, %2 \n\t" \
- " and $7, %2 \n\t" \
- " je 4f \n\t" \
- "3: \n\t" \
- HANDLE_SINGLE(s) \
- " dec %2 \n\t" \
- " jne 3b \n\t" \
- "4: \n\t" \
+#define MONO_TO_STEREO(s) \
+ " mov %3, %2 \n\t" \
+ " sar $3, %2 \n\t" \
+ " cmp $0, %2 \n\t" \
+ " je 2f \n\t" \
+ "1: \n\t" \
+ LOAD_SAMPLES \
+ UNPACK_SAMPLES(s) \
+ STORE_SAMPLES \
+ " dec %2 \n\t" \
+ " jne 1b \n\t" \
+ "2: \n\t" \
+ " mov %3, %2 \n\t" \
+ " and $7, %2 \n\t" \
+ " je 4f \n\t" \
+ "3: \n\t" \
+ HANDLE_SINGLE(s) \
+ " dec %2 \n\t" \
+ " jne 3b \n\t" \
+ "4: \n\t" \
" emms \n\t"
#if defined (__i386__) || defined (__amd64__)
diff --git a/src/pulsecore/remap_sse.c b/src/pulsecore/remap_sse.c
index e086862d..97f2476e 100644
--- a/src/pulsecore/remap_sse.c
+++ b/src/pulsecore/remap_sse.c
@@ -51,7 +51,7 @@
" punpckl"#s" %%xmm4, %%xmm4 \n\t" \
" punpckh"#s" %%xmm5, %%xmm5 \n\t" \
" punpckl"#s" %%xmm6, %%xmm6 \n\t" \
- " punpckh"#s" %%xmm7, %%xmm7 \n\t" \
+ " punpckh"#s" %%xmm7, %%xmm7 \n\t"
#define STORE_SAMPLES \
" movdqu %%xmm0, (%0) \n\t" \
@@ -66,10 +66,9 @@
" add $128, %0 \n\t"
#define HANDLE_SINGLE(s) \
- " movd (%1), %%mm0 \n\t" \
- " movq %%mm0, %%mm1 \n\t" \
- " punpckl"#s" %%mm0, %%mm0 \n\t" \
- " movq %%mm0, (%0) \n\t" \
+ " movd (%1), %%xmm0 \n\t" \
+ " punpckl"#s" %%xmm0, %%xmm0 \n\t" \
+ " movq %%xmm0, (%0) \n\t" \
" add $4, %1 \n\t" \
" add $8, %0 \n\t"
@@ -92,8 +91,7 @@
HANDLE_SINGLE(s) \
" dec %2 \n\t" \
" jne 3b \n\t" \
- "4: \n\t" \
- " emms \n\t"
+ "4: \n\t"
static void remap_mono_to_stereo_sse (pa_remap_t *m, void *dst, const void *src, unsigned n) {
pa_reg_x86 temp;