public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Steve Ellcey <sellcey@imgtec.com>, <gcc-patches@gcc.gnu.org>,
	Catherine Moore <clm@codesourcery.com>,
	Matthew Fortune <matthew.fortune@imgtec.com>
Subject: Re: [Patch, MIPS] Enable fp-contract on MIPS and update -mfused-madd
Date: Mon, 15 Jun 2015 21:37:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.10.1506152047390.9772@digraph.polyomino.org.uk> (raw)
In-Reply-To: <alpine.LFD.2.11.1506152042580.5418@eddie.linux-mips.org>

On Mon, 15 Jun 2015, Maciej W. Rozycki wrote:

> operands negated.  That negation, implemented with the IEEE Std 754-2008 
> `negate' operation that you referred to, by definition is required to 
> operate on the sign of its operand in a specific way even if the operand 
> is a qNaN.
> 
>  So for example `fmsM4', that is specified at the RTL level as (fma:M OP1 
> OP2 (neg:M OP3)) will not produce the correct result with the fused 
> version of the MIPS MSUB.fmt instruction in the case where OP1 and OP2 are 
> numeric data patterns and OP3 is a qNaN data pattern that has its sign bit 
> clear.  As specified by IEEE Std 754-2008 the (neg:M OP3) operation is 
> required to invert the sign bit of the qNaN data pattern in calculating 
> TMP3, and then the (fma:M OP1 OP2 TMP3) operation is required to pass the 
> TMP3 qNaN data pattern unchanged in calculating the final result.

It is only required (well, recommended) to pass the *payload*.  The sign 
bit is not part of the payload.  "For all other operations, this standard 
does not specify the sign bit of a NaN result, even when there is only one 
input NaN, or when the NaN is produced from an invalid operation.".

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2015-06-15 20:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 20:09 Steve Ellcey 
2015-06-11 20:39 ` Joseph Myers
2015-06-15 20:52   ` Maciej W. Rozycki
2015-06-15 21:37     ` Joseph Myers [this message]
2015-06-15 22:00       ` Maciej W. Rozycki
2015-06-15 22:09         ` Joseph Myers
2015-06-16 12:19           ` Maciej W. Rozycki
2015-06-16 12:26             ` Joseph Myers
2015-06-16 13:28               ` Maciej W. Rozycki
2015-06-16 16:13                 ` Joseph Myers
2015-06-17 10:43                 ` Richard Sandiford
2015-06-17 17:45                   ` Steve Ellcey
2015-06-17 18:44                     ` Maciej W. Rozycki
2015-06-17 18:52                       ` Richard Sandiford
2015-06-17 21:09                         ` Steve Ellcey
2015-06-17 22:06                           ` Matthew Fortune
2015-06-18 12:32                             ` Maciej W. Rozycki
2015-06-18 16:02                               ` Steve Ellcey
2015-06-29 16:10                                 ` Maciej W. Rozycki
2015-06-29 19:07                                   ` Matthew Fortune
2015-06-29 19:46                                     ` Moore, Catherine
2015-07-06 17:35                                     ` Steve Ellcey
2015-06-30  7:35                                   ` Richard Biener
2015-06-18 12:04                         ` Maciej W. Rozycki
2015-06-17 19:51                       ` Steve Ellcey

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=alpine.DEB.2.10.1506152047390.9772@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=clm@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=macro@linux-mips.org \
    --cc=matthew.fortune@imgtec.com \
    --cc=sellcey@imgtec.com \
    /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).