linux-mips
[Top] [All Lists]

Re: [PATCH] Fix abs.[sd] and neg.[sd] emulation for NaN operands

To: chris@mips.com
Subject: Re: [PATCH] Fix abs.[sd] and neg.[sd] emulation for NaN operands
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed, 12 May 2010 00:45:12 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <4BE85256.9010709@mips.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20091012215718.30362.67068.stgit@localhost.localdomain> <20100510.234946.229279777.anemo@mba.ocn.ne.jp> <4BE85256.9010709@mips.com>
Sender: linux-mips-bounce@linux-mips.org
On Mon, 10 May 2010 11:37:10 -0700, Chris Dearman <chris@mips.com> wrote:
> >>    if (xc == IEEE754_CLASS_SNAN) {
> >> -          SETCX(IEEE754_INVALID_OPERATION);
> >> -          return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
> >> +          return ieee754dp_nanxcpt(ieee754dp_indef(), "abs");
> >>    }
...
> 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.

ieee754d/sp_nanxcpt will set the invalid exception bit if its first
argument was a signaling NaN.  And ieee754dp/sp_indef() is a quiet
NaN.

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>