[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] MIPS FP rounding
From: |
Daniel Jacobowitz |
Subject: |
[Qemu-devel] MIPS FP rounding |
Date: |
Wed, 19 Sep 2007 16:41:54 -0400 |
User-agent: |
Mutt/1.5.15 (2007-04-09) |
Thiemo, in May you added this:
- update_fcr31(); \
+ update_fcr31(); \
+ if (GET_FP_CAUSE(env->fcr31) & FP_INVALID) \
+ FST2 = 0x7fbfffff; \
+ else if (GET_FP_CAUSE(env->fcr31) & FP_UNDERFLOW) { \
+ if ((env->fcr31 & 0x3) == 0) \
+ FST2 &= 0x80000000ULL; \
+ } \
That last bit says that if underflow is detected and the rounding mode
is round-to-nearest, return an signed appropriate signed zero. Why?
The MIPS ISA docs say a rounded result is returned in this case, and
that's what's in FST2 if that code is removed.
This shows up in the mul-subnormal-single-1.c test from GCC's ieee.exp.
--
Daniel Jacobowitz
CodeSourcery
- [Qemu-devel] MIPS FP rounding,
Daniel Jacobowitz <=