提交 9731e287 编写于 作者: R Roel Kluin 提交者: Paul Mundt

SH: catch negative denormal_subf1() retval in denormal_add()

'ix' is unsigned but denormal_subf1() may return a negative int.
Signed-off-by: NRoel Kluin <12o3l@tiscali.nl>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 cdf7da89
...@@ -300,7 +300,7 @@ static int denormal_addf(int hx, int hy) ...@@ -300,7 +300,7 @@ static int denormal_addf(int hx, int hy)
iy = hy & 0x7fffffff; iy = hy & 0x7fffffff;
if (iy < 0x00800000) { if (iy < 0x00800000) {
ix = denormal_subf1(ix, iy); ix = denormal_subf1(ix, iy);
if (ix < 0) { if ((int) ix < 0) {
ix = -ix; ix = -ix;
sign ^= 0x80000000; sign ^= 0x80000000;
} }
...@@ -385,7 +385,7 @@ static long long denormal_addd(long long hx, long long hy) ...@@ -385,7 +385,7 @@ static long long denormal_addd(long long hx, long long hy)
iy = hy & 0x7fffffffffffffffLL; iy = hy & 0x7fffffffffffffffLL;
if (iy < 0x0010000000000000LL) { if (iy < 0x0010000000000000LL) {
ix = denormal_subd1(ix, iy); ix = denormal_subd1(ix, iy);
if (ix < 0) { if ((int) ix < 0) {
ix = -ix; ix = -ix;
sign ^= 0x8000000000000000LL; sign ^= 0x8000000000000000LL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册