diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 16:03:01 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 16:03:01 +0000 |
commit | 14970231a38310b9561052a67b617138eeaad300 (patch) | |
tree | 35c201a651afa5d5e4fff241280081b3f88b9c2c /sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S | |
parent | f08c7420b5e8b017a1a47b880a62b15bdc588f4d (diff) | |
parent | 25ead03a3712d57df2208fe82f3d316eb8faeaf6 (diff) |
Merge commit 'refs/top-bases/t/extern_inline' into t/extern_inline
Diffstat (limited to 'sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S')
-rw-r--r-- | sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S index 107b035a24..113ee81309 100644 --- a/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S +++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S @@ -1,5 +1,5 @@ /* Round to int floating-point values. PowerPC32 version. - Copyright (C) 2011-2016 Free Software Foundation, Inc. + Copyright (C) 2011-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Adhemerval Zanella <azanella@br.ibm.com>, 2011 @@ -21,6 +21,7 @@ when it's coded in C. */ #include <sysdep.h> +#include <libm-alias-float.h> /* float [fp1] nearbyintf(float [fp1] x) */ @@ -48,7 +49,7 @@ ENTRY (__nearbyintf) fabs fp0,fp1 fsub fp12,fp13,fp13 /* generate 0.0 */ fcmpu cr7,fp0,fp13 /* if (fabs(x) > TWO23 */ - bgelr cr7 + bge cr7,.L10 fcmpu cr7,fp1,fp12 /* if (x > 0.0 */ ble cr7,L(lessthanzero) mffs fp11 @@ -67,6 +68,12 @@ L(lessthanzero): fnabs fp1,fp1 /* if (x == 0.0) */ mtfsf 0xff,fp11 /* Restore FE_INEXACT state. */ blr +.L10: + /* Ensure sNaN input is converted to qNaN. */ + fcmpu cr7,fp1,fp1 + beqlr cr7 + fadds fp1,fp1,fp1 + blr END (__nearbyintf) -weak_alias (__nearbyintf, nearbyintf) +libm_alias_float (__nearbyint, nearbyint) |