Skip to content

Commit

Permalink
fix sign check
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Nov 15, 2023
1 parent caa84d7 commit a172d99
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/soft_float/int_from_float/__fixtfsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ int32_t __fixtfsi(float128 a) {

flt.ld = a;

// If parameter is zero (or negative zero), then return zero
// If parameter is zero, then simply return zero
if (flt.hex.lower == 0) {
if ((flt.hex.upper == 0) || (flt.hex.upper & (1ULL << 63))) {
// Avoid checking the sign
if ((flt.hex.upper & ~(1ULL << 63)) == 0) {
return 0;
}
}
Expand Down

0 comments on commit a172d99

Please sign in to comment.