summaryrefslogtreecommitdiff
path: root/sysdeps/m68k/fpu
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/m68k/fpu')
-rw-r--r--sysdeps/m68k/fpu/__math.h12
-rw-r--r--sysdeps/m68k/fpu/fraiseexcpt.c22
2 files changed, 14 insertions, 20 deletions
diff --git a/sysdeps/m68k/fpu/__math.h b/sysdeps/m68k/fpu/__math.h
index 5dc4d2e066..fd90a2de1b 100644
--- a/sysdeps/m68k/fpu/__math.h
+++ b/sysdeps/m68k/fpu/__math.h
@@ -414,7 +414,7 @@ __inline_forward(void,sincosl,
#define isgreater(x, y) \
__extension__ \
({ char __result; \
- __asm__ ("fcmp %2,%1; fsogt %0" \
+ __asm__ ("fcmp%.x %2,%1; fsogt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; })
@@ -422,7 +422,7 @@ __inline_forward(void,sincosl,
#define isgreaterequal(x, y) \
__extension__ \
({ char __result; \
- __asm__ ("fcmp %2,%1; fsoge %0" \
+ __asm__ ("fcmp%.x %2,%1; fsoge %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; })
@@ -430,7 +430,7 @@ __inline_forward(void,sincosl,
#define isless(x, y) \
__extension__ \
({ char __result; \
- __asm__ ("fcmp %2,%1; fsolt %0" \
+ __asm__ ("fcmp%.x %2,%1; fsolt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; })
@@ -438,7 +438,7 @@ __inline_forward(void,sincosl,
#define islessequal(x, y) \
__extension__ \
({ char __result; \
- __asm__ ("fcmp %2,%1; fsole %0" \
+ __asm__ ("fcmp%.x %2,%1; fsole %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; })
@@ -446,7 +446,7 @@ __inline_forward(void,sincosl,
#define islessgreater(x, y) \
__extension__ \
({ char __result; \
- __asm__ ("fcmp %2,%1; fsogl %0" \
+ __asm__ ("fcmp%.x %2,%1; fsogl %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; })
@@ -454,7 +454,7 @@ __inline_forward(void,sincosl,
#define isunordered(x, y) \
__extension__ \
({ char __result; \
- __asm__ ("fcmp %2,%1; fsun %0" \
+ __asm__ ("fcmp%.x %2,%1; fsun %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; })
#endif
diff --git a/sysdeps/m68k/fpu/fraiseexcpt.c b/sysdeps/m68k/fpu/fraiseexcpt.c
index b6ff82760d..51411dd292 100644
--- a/sysdeps/m68k/fpu/fraiseexcpt.c
+++ b/sysdeps/m68k/fpu/fraiseexcpt.c
@@ -34,9 +34,8 @@ feraiseexcept (int excepts)
if (excepts & FE_INVALID)
{
/* One example of a invalid operation is 0 * Infinity. */
- double d = 0.0 * HUGE_VAL;
- /* Now force the exception. */
- __asm__ __volatile__ ("fnop" : : "f" (d));
+ double d = HUGE_VAL;
+ __asm__ __volatile__ ("fmul%.s %#0r0,%0; fnop" : "=f" (d) : "0" (d));
}
/* Next: division by zero. */
@@ -49,26 +48,21 @@ feraiseexcept (int excepts)
/* Next: overflow. */
if (excepts & FE_OVERFLOW)
{
- long double d = LDBL_MAX * LDBL_MAX;
- /* Now force the exception. */
- __asm__ __volatile__ ("fnop" : : "f" (d));
+ long double d = LDBL_MAX;
+ __asm__ __volatile__ ("fmul%.x %0,%0; fnop" : "=f" (d) : "0" (d));
}
/* Next: underflow. */
if (excepts & FE_UNDERFLOW)
{
- long double d = LDBL_MIN / 16.0;
- /* Now force the exception. */
- __asm__ __volatile__ ("fnop" : : "f" (d));
+ long double d = LDBL_MIN;
+ __asm__ __volatile__ ("fdiv%.s %#0r16,%0; fnop" : "=f" (d) : "0" (d));
}
/* Last: inexact. */
if (excepts & FE_INEXACT)
{
- long double d1, d2 = 1.0;
- __asm__ __volatile__ ("fmovecr %#0,%0\n\t"
- "fdiv%.x %1,%0\n\t"
- "fnop"
- : "=&f" (d1) : "f" (d2));
+ long double d = 1.0;
+ __asm__ __volatile__ ("fdiv%.s %#0r3,%0; fnop" : "=f" (d) : "0" (d));
}
}