Back to index

glibc  2.9
Defines | Functions
s_frexp.c File Reference
#include <math.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define FUNC   frexp
#define float_type   double
#define __CONCATX(a, b)   __CONCAT(a,b)
#define weak_aliasx(a, b)   weak_alias(a,b)

Functions

float_type __CONCATX (__, FUNC)

Define Documentation

#define __CONCATX (   a,
  b 
)    __CONCAT(a,b)

Definition at line 28 of file s_frexp.c.

#define float_type   double

Definition at line 25 of file s_frexp.c.

#define FUNC   frexp

Definition at line 22 of file s_frexp.c.

#define weak_aliasx (   a,
  b 
)    weak_alias(a,b)

Definition at line 55 of file s_frexp.c.


Function Documentation

float_type __CONCATX ( __  ,
FUNC   
)

Definition at line 31 of file s_frexp.c.

{
  float_type mantissa, exponent;
  int iexponent;
  unsigned long fpsr;

  __asm ("ftst%.x %1\n"
        "fmove%.l %/fpsr, %0"
        : "=dm" (fpsr) : "f" (value));
  if (fpsr & (7 << 24))
    {
      /* Not finite or zero.  */
      *expptr = 0;
      return value;
    }
  __asm ("fgetexp%.x %1, %0" : "=f" (exponent) : "f" (value));
  iexponent = (int) exponent + 1;
  *expptr = iexponent;
  __asm ("fscale%.l %2, %0"
        : "=f" (mantissa)
        : "0" (value), "dmi" (-iexponent));
  return mantissa;
}