<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div id="x_compose-container" itemscope="" itemtype="https://schema.org/EmailMessage" style="direction:ltr">
<span itemprop="creator" itemscope="" itemtype="https://schema.org/Organization"><span itemprop="name"></span></span>
<div>
<div>
<div style="direction:ltr">It’s still better because the point of using the intrinsics is the algebraic optimizations that apply to them</div>
</div>
<div><br>
</div>
<div class="x_acompli_signature"></div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Libclc-dev <libclc-dev-bounces@lists.llvm.org> on behalf of Jan Vesely via Libclc-dev <libclc-dev@lists.llvm.org><br>
<b>Sent:</b> Wednesday, September 27, 2017 12:34:26 PM<br>
<b>To:</b> libclc-dev@lists.llvm.org<br>
<b>Subject:</b> [Libclc-dev] [PATCH v2 1/1] math: Don't use llvm instrinsic for native_log</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">AMDGPU targets don't have insturction for it,<br>
so it'll be expanded to C * log2 anyway.<br>
<br>
v2: use native_log2 instead of the more precise sw implementation<br>
<br>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu><br>
---<br>
 generic/lib/math/native_log.cl  | 5 -----<br>
 generic/lib/math/native_log.inc | 2 +-<br>
 2 files changed, 1 insertion(+), 6 deletions(-)<br>
<br>
diff --git a/generic/lib/math/native_log.cl b/generic/lib/math/native_log.cl<br>
index f64f012..f8ba08f 100644<br>
--- a/generic/lib/math/native_log.cl<br>
+++ b/generic/lib/math/native_log.cl<br>
@@ -22,11 +22,6 @@<br>
 <br>
 #include <clc/clc.h><br>
 <br>
-#define __CLC_FUNCTION __clc_native_log<br>
-#define __CLC_INTRINSIC "llvm.log"<br>
-#undef cl_khr_fp64<br>
-#include <clc/math/unary_intrin.inc><br>
-<br>
 #define __CLC_BODY <native_log.inc><br>
 #define __FLOAT_ONLY<br>
 #include <clc/math/gentype.inc><br>
diff --git a/generic/lib/math/native_log.inc b/generic/lib/math/native_log.inc<br>
index cb4db3f..d4950c2 100644<br>
--- a/generic/lib/math/native_log.inc<br>
+++ b/generic/lib/math/native_log.inc<br>
@@ -21,5 +21,5 @@<br>
  */<br>
 <br>
 _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log(__CLC_GENTYPE val) {<br>
-  return __clc_native_log(val);<br>
+  return native_log2(val) * (1.0f / M_LOG2E_F);<br>
 }<br>
-- <br>
2.13.5<br>
<br>
_______________________________________________<br>
Libclc-dev mailing list<br>
Libclc-dev@lists.llvm.org<br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev</a><br>
</div>
</span></font>
</body>
</html>