aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-fpu.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-03-15 03:16:17 +0000
committerMike Frysinger <vapier@gentoo.org>2011-03-15 03:16:17 +0000
commit028f6515424e832ee10a1e4cb1f96ea241e2acae (patch)
treec8ce68621a3ed2425b8dde4e2f523cbae0bf11fe /sim/common/sim-fpu.c
parent7f35e991971df570411a2688b948cd72adb4cf90 (diff)
downloadgdb-028f6515424e832ee10a1e4cb1f96ea241e2acae.zip
gdb-028f6515424e832ee10a1e4cb1f96ea241e2acae.tar.gz
gdb-028f6515424e832ee10a1e4cb1f96ea241e2acae.tar.bz2
sim: common: trim trailing whitespace
Diffstat (limited to 'sim/common/sim-fpu.c')
-rw-r--r--sim/common/sim-fpu.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c
index 53f6bcd..be4336b 100644
--- a/sim/common/sim-fpu.c
+++ b/sim/common/sim-fpu.c
@@ -43,7 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-assert.h"
-/* Debugging support.
+/* Debugging support.
If digits is -1, then print all digits. */
static void
@@ -78,7 +78,7 @@ print_bits (unsigned64 x,
typedef union {
double d;
unsigned64 i;
-} sim_fpu_map;
+} sim_fpu_map;
/* A packed IEEE floating point number.
@@ -94,7 +94,7 @@ typedef union {
Zero (0 == BIASEDEXP && FRAC == 0):
(sign ? "-" : "+") 0.0
-
+
Infinity (BIASEDEXP == EXPMAX && FRAC == 0):
(sign ? "-" : "+") "infinity"
@@ -254,7 +254,7 @@ pack_fpu (const sim_fpu *src,
/* Infinity */
sign = src->sign;
exp = EXPMAX;
- fraction = 0;
+ fraction = 0;
}
else
{
@@ -309,7 +309,7 @@ pack_fpu (const sim_fpu *src,
(long) LSEXTRACTED32 (packed, 23 - 1, 0));
}
#endif
-
+
return packed;
}
@@ -536,7 +536,7 @@ i2fpu (sim_fpu *f, signed64 i, int is_64bit)
f->sign = (i < 0);
f->normal_exp = NR_FRAC_GUARD;
- if (f->sign)
+ if (f->sign)
{
/* Special case for minint, since there is no corresponding
+ve integer representation for it */
@@ -553,7 +553,7 @@ i2fpu (sim_fpu *f, signed64 i, int is_64bit)
if (f->fraction >= IMPLICIT_2)
{
- do
+ do
{
f->fraction = (f->fraction >> 1) | (f->fraction & 1);
f->normal_exp += 1;
@@ -896,7 +896,7 @@ do_round (sim_fpu *f,
return 0;
break;
case sim_fpu_class_snan:
- /* Quieten a SignalingNaN */
+ /* Quieten a SignalingNaN */
f->class = sim_fpu_class_qnan;
return sim_fpu_status_invalid_snan;
break;
@@ -1371,14 +1371,14 @@ sim_fpu_mul (sim_fpu *f,
res2 += ((ps_hh__ >> 32) & 0xffffffff) + pp_hh;
high = res2;
low = res0;
-
+
f->normal_exp = l->normal_exp + r->normal_exp;
f->sign = l->sign ^ r->sign;
f->class = sim_fpu_class_number;
/* Input is bounded by [1,2) ; [2^60,2^61)
Output is bounded by [1,4) ; [2^120,2^122) */
-
+
/* Adjust the exponent according to where the decimal point ended
up in the high 64 bit word. In the source the decimal point
was at NR_FRAC_GUARD. */
@@ -1511,7 +1511,7 @@ sim_fpu_div (sim_fpu *f,
f->normal_exp--;
}
ASSERT (numerator >= denominator);
-
+
/* Gain extra precision, already used one spare bit */
numerator <<= NR_SPARE;
denominator <<= NR_SPARE;
@@ -1610,7 +1610,7 @@ sim_fpu_max (sim_fpu *f,
}
ASSERT (l->sign == r->sign);
if (l->normal_exp > r->normal_exp
- || (l->normal_exp == r->normal_exp &&
+ || (l->normal_exp == r->normal_exp &&
l->fraction > r->fraction))
{
/* |l| > |r| */
@@ -1693,7 +1693,7 @@ sim_fpu_min (sim_fpu *f,
}
ASSERT (l->sign == r->sign);
if (l->normal_exp > r->normal_exp
- || (l->normal_exp == r->normal_exp &&
+ || (l->normal_exp == r->normal_exp &&
l->fraction > r->fraction))
{
/* |l| > |r| */
@@ -1808,20 +1808,20 @@ sim_fpu_sqrt (sim_fpu *f,
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
+ * software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
-
+
/* __ieee754_sqrt(x)
* Return correctly rounded sqrt.
* ------------------------------------------
* | Use the hardware sqrt if you have one |
* ------------------------------------------
- * Method:
- * Bit by bit method using integer arithmetic. (Slow, but portable)
+ * Method:
+ * Bit by bit method using integer arithmetic. (Slow, but portable)
* 1. Normalization
- * Scale x to y in [1,4) with even powers of 2:
+ * Scale x to y in [1,4) with even powers of 2:
* find an integer k such that 1 <= (y=x*2^(2k)) < 4, then
* sqrt(x) = 2^k * sqrt(y)
-
@@ -1841,9 +1841,9 @@ sim_fpu_sqrt (sim_fpu *f,
* i+1 2
* s = 2*q , and y = 2 * ( y - q ). (1)
* i i i i
- *
- * To compute q from q , one checks whether
- * i+1 i
+ *
+ * To compute q from q , one checks whether
+ * i+1 i
*
* -(i+1) 2
* (q + 2 ) <= y. (2)
@@ -1853,12 +1853,12 @@ sim_fpu_sqrt (sim_fpu *f,
* i+1 i i+1 i
*
* With some algebric manipulation, it is not difficult to see
- * that (2) is equivalent to
+ * that (2) is equivalent to
* -(i+1)
* s + 2 <= y (3)
* i i
*
- * The advantage of (3) is that s and y can be computed by
+ * The advantage of (3) is that s and y can be computed by
* i i
* the following recurrence formula:
* if (3) is false
@@ -1874,15 +1874,15 @@ sim_fpu_sqrt (sim_fpu *f,
* -i -(i+1)
* s = s + 2 , y = y - s - 2 (5)
* i+1 i i+1 i i
- *
+ *
-
- -(i+1)
- - NOTE: y = 2 (y - s - 2 )
+ - NOTE: y = 2 (y - s - 2 )
- i+1 i i
-
- * One may easily use induction to prove (4) and (5).
+ * One may easily use induction to prove (4) and (5).
* Note. Since the left hand side of (3) contain only i+2 bits,
- * it does not necessary to do a full (53-bit) comparison
+ * it does not necessary to do a full (53-bit) comparison
* in (3).
* 3. Final rounding
* After generating the 53 bits result, we compute one more bit.
@@ -1892,7 +1892,7 @@ sim_fpu_sqrt (sim_fpu *f,
* The rounding mode can be detected by checking whether
* huge + tiny is equal to huge, and whether huge - tiny is
* equal to huge for some floating point number "huge" and "tiny".
- *
+ *
* Special cases:
* sqrt(+-0) = +-0 ... exact
* sqrt(inf) = inf
@@ -1927,7 +1927,7 @@ sim_fpu_sqrt (sim_fpu *f,
b = IMPLICIT_1;
q = 0;
s = 0;
-
+
while (b)
{
unsigned64 t = s + b;