From owner-freebsd-numerics@freebsd.org Sat May 13 02:05:53 2017 Return-Path: Delivered-To: freebsd-numerics@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C56D4D6AF8A for ; Sat, 13 May 2017 02:05:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id B33BAB7 for ; Sat, 13 May 2017 02:05:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: by mailman.ysv.freebsd.org (Postfix) id B2ACCD6AF89; Sat, 13 May 2017 02:05:53 +0000 (UTC) Delivered-To: numerics@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B23B5D6AF88; Sat, 13 May 2017 02:05:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7E5D7B6; Sat, 13 May 2017 02:05:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 847803CB4B9; Sat, 13 May 2017 11:44:45 +1000 (AEST) Date: Sat, 13 May 2017 11:44:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Steve Kargl , numerics@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: catrig[fl].c and inexact In-Reply-To: <20170513103208.M845@besplex.bde.org> Message-ID: <20170513113852.M1045@besplex.bde.org> References: <20170512215654.GA82545@troutmask.apl.washington.edu> <20170513103208.M845@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=UZVNq-k9JjFpydrfkmMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 May 2017 02:05:53 -0000 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