[FFmpeg-devel] [RFC] clobbers for XMM registers

Michael Niedermayer michaelni
Fri Oct 1 17:37:19 CEST 2010


On Fri, Oct 01, 2010 at 12:51:38PM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Thu, Sep 30, 2010 at 08:49:04PM -0400, Alexander Strange wrote:
> >> 
> >> On Sep 30, 2010, at 8:31 PM, Michael Niedermayer wrote:
> >> 
> >> > On Fri, Oct 01, 2010 at 12:42:33AM +0100, M?ns Rullg?rd wrote:
> >> >> Michael Niedermayer <michaelni at gmx.at> writes:
> >> >> 
> >> >>> On Thu, Sep 30, 2010 at 04:02:00PM -0300, Ramiro Polla wrote:
> >> >>>> 2010/9/30 M?ns Rullg?rd <mans at mansr.com>:
> >> >>>>> Ramiro Polla <ramiro.polla at gmail.com> writes:
> >> >>>>>> 2010/9/30 M?ns Rullg?rd <mans at mansr.com>:
> >> >>>>>>> Ramiro Polla <ramiro.polla at gmail.com> writes:
> >> >>>>>>>> What about
> >> >>>>>>>> #if HAVE_XMM_CLOBBERS
> >> >>>>>>>> #    define XMM_CLOBBERS(a, ...) __VA_ARGS__
> >> >>>>>>>> #else
> >> >>>>>>>> #    define XMM_CLOBBERS(a, ...) a
> >> >>>>>>>> #endif
> >> >>>>>>>> 
> >> >>>>>>>> to be used as in lavc/x86/fft_sse.c:
> >> >>>>>>>>         :"+r"(j), "+r"(k)
> >> >>>>>>>>         :"r"(output+n4), "r"(output+n4*3),
> >> >>>>>>>>          "m"(*m1m1m1m1)
> >> >>>>>>>>         XMM_CLOBBERS(, : "%xmm0", "%xmm1", "%xmm7")
> >> >>>>>>>>     );
> >> >>>>>>> 
> >> >>>>>>> That falls over if any other clobbers are needed.
> >> >>>>>> 
> >> >>>>>> If any other clobbers are needed they could be written before the macro.
> >> >>>>> 
> >> >>>>> That won't work.
> >> >>>> 
> >> >>>> : "eax" XMM_CLOBBERS(,, "%xmm0", "%xmm1", "%xmm7")
> >> >>>> 
> >> >>>> But I agree having "cc" as dummy is simpler.
> >> >>> 
> >> >>> it may be simpler but your variant is more correct
> >> >> 
> >> >> If "cc" is a no-op neither variant is more correct.  Mine is a hell of
> >> >> a lot prettier though.
> >> > 
> >> > unless "cc" is documented to be a no-op on x86 we should not assume it is
> >> 
> >> svn blame on gcc says it hasn't changed since x86 was rewritten in 1999.
> >> (the code in question being ix86_md_asm_clobbers(), in a file too big to display in viewcvs)
> >> 
> >> I hardly see how it could change now since it would break all users of asm.
> >
> > i agree with you still i dont think the risk with cc byting us is 0
> 
> Yet you are willing to assume that gcc will never, ever start using
> registers in a way incompatible with your under-specified inline asm.
> The mind boggles.

you arent planning to stop that trolling are you?
if you think there is a problem in the code, you should report that
and please dont make claims about what iam assuming or not


> 
> > and theres a perfectly working solution, namely ramiros macro.
> 
> It may work, but perfect it is not.  The syntax is horrible and non-obvious.

> Mistakes are inevitable.

yes, yes mistakes are inevitable when we use the green one


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101001/69225f23/attachment.pgp>



More information about the ffmpeg-devel mailing list