]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/powerpc/fegetround.c
Update.
[thirdparty/glibc.git] / sysdeps / powerpc / fegetround.c
index 05395f0797b294a459f4f9c371c2a7e2ae19d33f..3bb9fb49e04986ce3e5de408813fad5ef25a1354 100644 (file)
 
 #include <fenv_libc.h>
 
+#undef fegetround
 int
 fegetround (void)
 {
-  fenv_union_t u;
-
-  u.fenv = fegetenv_register ();
-
-  /* The rounding mode is bits 30 and 31 of the FPSCR.  */
-  return u.l[1] & 3;
+  int result;
+  asm ("mcrfs 7,7 ; mfcr %0" : "=r"(result) : : "cr7"); \
+  return result & 3;
 }