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.

{
  fenv_t fpsr;

  if (round & ~3)
    return 1;

  /* Get the current state.  */
  __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));

  /* Set the relevant bits.  */
  fpsr = (fpsr & ~(3UL << 10)) | ((fenv_t) round << 10);

  /* Put the new state in effect.  */
  __asm__ __volatile__ ("mov.m ar.fpsr=%0" :: "r" (fpsr) : "memory");

  return 0;
}

Here is the call graph for this function: