All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Dearman <chris@mips.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH] Fix abs.[sd] and neg.[sd] emulation for NaN operands
Date: Mon, 10 May 2010 11:37:10 -0700	[thread overview]
Message-ID: <4BE85256.9010709@mips.com> (raw)
In-Reply-To: <20100510.234946.229279777.anemo@mba.ocn.ne.jp>

Atsushi Nemoto wrote:
> Excuse me for too late comment.
> 
> On Mon, 12 Oct 2009 14:57:18 -0700, Chris Dearman <chris@mips.com> wrote:
>> From: Nigel Stephens <nigel@mips.com>
>>
>> This patch ensures that the sign bit is always updated
>> for NaN operands.
> ...
>> @@ -76,15 +74,12 @@ ieee754dp ieee754dp_abs(ieee754dp x)
>>  	CLEARCX;
>>  	FLUSHXDP;
>>  
>> +	/* Clear sign ALWAYS, irrespective of NaN */
>> +	DPSIGN(x) = 0;
>> +
>>  	if (xc == IEEE754_CLASS_SNAN) {
>> -		SETCX(IEEE754_INVALID_OPERATION);
>> -		return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
>> +		return ieee754dp_nanxcpt(ieee754dp_indef(), "abs");
>>  	}
>>  
>> -	if (ieee754dp_isnan(x))	/* but not infinity */
>> -		return ieee754dp_nanxcpt(x, "abs", x);
>> -
>> -	/* quick fix up */
>> -	DPSIGN(x) = 0;
>>  	return x;
>>  }
> 
> Is there any reason for removal of SETCX(IEEE754_INVALID_OPERATION)
> line here?
> 
> The older version of this fix ("Fix absd emulation" by Raghu Gandham)
> did not remove the line.
> 
> Without this line, a signaling NaN will not raise a signal.  It seems
> not expected behaviour.

ieee754dp/sp_nanxcpt also sets the invalid exception bit so I think this 
is duplicated code. I think the same fix should have been applied to 
ieee754sp_neg/ieee754dp_neg for consistency.

Chris

-- 
Chris Dearman               Desk: +1 408 530 5092  Cell: +1 408 398 5531
MIPS Technologies Inc            955 East Arques Ave, Sunnyvale CA 94085

  reply	other threads:[~2010-05-10 18:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10  8:50 [PATCH] Fix absd emulation Raghu Gandham
2009-10-12 16:15 ` Ralf Baechle
2009-10-12 21:57   ` Chris Dearman
2009-10-12 21:57     ` [PATCH] Fix abs.[sd] and neg.[sd] emulation for NaN operands Chris Dearman
2010-05-10 14:49       ` Atsushi Nemoto
2010-05-10 18:37         ` Chris Dearman [this message]
2010-05-11 15:45           ` Atsushi Nemoto
2010-05-12  1:30             ` Chris Dearman
2010-05-12  1:30             ` [PATCH] Restore signalling NaN behaviour for abs.[sd] Chris Dearman
2010-05-14  4:48               ` Atsushi Nemoto
2010-05-22  7:15               ` Ralf Baechle

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=4BE85256.9010709@mips.com \
    --to=chris@mips.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.