public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: Jakub Jelinek <jakub@redhat.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
		Andrew MacLeod <amacleod@redhat.com>,
	Mike Stump <mikestump@comcast.net>,
	stanshebs@earthlink.net, 	Jason Merrill <jason@redhat.com>,
	Richard Henderson <rth@redhat.com>, "jh@suse.cz" <jh@suse.cz>
Subject: Re: Implement C11 _Atomic
Date: Fri, 08 Nov 2013 10:09:00 -0000	[thread overview]
Message-ID: <CAFULd4ZbQ+XOQDvPuXS7j5zsKGvbow6i0rXG4zHVD-KGkV4YHw@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1311071824560.20971@digraph.polyomino.org.uk>

On Thu, Nov 7, 2013 at 7:26 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:

>> Please note that following code form fenv.c won't generate overflow
>> exception on x87:
>>
>>   if (excepts & FP_EX_OVERFLOW)
>>     {
>>       volatile float max = __FLT_MAX__;
>>       r = max * max;
>>     }
>
> r being volatile is intended to ensure that the result does get stored
> back to memory, and so in particular that a result computed with excess
> precision gets converted back to float and the exception is raised.

Can we introduce a target-dependant source here, in the same way as
gfortran has different config/fpu-*.c files? I would like to propose
the code from (recently improved) libgcc/config/i386/sfp-exceptions.c
to generate exceptions on x86 targets. The main benefits of this code
are:
- precision: it generates exactly the exception it is supposed to
generate at the exact spot (x87 and SSE)
- the code doesn't do arithemtics with denormal results
- can also generate non-standard denormal exception

Your proposed code can be considered a generic fallback code then. I'm
sure other targets have their own, perhaps better ways to generate FP
exceptions.

Uros.

  parent reply	other threads:[~2013-11-08  9:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06  0:44 Joseph S. Myers
2013-11-06 22:42 ` Andrew MacLeod
2013-11-07 17:16 ` Uros Bizjak
2013-11-07 17:24 ` Jakub Jelinek
2013-11-07 18:10   ` Uros Bizjak
2013-11-07 18:44     ` Joseph S. Myers
2013-11-07 18:47       ` Uros Bizjak
2013-11-07 18:55         ` Joseph S. Myers
     [not found]           ` <CAFULd4ZrAEECG+pptH8cRaWznioaM9VXS4TetpEvkWj--n7H1w@mail.gmail.com>
2013-11-07 21:02             ` Joseph S. Myers
2013-11-07 21:08               ` Uros Bizjak
2013-11-07 22:25                 ` Uros Bizjak
2013-11-07 22:43                   ` Joseph S. Myers
2013-11-08 10:09       ` Uros Bizjak [this message]
2013-11-08 13:33         ` Joseph S. Myers
2013-11-21 13:19 ` Hans-Peter Nilsson
2013-11-21 18:03   ` Andrew MacLeod
2013-11-21 18:20     ` Hans-Peter Nilsson
2013-11-21 18:30       ` Andrew MacLeod
2013-11-21 18:49         ` Joseph S. Myers
2013-11-21 18:58           ` Andrew MacLeod
2013-11-21 19:24         ` Hans-Peter Nilsson
2013-11-22  2:57         ` Hans-Peter Nilsson
2013-11-22  3:03           ` Andrew MacLeod
2013-11-22  3:32           ` Hans-Peter Nilsson
2013-11-22  3:32             ` Joseph S. Myers
2013-11-22 19:12             ` Andrew MacLeod
2013-11-22 20:01               ` Hans-Peter Nilsson
2013-11-08 13:28 Dominique Dhumieres
2013-11-08 13:34 ` Joseph S. Myers
2013-11-08 13:43   ` Dominique Dhumieres

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFULd4ZbQ+XOQDvPuXS7j5zsKGvbow6i0rXG4zHVD-KGkV4YHw@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=jh@suse.cz \
    --cc=joseph@codesourcery.com \
    --cc=mikestump@comcast.net \
    --cc=rth@redhat.com \
    --cc=stanshebs@earthlink.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).