Re: [pulseaudio-discuss] Why is it still hissing?

2011-05-25 Thread Andrew Lutomirski
On Tue, May 24, 2011 at 10:04 AM, David Henningsson
david.hennings...@canonical.com wrote:
 Ok, so there is still a high-pitched noise with 5.1, although I tried to fix
 that a while ago. I now know what the error is, but perhaps somewhat with
 more GCC-ASM skills can help me fix it.

 I spent parts of yesterday and today analysing it and came up with the
 following conclusion:

 Here's the asm code as written in svolume_sse.c, function
 pa_volume_s16ne_sse2:

 #define MOD_ADD(a,b) \
       add #a, %3   \n\t /* channel += inc          */ \
       mov %3, %4     \n\t                                \
       sub #b, %4   \n\t /* tmp = channel - channels */ \
       cmovae %4, %3  \n\t /* if (tmp = 0) channel = tmp  */

 And called with: MOD_ADD($8, %5)

 Here's what it shows up with gdb (on i386) :

   0x00f3fbe6 +550:   add    $0x8,%edi
   0x00f3fbe9 +553:   mov    %edi,%ecx
   0x00f3fbeb +555:   sub    %edi,%ecx
   0x00f3fbed +557:   cmovae %ecx,%edi

 The error: both %3 and %5 is turned into the %edi register.

 Here's the register allocation:

 : +r (samples), +r (volumes), +r (length), =D (channel), =r
 (temp)
 : rm ((pa_reg_x86)channels)
 : cc

 As I can tell from the above the =D forces %3 to go into %edi, but I don't
 know how to tell GCC not to use %edi for %5 (channels) as well, does anybody
 know? Can this be a GCC bug?


Either use +D for channel or rm for channels.

The manual here:

http://gcc.gnu.org/onlinedocs/gcc/Modifiers.html#Modifiers

is pretty good.

--Andy
___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss


Re: [pulseaudio-discuss] Why is it still hissing?

2011-05-24 Thread Colin Guthrie
'Twas brillig, and David Henningsson at 24/05/11 15:04 did gyre and gimble:
 (Btw, based on this analysis, I'm guessing that my former fix fixed the
 problem for amd64, but not i386.)

This could be correct as when we inspected this error at my house, the
server actually doing the output was indeed i386, even if my machine is
x86_64...

Cheers for hunting this down :D

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

___
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss