about summary refs log tree commit diff
path: root/src/internal/libm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/libm.h')
-rw-r--r--src/internal/libm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/internal/libm.h b/src/internal/libm.h
index 8c5474a8..a71c4c05 100644
--- a/src/internal/libm.h
+++ b/src/internal/libm.h
@@ -32,6 +32,19 @@ union dshape {
 	uint64_t bits;
 };
 
+#define FORCE_EVAL(x) do {                          \
+	if (sizeof(x) == sizeof(float)) {           \
+		volatile float __x;                 \
+		__x = (x);                          \
+	} else if (sizeof(x) == sizeof(double)) {   \
+		volatile double __x;                \
+		__x = (x);                          \
+	} else {                                    \
+		volatile long double __x;           \
+		__x = (x);                          \
+	}                                           \
+} while(0)
+
 /* Get two 32 bit ints from a double.  */
 #define EXTRACT_WORDS(hi,lo,d)                                  \
 do {                                                            \