From owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org  Sat Oct 26 00:18:37 2013
Return-Path: <owner-sc22wg14+sc22wg14-domo2=www.open-std.org@open-std.org>
X-Original-To: sc22wg14-domo2
Delivered-To: sc22wg14-domo2@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 81188358233; Sat, 26 Oct 2013 00:18:37 +0200 (CEST)
Delivered-To: sc22wg14@open-std.org
Received: from outbound-queue-2.mail.thdo.gradwell.net (outbound-queue-2.mail.thdo.gradwell.net [212.11.70.35])
	by www.open-std.org (Postfix) with ESMTP id 39819358230
	for <sc22wg14@open-std.org>; Sat, 26 Oct 2013 00:18:22 +0200 (CEST)
Received: from outbound-edge-1.mail.thdo.gradwell.net (bonnie.gradwell.net [212.11.70.2])
	by outbound-queue-2.mail.thdo.gradwell.net (Postfix) with ESMTP id 51F1E2310B
	for <sc22wg14@open-std.org>; Fri, 25 Oct 2013 23:18:21 +0100 (BST)
Received: from digraph.polyomino.org.uk (HELO digraph.polyomino.org.uk) (81.187.227.50)
  (smtp-auth username postmaster%pop3.polyomino.org.uk, mechanism cram-md5)
  by outbound-edge-1.mail.thdo.gradwell.net (qpsmtpd/0.83) with (AES256-SHA encrypted) ESMTPSA; Fri, 25 Oct 2013 23:18:21 +0100
Received: from jsm28 (helo=localhost)
	by digraph.polyomino.org.uk with local-esmtp (Exim 4.76)
	(envelope-from <jsm@polyomino.org.uk>)
	id 1VZpi0-0005WK-7N
	for sc22wg14@open-std.org; Fri, 25 Oct 2013 22:18:20 +0000
Date: Fri, 25 Oct 2013 22:18:20 +0000 (UTC)
From: "Joseph S. Myers" <jsm@polyomino.org.uk>
X-X-Sender: jsm28@digraph.polyomino.org.uk
To: sc22wg14@open-std.org
Subject: Atomic compound assignment and exact floating-point underflow
Message-ID: <Pine.LNX.4.64.1310252208580.17813@digraph.polyomino.org.uk>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Gradwell-MongoId: 526aee2d.7a01-50c-1
X-Gradwell-Auth-Method: mailbox
X-Gradwell-Auth-Credentials: postmaster@pop3.polyomino.org.uk
Sender: owner-sc22wg14@open-std.org
Precedence: bulk

The following is really an issue to be considered for the floating-point 
TS part 5 rather than an issue with C11 as it stands.

C11 gives a sequence of feholdexcept / atomic_compare_exchange_strong / 
feclearexcept / feupdateenv intended to be equivalent to atomic compound 
assignment when floating point is involved.  The semantics differ from 
those of a true atomic read-modify-write, however, where a floating-point 
value is computed that is tiny but exact, where the underflow exception is 
signaled but the corresponding flag is not raised; in that case, 
feupdateenv will not signal the exception at all.  This difference is 
detectable if an alternate exception handling attribute is in effect that 
permits exact underflow to be detected.

Thus, if the TS part 5 provides C bindings to such alternate exception 
handling, it will need to address the code sequence for compound 
assignment in footnote 113.

-- 
Joseph S. Myers
joseph@codesourcery.com
