source:
scripts/fetch/eglibc/2.10.1/25-ldbl-nexttowardf.patch@
7cc51dea
Last change on this file since 7cc51dea was b17b911f, checked in by , 15 years ago | |
---|---|
|
|
File size: 1.8 KB |
-
sysdeps/ieee754/ldbl-128/s_nexttowardf.c
this change was made to generic __nexttowardf, but not the long double version 2008-05-05 Aurelien Jarno <aurelien@aurel32.net> * sysdeps/ieee754/ldbl-128/s_nexttowardf.c: Include float.h. (__nexttowardf): Use math_opt_barrier and math_force_eval macros. If FLT_EVAL_METHOD is not 0, force x to float using asm. --- sysdeps/ieee754/ldbl-128/s_nexttowardf.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
a b 19 19 #endif 20 20 21 21 #include "math.h" 22 #include "math_private.h" 22 #include <math_private.h> 23 #include <float.h> 23 24 24 25 #ifdef __STDC__ 25 26 float __nexttowardf(float x, long double y) … … 44 45 return x+y; 45 46 if((long double) x==y) return y; /* x=y, return y */ 46 47 if(ix==0) { /* x == 0 */ 47 float x2;48 float u; 48 49 SET_FLOAT_WORD(x,(u_int32_t)((hy>>32)&0x80000000)|1);/* return +-minsub*/ 49 x2 = x*x; 50 if(x2==x) return x2; else return x; /* raise underflow flag */ 50 u = math_opt_barrier (x); 51 u = u * u; 52 math_force_eval (u); /* raise underflow flag */ 53 return x; 51 54 } 52 55 if(hx>=0) { /* x > 0 */ 53 56 if(hy<0||(ix>>23)>(iy>>48)-0x3f80 … … 67 70 } 68 71 } 69 72 hy = hx&0x7f800000; 70 if(hy>=0x7f800000) return x+x; /* overflow */ 73 if(hy>=0x7f800000) { 74 x = x+x; /* overflow */ 75 if (FLT_EVAL_METHOD != 0) 76 /* Force conversion to float. */ 77 asm ("" : "+m"(x)); 78 return x; 79 } 71 80 if(hy<0x00800000) { /* underflow */ 72 float x2 = x*x; 73 if(x2!=x) { /* raise underflow flag */ 74 SET_FLOAT_WORD(x2,hx); 75 return x2; 76 } 81 float u = x*x; 82 math_force_eval (u); /* raise underflow flag */ 77 83 } 78 84 SET_FLOAT_WORD(x,hx); 79 85 return x;
Note:
See TracBrowser
for help on using the repository browser.