This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] alpha: Remove s_trunc{f} implementation (BZ#22666)
- From: Richard Henderson <rth at twiddle dot net>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Thu, 4 Jan 2018 10:57:55 -0800
- Subject: Re: [PATCH] alpha: Remove s_trunc{f} implementation (BZ#22666)
- Authentication-results: sourceware.org; auth=none
- References: <1515006840-31339-1-git-send-email-adhemerval.zanella@linaro.org>
On 01/03/2018 11:14 AM, Adhemerval Zanella wrote:
> As discussed in libc-alpha [1], alpha trunc{f} implementation uses
> addt/suc and subt/suc and although the Alpha Architecture
> Handbook version 3 states that that ADDx SUBx OUTPUT Exceptions
> (B.3 Mapping to IEEE Standard) should not generate Inexact if INE
> bit is set, the Alpha 21264 [2] chip manual (A.8 IEEE Floating-Point
> Conformance) states that ADDx SUBx OUTPUT does generate inexact
> exception for inexact result regardless.
>
> As Joseph noted [3] to correctly fix it on alpha we need to either
> avoid the instruction or avoid any inexact bit from it being set
> on return from the function (while preserving the inexact bit that
> might be set on the entry to the function). The later will result
> mf_fpcr followed by a mt_fpcr to get and set the fpcr which will
> defeat the optimization itself.
>
> So the patch just remove the alpha optimized and rely on generic
> implementation. It fixes the math/test-*-{trunc} on alpha.
>
> [BZ #15479]
> [BZ #22666]
> * sysdeps/alpha/fpu/s_trunc.c: Remove file.
> * sysdeps/alpha/fpu/s_truncf.c: Likewise.
ACK.
r~