From e13dd54f7ad37f312638c1f9d2ef00a15fbf0830 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 28 Nov 2005 13:41:38 +0000 Subject: fp-bit.h (LSHIFT): Take shift count parameter. * config/fp-bit.h (LSHIFT): Take shift count parameter. * config/fp-bit.c (_fpadd_parts): Shift in one go instead of one bit at a time. From-SVN: r107602 --- gcc/config/fp-bit.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'gcc/config/fp-bit.c') diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c index ccf927e..cf943da 100644 --- a/gcc/config/fp-bit.c +++ b/gcc/config/fp-bit.c @@ -649,6 +649,7 @@ _fpadd_parts (fp_number_type * a, they're the same */ { int diff; + int sdiff; a_normal_exp = a->normal_exp; b_normal_exp = b->normal_exp; @@ -656,21 +657,21 @@ _fpadd_parts (fp_number_type * a, b_fraction = b->fraction.ll; diff = a_normal_exp - b_normal_exp; + sdiff = diff; if (diff < 0) diff = -diff; if (diff < FRAC_NBITS) { - /* ??? This does shifts one bit at a time. Optimize. */ - while (a_normal_exp > b_normal_exp) + if (sdiff > 0) { - b_normal_exp++; - LSHIFT (b_fraction); + b_normal_exp += diff; + LSHIFT (b_fraction, diff); } - while (b_normal_exp > a_normal_exp) + else if (sdiff < 0) { - a_normal_exp++; - LSHIFT (a_fraction); + a_normal_exp += diff; + LSHIFT (a_fraction, diff); } } else @@ -731,7 +732,7 @@ _fpadd_parts (fp_number_type * a, if (tmp->fraction.ll >= IMPLICIT_2) { - LSHIFT (tmp->fraction.ll); + LSHIFT (tmp->fraction.ll, 1); tmp->normal_exp++; } return tmp; -- cgit v1.1