summaryrefslogtreecommitdiffstats
path: root/libclc/generic/include/clc/math/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'libclc/generic/include/clc/math/log.h')
-rw-r--r--libclc/generic/include/clc/math/log.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/math/log.h b/libclc/generic/include/clc/math/log.h
new file mode 100644
index 00000000000..644f8575c1b
--- /dev/null
+++ b/libclc/generic/include/clc/math/log.h
@@ -0,0 +1,4 @@
+#undef log
+
+// log(x) = log2(x) * (1/log2(e))
+#define log(val) (__clc_log2(val) * 0.693147181f)
OpenPOWER on IntegriCloud