4 static inline unsigned get_fpc(void)
7 __asm__
__volatile__("efpc %0" : "=r"(fpc
));
11 static inline void set_fpc(unsigned fpc
)
13 __asm__
__volatile__("sfpc %0" :: "r"(fpc
));
16 int feclearexcept(int mask
)
18 mask
&= FE_ALL_EXCEPT
;
19 set_fpc(get_fpc() & ~mask
);
23 int feraiseexcept(int mask
)
25 mask
&= FE_ALL_EXCEPT
;
26 set_fpc(get_fpc() | mask
);
30 int fetestexcept(int mask
)
32 return get_fpc() & mask
& FE_ALL_EXCEPT
;
40 hidden
int __fesetround(int r
)
42 set_fpc(get_fpc() & ~3L | r
);
46 int fegetenv(fenv_t
*envp
)
52 int fesetenv(const fenv_t
*envp
)
54 set_fpc(envp
!= FE_DFL_ENV
? *envp
: 0);