From: Joseph Myers Date: Sat, 12 Oct 2013 12:17:16 +0000 (+0000) Subject: soft-fp: fix floating-point to integer unsigned saturation. X-Git-Tag: glibc-2.19~613 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99fd9f47effcd18489528e895c08b58ed24d6505;p=thirdparty%2Fglibc.git soft-fp: fix floating-point to integer unsigned saturation. --- diff --git a/ChangeLog b/ChangeLog index 5090784cf05..7df0ae9cfed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-10-12 Joseph Myers + + * soft-fp/op-common.h (_FP_TO_INT): Reverse test of sign for + computing saturated result for unsigned overflow. + 2013-10-11 Siddhesh Poyarekar Jeff Law diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h index 5dfb73c1853..dbc107773e5 100644 --- a/soft-fp/op-common.h +++ b/soft-fp/op-common.h @@ -1284,7 +1284,7 @@ do { \ r -= 1 - X##_s; \ } else { \ r = 0; \ - if (X##_s) \ + if (!X##_s) \ r = ~r; \ } \ \