[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test6-45-gdc221f2

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Aug 31 12:50:48 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  dee2aa3f0564caed698e600963b592d50cda068c (commit)

- Log -----------------------------------------------------------------
dc221f2 remap: fix counters for mmx and sse remap
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/remap_mmx.c |   34 +++++++++++++++++++++-------------
 src/pulsecore/remap_sse.c |   34 +++++++++++++++++++++-------------
 2 files changed, 42 insertions(+), 26 deletions(-)

-----------------------------------------------------------------------

commit dc221f204b89fca85c0125e55f3afea4a807ffa7
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Sat Aug 29 12:22:42 2009 +0200

    remap: fix counters for mmx and sse remap
    
    Take the size of the sample into account when calculating the amount of samples
    we process in parallel.

diff --git a/src/pulsecore/remap_mmx.c b/src/pulsecore/remap_mmx.c
index b5fe82e..79e4f1f 100644
--- a/src/pulsecore/remap_mmx.c
+++ b/src/pulsecore/remap_mmx.c
@@ -65,16 +65,24 @@
                 " add $32, %1                   \n\t"  \
                 " add $64, %0                   \n\t"
 
-#define HANDLE_SINGLE(s)                               \
+#define HANDLE_SINGLE_dq()                            \
                 " movd (%1), %%mm0              \n\t"  \
-                " punpckl"#s" %%mm0, %%mm0      \n\t"  \
+                " punpckldq %%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"  \
+#define HANDLE_SINGLE_wd()                             \
+                " movw (%1), %w3                \n\t"  \
+                " movd %3,  %%mm0               \n\t"  \
+                " punpcklwd %%mm0, %%mm0        \n\t"  \
+                " movd %%mm0, (%0)              \n\t"  \
+                " add $2, %1                    \n\t"  \
+                " add $4, %0                    \n\t"
+
+#define MONO_TO_STEREO(s,shift,mask)                   \
+                " mov %4, %2                    \n\t"  \
+                " sar $"#shift", %2             \n\t"  \
                 " cmp $0, %2                    \n\t"  \
                 " je 2f                         \n\t"  \
                 "1:                             \n\t"  \
@@ -84,11 +92,11 @@
                 " dec %2                        \n\t"  \
                 " jne 1b                        \n\t"  \
                 "2:                             \n\t"  \
-                " mov %3, %2                    \n\t"  \
-                " and $7, %2                    \n\t"  \
+                " mov %4, %2                    \n\t"  \
+                " and $"#mask", %2              \n\t"  \
                 " je 4f                         \n\t"  \
                 "3:                             \n\t"  \
-                HANDLE_SINGLE(s)                       \
+                HANDLE_SINGLE_##s()                    \
                 " dec %2                        \n\t"  \
                 " jne 3b                        \n\t"  \
                 "4:                             \n\t"  \
@@ -96,14 +104,14 @@
 
 #if defined (__i386__) || defined (__amd64__)
 static void remap_mono_to_stereo_mmx (pa_remap_t *m, void *dst, const void *src, unsigned n) {
-    pa_reg_x86 temp;
+    pa_reg_x86 temp, temp2;
 
     switch (*m->format) {
         case PA_SAMPLE_FLOAT32NE:
         {
             __asm__ __volatile__ (
-                MONO_TO_STEREO(dq) /* do doubles to quads */
-                : "+r" (dst), "+r" (src), "=&r" (temp)
+                MONO_TO_STEREO(dq,3,7) /* do doubles to quads */
+                : "+r" (dst), "+r" (src), "=&r" (temp), "=&r" (temp2)
                 : "r" ((pa_reg_x86)n)
                 : "cc"
             );
@@ -112,8 +120,8 @@ static void remap_mono_to_stereo_mmx (pa_remap_t *m, void *dst, const void *src,
         case PA_SAMPLE_S16NE:
         {
             __asm__ __volatile__ (
-                MONO_TO_STEREO(wd) /* do words to doubles */
-                : "+r" (dst), "+r" (src), "=&r" (temp)
+                MONO_TO_STEREO(wd,4,15) /* do words to doubles */
+                : "+r" (dst), "+r" (src), "=&r" (temp), "=&r" (temp2)
                 : "r" ((pa_reg_x86)n)
                 : "cc"
             );
diff --git a/src/pulsecore/remap_sse.c b/src/pulsecore/remap_sse.c
index 97f2476..d600357 100644
--- a/src/pulsecore/remap_sse.c
+++ b/src/pulsecore/remap_sse.c
@@ -65,16 +65,24 @@
                 " add $64, %1                   \n\t"  \
                 " add $128, %0                  \n\t"
 
-#define HANDLE_SINGLE(s)                               \
+#define HANDLE_SINGLE_dq()                             \
                 " movd (%1), %%xmm0             \n\t"  \
-                " punpckl"#s" %%xmm0, %%xmm0    \n\t"  \
+                " punpckldq %%xmm0, %%xmm0      \n\t"  \
                 " movq %%xmm0, (%0)             \n\t"  \
                 " add $4, %1                    \n\t"  \
                 " add $8, %0                    \n\t"
 
-#define MONO_TO_STEREO(s)                               \
-                " mov %3, %2                    \n\t"   \
-                " sar $4, %2                    \n\t"   \
+#define HANDLE_SINGLE_wd()                             \
+                " movw (%1), %w3                \n\t"  \
+                " movd %3, %%xmm0               \n\t"  \
+                " punpcklwd %%xmm0, %%xmm0      \n\t"  \
+                " movd %%xmm0, (%0)             \n\t"  \
+                " add $2, %1                    \n\t"  \
+                " add $4, %0                    \n\t"
+
+#define MONO_TO_STEREO(s,shift,mask)                    \
+                " mov %4, %2                    \n\t"   \
+                " sar $"#shift", %2             \n\t"   \
                 " cmp $0, %2                    \n\t"   \
                 " je 2f                         \n\t"   \
                 "1:                             \n\t"   \
@@ -84,24 +92,24 @@
                 " dec %2                        \n\t"   \
                 " jne 1b                        \n\t"   \
                 "2:                             \n\t"   \
-                " mov %3, %2                    \n\t"   \
-                " and $15, %2                   \n\t"   \
+                " mov %4, %2                    \n\t"   \
+                " and $"#mask", %2              \n\t"   \
                 " je 4f                         \n\t"   \
                 "3:                             \n\t"   \
-                HANDLE_SINGLE(s)                        \
+                HANDLE_SINGLE_##s()                     \
                 " dec %2                        \n\t"   \
                 " jne 3b                        \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;
+    pa_reg_x86 temp, temp2;
 
     switch (*m->format) {
         case PA_SAMPLE_FLOAT32NE:
         {
             __asm__ __volatile__ (
-                MONO_TO_STEREO(dq) /* do doubles to quads */
-                : "+r" (dst), "+r" (src), "=&r" (temp)
+                MONO_TO_STEREO(dq,3,7) /* do doubles to quads */
+                : "+r" (dst), "+r" (src), "=&r" (temp), "=&r" (temp2)
                 : "r" ((pa_reg_x86)n)
                 : "cc"
             );
@@ -110,8 +118,8 @@ static void remap_mono_to_stereo_sse (pa_remap_t *m, void *dst, const void *src,
         case PA_SAMPLE_S16NE:
         {
             __asm__ __volatile__ (
-                MONO_TO_STEREO(wd) /* do words to doubles */
-                : "+r" (dst), "+r" (src), "=&r" (temp)
+                MONO_TO_STEREO(wd,4,15) /* do words to doubles */
+                : "+r" (dst), "+r" (src), "=&r" (temp), "=&r" (temp2)
                 : "r" ((pa_reg_x86)n)
                 : "cc"
             );

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list