/picolibc-3.7.0-3.6.0/newlib/libm/math/ |
D | sf_fmod.c | 32 __int32_t n, hx, hy, hz, ix, iy, sx, i; in fmodf() local 34 GET_FLOAT_WORD(hx, x); in fmodf() 36 sx = hx & 0x80000000; /* sign of x */ in fmodf() 37 hx ^= sx; /* |x| */ in fmodf() 50 if (hx < hy) in fmodf() 52 if (hx == hy) in fmodf() 58 if (FLT_UWORD_IS_SUBNORMAL(hx)) { /* subnormal x */ in fmodf() 59 for (ix = -126, i = (hx << 8); i > 0; i <<= 1) in fmodf() 62 ix = (hx >> 23) - 127; in fmodf() 73 hx = 0x00800000 | (0x007fffff & hx); in fmodf() [all …]
|
D | s_fmod.c | 31 __int32_t n, hx, hy, hz, ix, iy, sx, i; in fmod64() local 34 EXTRACT_WORDS(hx, lx, x); in fmod64() 36 sx = hx & 0x80000000; /* sign of x */ in fmod64() 37 hx ^= sx; /* |x| */ in fmod64() 50 if (hx <= hy) { in fmod64() 51 if ((hx < hy) || (lx < ly)) in fmod64() 58 if (hx < 0x00100000) { /* subnormal x */ in fmod64() 59 if (hx == 0) { in fmod64() 63 for (ix = -1022, i = (hx << 11); i > 0; i <<= 1) in fmod64() 67 ix = (hx >> 20) - 1023; in fmod64() [all …]
|
D | sf_log10.c | 27 __int32_t i, k, hx; in log10f() local 29 GET_FLOAT_WORD(hx, x); in log10f() 32 if (FLT_UWORD_IS_ZERO(hx & 0x7fffffff)) in log10f() 34 if (hx < 0) in log10f() 36 if (!FLT_UWORD_IS_FINITE(hx)) in log10f() 38 if (FLT_UWORD_IS_SUBNORMAL(hx)) { in log10f() 41 GET_FLOAT_WORD(hx, x); in log10f() 43 k += (hx >> 23) - 127; in log10f() 45 hx = (hx & 0x007fffff) | ((0x7f - i) << 23); in log10f() 47 SET_FLOAT_WORD(x, hx); in log10f()
|
D | s_log10.c | 61 __int32_t i, k, hx; in log1064() local 64 EXTRACT_WORDS(hx, lx, x); in log1064() 67 if (hx < 0x00100000) { /* x < 2**-1022 */ in log1064() 68 if (((hx & 0x7fffffff) | lx) == 0) in log1064() 70 if (hx < 0) in log1064() 74 GET_HIGH_WORD(hx, x); in log1064() 76 if (hx >= 0x7ff00000) in log1064() 78 k += (hx >> 20) - 1023; in log1064() 80 hx = (hx & 0x000fffff) | ((0x3ff - i) << 20); in log1064() 82 SET_HIGH_WORD(x, hx); in log1064()
|
/picolibc-3.7.0-3.6.0/newlib/libm/ld/ld128/ |
D | e_fmodl.c | 26 int64_t n,hx,hy,hz,ix,iy,sx,i; in fmodl() local 29 GET_LDOUBLE_WORDS64(hx,lx,x); in fmodl() 31 sx = hx&0x8000000000000000ULL; /* sign of x */ in fmodl() 32 hx ^=sx; /* |x| */ in fmodl() 44 if(hx<=hy) { in fmodl() 45 if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */ in fmodl() 51 if(hx<0x0001000000000000LL) { /* subnormal x */ in fmodl() 52 if(hx==0) { in fmodl() 55 for (ix = -16382, i=hx<<15; i>0; i<<=1) ix -=1; in fmodl() 57 } else ix = (hx>>48)-0x3fff; in fmodl() [all …]
|
D | s_remquol.c | 25 #define SET_NBIT(hx) ((hx) | (1ULL << LDBL_MANH_SIZE)) argument 29 #define SET_NBIT(hx) (hx) argument 53 int64_t hx,hz,hy,_hx; in remquol() local 58 GET_LDOUBLE_WORDS64(hx,lx,x); in remquol() 60 sx = (hx>>48)&0x8000; in remquol() 62 hx &= 0x7fffffffffffffffLL; /* |x| */ in remquol() 64 SET_LDOUBLE_WORDS64(x,hx,lx); in remquol() 69 ((hx>>48) == BIAS + LDBL_MAX_EXP) || /* or x not finite */ in remquol() 73 if((hx>>48)<=(hy>>48)) { in remquol() 74 if(((hx>>48)<(hy>>48)) || in remquol() [all …]
|
D | s_nextafterl.c | 25 int64_t hx,hy,ix,iy; in nextafterl() local 28 GET_LDOUBLE_WORDS64(hx,lx,x); in nextafterl() 30 ix = hx&0x7fffffffffffffffLL; /* |x| */ in nextafterl() 42 if(hx>=0) { /* x > 0 */ in nextafterl() 43 if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */ in nextafterl() 44 if(lx==0) hx--; in nextafterl() 48 if(lx==0) hx++; in nextafterl() 51 if(hy>=0||hx>hy||((hx==hy)&&(lx>ly))){/* x < y, x -= ulp */ in nextafterl() 52 if(lx==0) hx--; in nextafterl() 56 if(lx==0) hx++; in nextafterl() [all …]
|
D | s_nexttowardf.c | 18 int32_t hx,ix; in nexttowardf() local 22 GET_FLOAT_WORD(hx,x); in nexttowardf() 24 ix = hx&0x7fffffff; /* |x| */ in nexttowardf() 40 if(hx>=0) { /* x > 0 */ in nexttowardf() 42 hx -= 1; in nexttowardf() 44 hx += 1; in nexttowardf() 48 hx -= 1; in nexttowardf() 50 hx += 1; in nexttowardf() 53 ix = hx&0x7f800000; in nexttowardf() 55 return __math_oflowf(hx<0); in nexttowardf() [all …]
|
/picolibc-3.7.0-3.6.0/newlib/libm/ld/ld80/ |
D | s_nextafterl.c | 25 u_int32_t hx,hy,ix,iy; in nextafterl() local 29 GET_LDOUBLE_WORDS(esx,hx,lx,x); in nextafterl() 34 if (((ix==0x7fff)&&(((hx&0x7fffffff)|lx)!=0)) || /* x is nan */ in nextafterl() 38 if((ix|hx|lx)==0) { /* x == 0 */ in nextafterl() 39 SET_LDOUBLE_WORDS(x,esy & 0x8000,hx,1); in nextafterl() 44 if(esy<0||(ix>iy||((ix==iy) && (hx>hy||((hx==hy)&&(lx>ly)))))) { in nextafterl() 47 if ((hx&0x7fffffff)==0) esx -= 1; in nextafterl() 48 hx = (hx - 1) | (hx & 0x80000000); in nextafterl() 54 hx = (hx + 1) | (hx & 0x80000000); in nextafterl() 55 if ((hx&0x7fffffff)==0) esx += 1; in nextafterl() [all …]
|
D | s_remquol.c | 24 #define SET_NBIT(hx) ((hx) | (1ULL << LDBL_MANH_SIZE)) argument 27 #define SET_NBIT(hx) (hx) argument 51 int64_t hx,hz; /* We need a carry bit even if LDBL_MANH_SIZE is 32. */ in remquol() local 57 GET_LDOUBLE_WORDS(esx,hx,lx,x); in remquol() 76 (hx<=hy && in remquol() 77 (hx<hy || in remquol() 82 if(hx==hy && lx==ly) { in remquol() 91 GET_LDOUBLE_WORDS(esx,hx,lx,x); in remquol() 107 hx = SET_NBIT(hx); in remquol() 115 hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1; in remquol() [all …]
|
D | s_nexttowardf.c | 18 int32_t hx,ix,iy; in nexttowardf() local 21 GET_FLOAT_WORD(hx,x); in nexttowardf() 23 ix = hx&0x7fffffff; /* |x| */ in nexttowardf() 36 if(hx>=0) { /* x > 0 */ in nexttowardf() 38 hx -= 1; in nexttowardf() 40 hx += 1; in nexttowardf() 44 hx -= 1; in nexttowardf() 46 hx += 1; in nexttowardf() 49 hy = hx&0x7f800000; in nexttowardf() 51 return __math_oflowf(hx<0); in nexttowardf() [all …]
|
D | s_nexttoward.c | 25 int32_t hx,ix,iy; in nexttoward() local 28 EXTRACT_WORDS(hx,lx,x); in nexttoward() 30 ix = hx&0x7fffffff; /* |x| */ in nexttoward() 43 if(hx>=0) { /* x > 0 */ in nexttoward() 45 if(lx==0) hx -= 1; in nexttoward() 49 if(lx==0) hx += 1; in nexttoward() 53 if(lx==0) hx -= 1; in nexttoward() 57 if(lx==0) hx += 1; in nexttoward() 60 hy = hx&0x7ff00000; in nexttoward() 62 return __math_oflow(hx<0); in nexttoward() [all …]
|
D | e_fmodl.c | 25 #define SET_NBIT(hx) ((hx) | (1ULL << LDBL_MANH_SIZE)) argument 29 #define SET_NBIT(hx) (hx) argument 54 int64_t hx,hz; /* We need a carry bit even if LDBL_MANH_SIZE is 32. */ in fmodl() local 102 hx = SET_NBIT(ux.bits.ext_frach); in fmodl() 111 hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1; in fmodl() 112 if(hz<0){hx = hx+hx+(lx>>MANL_SHIFT); lx = lx+lx;} in fmodl() 116 hx = hz+hz+(lz>>MANL_SHIFT); lx = lz+lz; in fmodl() 119 hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1; in fmodl() 120 if(hz>=0) {hx=hz;lx=lz;} in fmodl() 123 if((hx|lx)==0) /* return sign(x)*0 */ in fmodl() [all …]
|
/picolibc-3.7.0-3.6.0/newlib/libm/common/ |
D | s_remquo.c | 88 __int32_t n,hx,hy,hz,ix,iy,sx,i; in remquo64() local 91 EXTRACT_WORDS(hx,lx,x); in remquo64() 93 sxy = (hx ^ hy) & 0x80000000; in remquo64() 94 sx = hx&0x80000000; /* sign of x */ in remquo64() 95 hx ^=sx; /* |x| */ in remquo64() 99 if((hy|ly)==0||(hx>=0x7ff00000)|| /* y=0,or x not finite */ in remquo64() 104 if(hx<=hy) { in remquo64() 105 if((hx<hy)||(lx<ly)) { in remquo64() 116 if(hx<0x00100000) { /* subnormal x */ in remquo64() 117 if(hx==0) { in remquo64() [all …]
|
D | sf_remquo.c | 39 __int32_t n,hx,hy,hz,ix,iy,sx,i; in remquof() local 42 GET_FLOAT_WORD(hx,x); in remquof() 44 sxy = (hx ^ hy) & 0x80000000; in remquof() 45 sx = hx&0x80000000; /* sign of x */ in remquof() 46 hx ^=sx; /* |x| */ in remquof() 50 if(hy==0||hx>=0x7f800000||hy>0x7f800000) { /* y=0,NaN;or x not finite */ in remquof() 54 if(hx<hy) { in remquof() 57 } else if(hx==hy) { in remquof() 63 if(hx<0x00800000) { /* subnormal x */ in remquof() 64 for (ix = -126,i=(hx<<8); i>0; i<<=1) ix -=1; in remquof() [all …]
|
D | s_logb.c | 81 __int32_t hx,lx,ix; in logb64() local 83 EXTRACT_WORDS(hx,lx,x); in logb64() 84 hx &= 0x7fffffff; /* high |x| */ in logb64() 85 if(hx<0x00100000) { /* 0 or subnormal */ in logb64() 86 if((hx|lx)==0) { in logb64() 91 if(hx==0) { in logb64() 94 for (ix = -1022,hx<<=11; hx>0; hx<<=1) ix -=1; in logb64() 98 else if (hx<0x7ff00000) return (hx>>20)-1023; /* normal # */ in logb64() 99 else if (hx>0x7ff00000 || lx) return x+x; /* x==NaN */ in logb64()
|
D | s_ilogb.c | 71 __int32_t hx,lx,ix; in ilogb64() local 73 EXTRACT_WORDS(hx,lx,x); in ilogb64() 74 hx &= 0x7fffffff; in ilogb64() 75 if(hx<0x00100000) { in ilogb64() 76 if((hx|lx)==0) { in ilogb64() 80 if(hx==0) { in ilogb64() 83 for (ix = -1022,hx<<=11; hx>0; hx<<=1) ix -=1; in ilogb64() 87 else if (hx<0x7ff00000) return (hx>>20)-1023; in ilogb64() 89 else if (hx>0x7ff00000) { in ilogb64()
|
D | sf_logb.c | 26 __int32_t hx,ix; in logbf() local 28 GET_FLOAT_WORD(hx,x); in logbf() 29 hx &= 0x7fffffff; in logbf() 30 if(FLT_UWORD_IS_ZERO(hx)) { in logbf() 34 if(FLT_UWORD_IS_SUBNORMAL(hx)) { in logbf() 35 for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1; in logbf() 38 else if (FLT_UWORD_IS_INFINITE(hx)) return HUGE_VALF; /* x==+|-inf */ in logbf() 39 else if (FLT_UWORD_IS_NAN(hx)) return x + x; in logbf() 40 else return (float) ((hx>>23)-127); in logbf()
|
D | sf_ilogb.c | 21 __int32_t hx,ix; in ilogbf() local 23 GET_FLOAT_WORD(hx,x); in ilogbf() 24 hx &= 0x7fffffff; in ilogbf() 25 if(FLT_UWORD_IS_ZERO(hx)) { in ilogbf() 29 if(FLT_UWORD_IS_SUBNORMAL(hx)) { in ilogbf() 30 for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1; in ilogbf() 34 else if (FLT_UWORD_IS_NAN(hx)) { in ilogbf() 39 else if (!FLT_UWORD_IS_FINITE(hx)) { in ilogbf() 43 else return (hx>>23)-127; in ilogbf()
|
D | s_nextafter.c | 58 __int32_t hx,hy,ix,iy; in nextafter64() local 61 EXTRACT_WORDS(hx,lx,x); in nextafter64() 63 ix = hx&0x7fffffff; /* |x| */ in nextafter64() 75 if(hx>=0) { /* x > 0 */ in nextafter64() 76 if(hx>hy||((hx==hy)&&(lx>ly))) { /* x > y, x -= ulp */ in nextafter64() 77 if(lx==0) hx -= 1; in nextafter64() 81 if(lx==0) hx += 1; in nextafter64() 84 if(hy>=0||hx>hy||((hx==hy)&&(lx>ly))){/* x < y, x -= ulp */ in nextafter64() 85 if(lx==0) hx -= 1; in nextafter64() 89 if(lx==0) hx += 1; in nextafter64() [all …]
|
D | sf_nextafter.c | 20 __int32_t hx,hy,ix,iy; in nextafterf() local 22 GET_FLOAT_WORD(hx,x); in nextafterf() 24 ix = hx&0x7fffffff; /* |x| */ in nextafterf() 36 if(hx>=0) { /* x > 0 */ in nextafterf() 37 if(hx>hy) { /* x > y, x -= ulp */ in nextafterf() 38 hx -= 1; in nextafterf() 40 hx += 1; in nextafterf() 43 if(hy>=0||hx>hy){ /* x < y, x -= ulp */ in nextafterf() 44 hx -= 1; in nextafterf() 46 hx += 1; in nextafterf() [all …]
|
D | s_scalbln.c | 31 __int32_t hx,lx; in scalbln64() local 33 EXTRACT_WORDS(hx,lx,x); in scalbln64() 34 k = (hx&0x7ff00000)>>20; /* extract exponent */ in scalbln64() 36 if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ in scalbln64() 38 GET_HIGH_WORD(hx,x); in scalbln64() 39 k = ((hx&0x7ff00000)>>20) - 54; in scalbln64() 40 if (n< -50000) return __math_uflow(hx < 0); /*underflow*/ in scalbln64() 45 return __math_oflow(hx<0); /* overflow */ in scalbln64() 47 {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} in scalbln64() 49 return __math_uflow(hx < 0); /*underflow*/ in scalbln64() [all …]
|
D | s_scalbn.c | 75 __int32_t k,hx,lx; in scalbn64() local 76 EXTRACT_WORDS(hx,lx,x); in scalbn64() 77 k = (hx&0x7ff00000)>>20; /* extract exponent */ in scalbn64() 79 if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */ in scalbn64() 81 GET_HIGH_WORD(hx,x); in scalbn64() 82 k = ((hx&0x7ff00000)>>20) - 54; in scalbn64() 84 if (n< -50000) return __math_uflow(hx<0); /*underflow*/ in scalbn64() 90 return __math_oflow(hx<0); /*overflow*/ in scalbn64() 93 if (k > 0x7fe) return __math_oflow(hx<0); /* overflow */ in scalbn64() 95 {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} in scalbn64() [all …]
|
D | s_isinf.c | 29 __int32_t hx,lx; in isinf64() local 30 EXTRACT_WORDS(hx,lx,x); in isinf64() 31 hx &= 0x7fffffff; in isinf64() 32 hx |= (__uint32_t)(lx|(-lx))>>31; in isinf64() 33 hx = 0x7ff00000 - hx; in isinf64() 34 return 1 - (int)((__uint32_t)(hx|(-hx))>>31); in isinf64()
|
D | s_isinfd.c | 24 __int32_t hx,lx; in __isinf64() local 25 EXTRACT_WORDS(hx,lx,x); in __isinf64() 26 hx &= 0x7fffffff; in __isinf64() 27 hx |= (__uint32_t)(lx|(-lx))>>31; in __isinf64() 28 hx = 0x7ff00000 - hx; in __isinf64() 29 return 1 - (int)((__uint32_t)(hx|(-hx))>>31); in __isinf64()
|