[FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

Ronald S. Bultje rsbultje at gmail.com
Sun Oct 2 15:29:22 EEST 2016


Hi,

On Sun, Oct 2, 2016 at 2:17 AM, <u-h8zb at aetey.se> wrote:

> Hello Henrik,
>
> On Sun, Oct 02, 2016 at 01:18:29AM +0200, Henrik Gramner wrote:
> > Ensuring that emms is issued before every single libc function call is
> > likely problematic.
> >
> > What if we simply document the requirement that C standard library
> > functions are assumed to not modify the x87 FPU state unless
> > specifically designated to handle floating-point numbers?
>
> Is it remarkably expensive to reset the FPU state?


Yes.


> (I am unsure
> also how much of the assembler code depends on clobbering it?)
> If yes, then such documentation would be a reasonable approach.


I would advocate for this approach.

I also think we could contact musl developers and see what's going on
there. We certainly shouldn't blindly fix this bug by adding an emms in a
random place, to me that's like opening pandora's box.

Ronald


More information about the ffmpeg-devel mailing list