123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include "fpu/fenv_libc.h"
- int
- __FERAISEEXCEPT_INTERNAL (int excepts)
- {
- unsigned long f;
- f = fegetenv_register ();
- f |= (excepts & FE_ALL_EXCEPT);
- fesetenv_register (f);
-
- if ((FE_INVALID & excepts) != 0)
- {
-
-
- __asm__ __volatile__ ("efsdiv %0,%0,%1" : : "r" (0), "r" (0));
- }
- if ((FE_DIVBYZERO & excepts) != 0)
- {
-
- __asm__ __volatile__ ("efsdiv %0,%0,%1" : : "r" (1.0F), "r" (0));
- }
- if ((FE_OVERFLOW & excepts) != 0)
- {
-
-
- __asm__ __volatile__ ("efsadd %0,%0,%1" : : "r" (0x7f7fffff), "r" (0x7f7fffff));
- }
- if ((FE_UNDERFLOW & excepts) != 0)
- {
-
-
- __asm__ __volatile__ ("efsmul %0,%0,%1" : : "r" (0x800000), "r" (0x800000));
- }
- if ((FE_INEXACT & excepts) != 0)
- {
-
- __asm__ __volatile__ ("efssub %0,%0,%1" : : "r" (0x00800000), "r" (1.0F));
- }
-
- return 0;
- }
|