1 Nov 2006 02:22
Re: Improved remove-logo filter
Michael Niedermayer <michaelni <at> gmx.at>
2006-11-01 01:22:11 GMT
2006-11-01 01:22:11 GMT
Hi On Tue, Oct 31, 2006 at 01:13:29PM -0800, Trent Piepho wrote: > On Tue, 31 Oct 2006, Guillaume POIRIER wrote: > > > Hi Trent, > > > > Were you able to work on improving your patch? > > What was there to do? Change the asm to use "+" constraints > even though it doesn't always work with gcc 2.7.2? does gcc 2.7.2 compile mplayer at all? [...] > > > > > : "=m" (accumulator), "=r" (i), "=g" (j), "=r" (mask), "=r" (image) > > > > > : "m" (accumulator), "1" (i), "2" (j), "3" (mask), "4" (image), > > > > > "g" (logo_mask->width), "g" (stride) > > > > > > > > : "+m" (accumulator), "+r" (i), "+g" (j), "+r" (mask), "+r" (image) > > > > : "g" (logo_mask->width), "g" (stride) > > > > > > I've read several places that you can't use "+" to indicate an input/output > > > arguments in inline asm, it only works in machine descriptions. I think it > > > may have changed for newer versions of gcc. > > > > > > I've tried it, before and gcc doesn't complain about it, but it doesn't > > > always work. With broken constraints you will often get lucky and have > > > everything work, and then some random change to some peice of unrelated > > > code will have the optimizer make a choice that breaks the asm. So, it's > > > very had to make a test case that shows it, but I had gcc not load the > > > value into a "+r" constraint, so I decided to believe the docs and use "=r" > > > / "0" instead. i wish you luck, but ill bet that avoiding "+" will not save you from gcc-asm bugs (unless the gcc devels fixed it and you use only very recent gcc) and if you use "=something" then you should also be aware of that for example "=r"(a) :"r"(b) does not prevent %0 == %1 if you want an output to not be able to use the same register or memory location as an random input then you must use "=&..." iam not sure if that could cause any problems with your code as i didnt look at it, just the constraints quoted above in which "=m" (accumulator) and "m" (accumulator) could be in the same memory location or a different one or "=m" (accumulator) and "g" (stride) could be in the same memory location [...] -- -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In the past you could go to a library and read, borrow or copy any book Today you'd get arrested for mere telling someone where the library is
RSS Feed