This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] SPARC: fix nearbyint on sNaN input


From: Aurelien Jarno <aurelien@aurel32.net>
Date: Fri,  1 Jul 2016 00:35:57 +0200

> nearbyint and nearbyintf should not trigger inexact exceptions, but
> should still trigger an invalid exception for a sNaN input.
> 
> The SPARC specific implementations of these functions save the FSR at
> the beginning of the function and restore it at the end to not trigger
> an inexact exception. This however doesn't work for an sNaN input which
> need to trigger an invalid exception. Fix that by adding a fcmp
> instruction using the input value before saving FSR, so that an invalid
> exception is triggered for a sNaN input.
> 
> This fixes the math/test-nearbyint-except test on SPARC.

Looks good.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]