aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/alpha/gen/fpgetround.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/alpha/gen/fpgetround.c')
-rw-r--r--lib/libc/alpha/gen/fpgetround.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/alpha/gen/fpgetround.c b/lib/libc/alpha/gen/fpgetround.c
index 46976c2e4c11..39b9b4744a6b 100644
--- a/lib/libc/alpha/gen/fpgetround.c
+++ b/lib/libc/alpha/gen/fpgetround.c
@@ -33,7 +33,6 @@
#include <sys/types.h>
#include <ieeefp.h>
-#include <machine/fpu.h>
fp_rnd
fpgetround()
@@ -41,8 +40,10 @@ fpgetround()
double fpcrval;
u_int64_t old;
- GET_FPCR(fpcrval);
+ __asm__("trapb");
+ __asm__("mf_fpcr %0" : "=f" (fpcrval));
+ __asm__("trapb");
old = *(u_int64_t *)&fpcrval;
- return ((old & FPCR_DYN_MASK) >> FPCR_DYN_SHIFT);
+ return ((old >> 58) & 0x3);
}