Jon Beniston
2018-06-20 16:04:32 UTC
Hi,
The following is a patch for round on 16-bit CPUs to avoid a shift being out
of range:
libm/common/s_round.c (round): Make constant long so shift isn't out of
range on 16-bit CPUs
---
newlib/libm/common/s_round.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/newlib/libm/common/s_round.c b/newlib/libm/common/s_round.c
index 047574a84..f0926d85f 100644
--- a/newlib/libm/common/s_round.c
+++ b/newlib/libm/common/s_round.c
@@ -68,7 +68,7 @@ SEEALSO
msw &= 0x80000000;
if (exponent_less_1023 == -1)
/* Result is +1.0 or -1.0. */
- msw |= (1023 << 20);
+ msw |= (1023L << 20);
lsw = 0;
}
else
The following is a patch for round on 16-bit CPUs to avoid a shift being out
of range:
libm/common/s_round.c (round): Make constant long so shift isn't out of
range on 16-bit CPUs
---
newlib/libm/common/s_round.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/newlib/libm/common/s_round.c b/newlib/libm/common/s_round.c
index 047574a84..f0926d85f 100644
--- a/newlib/libm/common/s_round.c
+++ b/newlib/libm/common/s_round.c
@@ -68,7 +68,7 @@ SEEALSO
msw &= 0x80000000;
if (exponent_less_1023 == -1)
/* Result is +1.0 or -1.0. */
- msw |= (1023 << 20);
+ msw |= (1023L << 20);
lsw = 0;
}
else
--
2.15.1
2.15.1