[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] tcg: Remove stack protection from helper functi

From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH] tcg: Remove stack protection from helper functions
Date: Mon, 26 Sep 2011 23:26:39 +0300
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

On 09/26/2011 11:19 PM, Peter Maydell wrote:
On 26 September 2011 20:52, Avi Kivity<address@hidden>  wrote:
>  Why do floating point ops need helpers?  At least if all the edge cases
>  match? (i.e. NaNs and denormals)

The answer is that the edge cases basically never match.

Surely they do when host == target.  Although there you can virtualize.

  No CPU
architecture does handling of NaNs and input denormals and output
denormals and underflow checks and all the rest of it in exactly
the same way as anybody else. (In particular x86 is pretty crazy,
which is unfortunate given that it's the most significant host
arch at the moment.) So any kind of TCG native floating point
support would probably have to translate to "check if either
input is a special case; if not, try the op; check if the output
was a special case; if any of those checks fired, back off to
the softfloat helper function". Which is quite a lot of inline
code, and also annoyingly bouncing between fp ops and integer
bitpattern checks on the fp values.

Alternatively, configure the fpu to trap on these cases, and handle them in a slow path. At least x86 sse allows this (though perhaps not for "quiet NaN"s?

Does it matter in practice? Perhaps we can have a fast-and-loose mode for the fpu (gcc does).

I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]