aboutsummaryrefslogtreecommitdiff
path: root/libgcc/fixed-bit.c
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2013-01-14 10:19:00 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2013-01-14 10:19:00 +0000
commit3ffc195810f00c4fe4552910c0c37c3572dfb918 (patch)
tree60119c914860389aae7411b75615337d4973fcd8 /libgcc/fixed-bit.c
parentd471dece67b58f2f3aa29633f85aaf6f8ae1fb78 (diff)
downloadgcc-upstream-3ffc195810f00c4fe4552910c0c37c3572dfb918.tar.gz
fixed-bit.c (SATFRACT): Only declare / set min_low, min_high if TO_MODE_UNSIGNED == 0.
* fixed-bit.c (SATFRACT) <FROM_TYPE=1, TO_TYPE=4>: Only declare / set min_low, min_high if TO_MODE_UNSIGNED == 0. (SATFRACT) <FROM_TYPE=TO_TYPE=4>: Only declare / set min_low, min_high if FROM_MODE_UNSIGNED == 0 and TO_MODE_UNSIGNED == 0. From-SVN: r195141
Diffstat (limited to 'libgcc/fixed-bit.c')
-rw-r--r--libgcc/fixed-bit.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libgcc/fixed-bit.c b/libgcc/fixed-bit.c
index 71243c1295a..7af71b7b051 100644
--- a/libgcc/fixed-bit.c
+++ b/libgcc/fixed-bit.c
@@ -761,11 +761,12 @@ SATFRACT (FROM_FIXED_C_TYPE a)
#if FROM_MODE_UNSIGNED == 0
BIG_SINT_C_TYPE high, low;
BIG_SINT_C_TYPE max_high, max_low;
+#if TO_MODE_UNSIGNED == 0
BIG_SINT_C_TYPE min_high, min_low;
+#endif
#else
BIG_UINT_C_TYPE high, low;
BIG_UINT_C_TYPE max_high, max_low;
- BIG_UINT_C_TYPE min_high, min_low;
#endif
#if TO_FBITS > FROM_FBITS
BIG_UINT_C_TYPE utemp;
@@ -812,13 +813,12 @@ SATFRACT (FROM_FIXED_C_TYPE a)
#endif
#if TO_MODE_UNSIGNED == 0
- min_high = -1;
stemp = (BIG_SINT_C_TYPE)1 << (BIG_WIDTH - 1);
stemp = stemp >> (BIG_WIDTH - 1 - TO_I_F_BITS);
+#if FROM_MODE_UNSIGNED == 0
+ min_high = -1;
min_low = stemp;
-#else
- min_high = 0;
- min_low = 0;
+#endif
#endif
#if FROM_MODE_UNSIGNED == 0 && TO_MODE_UNSIGNED == 0
@@ -957,7 +957,7 @@ FRACT (FROM_INT_C_TYPE a)
#endif /* defined(FRACT) && FROM_TYPE == 1 && TO_TYPE == 4 */
/* Signed int -> Fixed with saturation. */
-#if defined(SATFRACT) && defined(L_satfract) &&FROM_TYPE == 1 && TO_TYPE == 4
+#if defined(SATFRACT) && defined(L_satfract) && FROM_TYPE == 1 && TO_TYPE == 4
TO_FIXED_C_TYPE
SATFRACT (FROM_INT_C_TYPE a)
{
@@ -966,8 +966,8 @@ SATFRACT (FROM_INT_C_TYPE a)
FROM_INT_C_TYPE x = a;
BIG_SINT_C_TYPE high, low;
BIG_SINT_C_TYPE max_high, max_low;
- BIG_SINT_C_TYPE min_high, min_low;
#if TO_MODE_UNSIGNED == 0
+ BIG_SINT_C_TYPE min_high, min_low;
BIG_SINT_C_TYPE stemp;
#endif
#if BIG_WIDTH != TO_FBITS
@@ -1008,12 +1008,7 @@ SATFRACT (FROM_INT_C_TYPE a)
stemp = (BIG_SINT_C_TYPE)1 << (BIG_WIDTH - 1);
stemp = stemp >> (BIG_WIDTH - 1 - TO_I_F_BITS);
min_low = stemp;
-#else
- min_high = 0;
- min_low = 0;
-#endif
-#if TO_MODE_UNSIGNED == 0
/* Signed -> Signed. */
if ((BIG_SINT_C_TYPE) high > (BIG_SINT_C_TYPE) max_high
|| ((BIG_SINT_C_TYPE) high == (BIG_SINT_C_TYPE) max_high