summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1999-06-19 11:54:35 +0000
committerdfr <dfr@FreeBSD.org>1999-06-19 11:54:35 +0000
commit5033931c400e33f558a892300212145377803409 (patch)
treeb31408f18ddbd23026e78ebf641402cdf9adeff6
parent4c5e0997f865134edfcb2d2954532fbf57eb9142 (diff)
downloadFreeBSD-src-5033931c400e33f558a892300212145377803409.zip
FreeBSD-src-5033931c400e33f558a892300212145377803409.tar.gz
Convert signalling NaNs to quiet NaNs as specified by the Alpha Architecture
Reference Manual. Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
-rw-r--r--sys/alpha/alpha/ieee_float.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/alpha/alpha/ieee_float.c b/sys/alpha/alpha/ieee_float.c
index 293c6ea..fe660e2 100644
--- a/sys/alpha/alpha/ieee_float.c
+++ b/sys/alpha/alpha/ieee_float.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ieee_float.c,v 1.3 1999/05/10 16:02:11 peter Exp $
+ * $Id: ieee_float.c,v 1.4 1999/06/14 11:42:30 simokawa Exp $
*/
/*
@@ -438,8 +438,10 @@ ieee_add(fp_register_t fa, fp_register_t fb,
result.t.fraction |= QNAN_BIT;
} else if (isQNaN(fa))
result = fa;
- else if (isSNaN(fa))
+ else if (isSNaN(fa)) {
result = fa;
+ result.t.fraction |= QNAN_BIT;
+ }
/* If either operand is a signalling NaN, trap. */
if (isSNaN(fa) || isSNaN(fb))
@@ -568,9 +570,11 @@ ieee_mul(fp_register_t fa, fp_register_t fb,
result.t.fraction |= QNAN_BIT;
} else if (isQNaN(fa))
result = fa;
- else if (isSNaN(fa))
+ else if (isSNaN(fa)) {
result = fa;
-
+ result.t.fraction |= QNAN_BIT;
+ }
+
/* If either operand is a signalling NaN, trap. */
if (isSNaN(fa) || isSNaN(fb))
*status |= FPCR_INV;
@@ -736,8 +740,10 @@ ieee_div(fp_register_t fa, fp_register_t fb,
result.t.fraction |= QNAN_BIT;
} else if (isQNaN(fa))
result = fa;
- else if (isSNaN(fa))
+ else if (isSNaN(fa)) {
result = fa;
+ result.t.fraction |= QNAN_BIT;
+ }
/* If either operand is a signalling NaN, trap. */
if (isSNaN(fa) || isSNaN(fb))
OpenPOWER on IntegriCloud