m68k: add optimized math_opt_barrier and math_force_eval

This commit is contained in:
Andreas Schwab 2011-10-26 11:34:30 +02:00
parent 88808f8a72
commit 290c9bd53b
2 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2011-10-26 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/m68k/m680x0/fpu/math_private.h: New file.
* sysdeps/m68k/m680x0/fpu/sincostab.c: New file.
2011-10-23 Andreas Schwab <schwab@linux-m68k.org>

View File

@ -0,0 +1,19 @@
#ifndef _MATH_PRIVATE_H
#define math_opt_barrier(x) \
({ __typeof (x) __x; \
__asm ("" : "=f" (__x) : "0" (x)); \
__x; })
#define math_force_eval(x) \
do \
{ \
__typeof (x) __x = (x); \
if (sizeof (x) <= sizeof (double)) \
__asm __volatile ("" : : "m" (__x)); \
else \
__asm __volatile ("" : : "f" (__x)); \
} \
while (0)
#include <math/math_private.h>
#endif