Back to index

glibc  2.9
Functions
fesetround.c File Reference
#include <fenv.h>

Go to the source code of this file.

Functions

int fesetround (int round)

Function Documentation

int fesetround ( int  round)

Definition at line 24 of file fesetround.c.

{
  union { unsigned long long l; unsigned int sw[2]; } s;

  if (round & ~FE_DOWNWARD)
    /* round is not a valid rounding mode. */
    return 1;
  
  /* Get the current status word. */
  __asm__ ("fstd %%fr0,0(%1)" : "=m" (s.l) : "r" (&s.l) : "%r0");
  s.sw[0] &= ~FE_DOWNWARD;
  s.sw[0] |= round & FE_DOWNWARD;
  __asm__ ("fldd 0(%0),%%fr0" : : "r" (&s.l), "m" (s.l) : "%r0");

  return 0;
}

Here is the call graph for this function: