Blame sysdeps/ieee754/ldbl-128/s_isnanl.c
|
Packit |
6c4009 |
/* s_isnanl.c -- long double version of s_isnan.c.
|
|
Packit |
6c4009 |
* Conversion to long double by Jakub Jelinek, jj@ultra.linux.cz.
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* ====================================================
|
|
Packit |
6c4009 |
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
Packit |
6c4009 |
*
|
|
Packit |
6c4009 |
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
Packit |
6c4009 |
* Permission to use, copy, modify, and distribute this
|
|
Packit |
6c4009 |
* software is freely granted, provided that this notice
|
|
Packit |
6c4009 |
* is preserved.
|
|
Packit |
6c4009 |
* ====================================================
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#if defined(LIBM_SCCS) && !defined(lint)
|
|
Packit |
6c4009 |
static char rcsid[] = "$NetBSD: $";
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/*
|
|
Packit |
6c4009 |
* isnanl(x) returns 1 is x is nan, else 0;
|
|
Packit |
6c4009 |
* no branching!
|
|
Packit |
6c4009 |
*/
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <math.h>
|
|
Packit |
6c4009 |
#include <math_private.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
int __isnanl(_Float128 x)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
int64_t hx,lx;
|
|
Packit |
6c4009 |
GET_LDOUBLE_WORDS64(hx,lx,x);
|
|
Packit |
6c4009 |
hx &= 0x7fffffffffffffffLL;
|
|
Packit |
6c4009 |
hx |= (uint64_t)(lx|(-lx))>>63;
|
|
Packit |
6c4009 |
hx = 0x7fff000000000000LL - hx;
|
|
Packit |
6c4009 |
return (int)((uint64_t)hx>>63);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
mathx_hidden_def (__isnanl)
|
|
Packit |
6c4009 |
weak_alias (__isnanl, isnanl)
|