catrig[fl].c and inexact
Bruce Evans
brde at optusnet.com.au
Sat May 13 02:05:53 UTC 2017
On Sat, 13 May 2017, Bruce Evans wrote:
> clang-3.9.0 seems to be only partly broken here. Volatile works correctly
> for v = huge*huge and also for v = 1+tiny provided v is static instead of
> auto. It also works to declare 'junk' as __unused.
PS: only __unused on an auto volatile variable gives the intended but not
quite wanted behaviour, by reminding the compiler than assignments to
volatile variables are used, by spelling 'used' as __unused. This results
in assigning to a variable on the stack in most cases, so there is no
wastage of static space. Normal FP operations like this are usually the
fastest way to set FP exception flags (50-100 times faster than an fenv
access on i386). The only sub-optimal part is assigning the result to
memory.
Bruce
More information about the freebsd-numerics
mailing list