source: scripts/fetch/eglibc/2.10.1/25-ldbl-nexttowardf.patch@ 5bc27c8

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 5bc27c8 was b17b911f, checked in by jim <clfs@…>, 16 years ago

Updated eglibc fetch script.

  • Property mode set to 100644
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  
    1919#endif
    2020
    2121#include "math.h"
    22 #include "math_private.h"
     22#include <math_private.h>
     23#include <float.h>
    2324
    2425#ifdef __STDC__
    2526        float __nexttowardf(float x, long double y)
     
    4445           return x+y;
    4546        if((long double) x==y) return y;        /* x=y, return y */
    4647        if(ix==0) {                             /* x == 0 */
    47             float x2;
     48            float u;
    4849            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;
    5154        }
    5255        if(hx>=0) {                             /* x > 0 */
    5356            if(hy<0||(ix>>23)>(iy>>48)-0x3f80
     
    6770            }
    6871        }
    6972        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        }
    7180        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 */
    7783        }
    7884        SET_FLOAT_WORD(x,hx);
    7985        return x;
Note: See TracBrowser for help on using the repository browser.