aboutsummaryrefslogtreecommitdiff
path: root/src/vectors-4-default.h
diff options
context:
space:
mode:
authorsvn_bwardell <svn_bwardell@105869f7-3296-0410-a4ea-f4349344b45a>2011-08-07 12:41:50 +0000
committersvn_bwardell <svn_bwardell@105869f7-3296-0410-a4ea-f4349344b45a>2011-08-07 12:41:50 +0000
commit96caf45931a90c080adc8073762d72aa2a80ac76 (patch)
tree48ccb4894a0bdd3dbf62826e8c0e05641d1f4236 /src/vectors-4-default.h
parent1d6878bcc13a1695043cb680f7ab83be28048419 (diff)
Fix definition of kifthen for architectures where blend instructions are not available.
git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/Vectors/trunk@20 105869f7-3296-0410-a4ea-f4349344b45a
Diffstat (limited to 'src/vectors-4-default.h')
-rw-r--r--src/vectors-4-default.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vectors-4-default.h b/src/vectors-4-default.h
index b59db7c..6f66ff9 100644
--- a/src/vectors-4-default.h
+++ b/src/vectors-4-default.h
@@ -81,4 +81,11 @@
#define k4pow(x,a) (powf(x,a))
#define k4sqrt(x) (sqrtf(x))
-#define k4ifthen(x,y,z) ((x)>=0?(y):(z))
+#include <math.h>
+#ifdef __cplusplus
+#define SGN(x) std::signbit(x)
+#else
+#define SGN(x) signbit(x)
+#endif
+
+#define k4ifthen(x,y,z) (SGN(x)?(z):(y))