[PATCH] Call math_opt_barrier inside if
H.J. Lu
hjl.tools@gmail.com
Thu Jan 14 23:11:00 GMT 2016
On Thu, Jan 14, 2016 at 2:38 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 14 Jan 2016, H.J. Lu wrote:
>
>> On Thu, Jan 14, 2016 at 2:13 PM, Joseph Myers <joseph@codesourcery.com> wrote:
>> > On Thu, 14 Jan 2016, H.J. Lu wrote:
>> >
>> >> Since floating-point operation may trigger floating-point exceptions,
>> >> we call math_opt_barrier inside if to prevent code motion.
>> >>
>> >> Tested on x86-64. OK for trunk?
>> >
>> > Please send a patch updating all implementations for which this issue is
>> > applicable.
>>
>> There are
>>
>> dbl-64/e_sqrt.c: libc_feholdexcept_setround (&env, FE_TONEAREST);
>> dbl-64/s_fma.c: libc_feholdexcept_setround (&env, FE_TONEAREST);
>> dbl-64/s_fmaf.c: libc_feholdexcept_setround (&env, FE_TOWARDZERO);
>>
>> under sysdeps/ieee754. dbl-64/s_fma.c is the only one with this
>> problem.
>
> I disagree with that analysis. The question isn't whether there's a call
> to a particular internal interface. The question is whether there are
> conditionals on arithmetic, such that the arithmetic is exact in the
> conditional case but may be inexact if moved before the conditional. I
> think at least ldbl-96/s_fmal.c, ldbl-96/s_fma.c and ldbl-128/s_fmal.c
> have the same issue.
>
Here is the updated patch. OK for trunk?
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Call-math_opt_barrier-inside-if.patch
Type: text/x-patch
Size: 2829 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160114/a389beca/attachment.bin>
More information about the Libc-alpha
mailing list