<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/141364>141364</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[NVPTX] Implement LLVM special function intrinsics?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
eliphatfs
</td>
</tr>
</table>
<pre>
LLIR has a list of special function intrinsics:
[‘llvm.sqrt.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-sqrt-intrinsic)
[‘llvm.powi.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-powi-intrinsic)
[‘llvm.sin.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-sin-intrinsic)
[‘llvm.cos.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-cos-intrinsic)
[‘llvm.tan.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-tan-intrinsic)
[‘llvm.asin.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-asin-intrinsic)
[‘llvm.acos.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-acos-intrinsic)
[‘llvm.atan.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-atan-intrinsic)
[‘llvm.atan2.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-atan2-intrinsic)
[‘llvm.sinh.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-sinh-intrinsic)
[‘llvm.cosh.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-cosh-intrinsic)
[‘llvm.tanh.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-tanh-intrinsic)
[‘llvm.pow.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-pow-intrinsic)
[‘llvm.exp.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-exp-intrinsic)
[‘llvm.exp2.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-exp2-intrinsic)
[‘llvm.exp10.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-exp10-intrinsic)
[‘llvm.log.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-log-intrinsic)
[‘llvm.log10.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-log10-intrinsic)
[‘llvm.log2.*’ Intrinsic](https://llvm.org/docs/LangRef.html#llvm-log2-intrinsic)
On the NVPTX backend, all but `sqrt` of these functions will throw an error like this:
```
llvm nvptx error: no libcall available for flog
```
While the functions can be implemented by nv-specific intrinsics like `llvm.nvvm.log.approx.f` on nvptx, implementing these basic-LLVM intrinsic functions could help make frontend code more cross-platform compatible and ease the development process.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0lk-P4jgQxT-NcymBHJMEcsiB2V6kltg_Gq1m91pxKom3HTtrG7rn268coHv2j4YcghQJCeL3q3pUWQ-9V50hqlj-ieVPCZ5Cb11FWo09htYntW2-Vsfj82fo0QOCVj6AbcGPJBVqaE9GBmUNKBOcMl5JzzZ7xqcn_8R-FGzHWbnT-jys_V8urJnY374t4fl2iuVPTOz6EMbpvDgwcZjOWNcxcWis9Ewcjmi6z9Su-zBoJjbxhVUUXb3TmSj_jzzaV7U4OYreJXtllm9Zmbtcaf3iXGn9XW7A5fsNeL9ffITROMdpfITVOMdrfITZOMvtgEY8BC3mbFT_iJXq5-zU8uQoOmerlidH0Tk35yMuzrtcehsX59LbOIe7_GBH0TnklD8CnfK7bG27xcnadnO4D-h5Up3DXv6fjqL_IfP9LwZCT_Dzl19_-wNqlC9kGiZ-ANQa6lMAVvCYY1jBY7gKPXl6j1YeXpXWEHpnXwENkHPWgVYvBKFXt7hV8OvD97EQMOcxvF3eZZs9GAta1TLy8IxKY60JWuug1bb713nG97_3StNU8kcVEg3UBGoYNQ1kAjVQfwVzXk1ZsFXymwx4KY8VfHLNnK8jhuPo7Nu6nfo0lxqjDe-aynTX7mv0Sq6Oxy8_fch-W4w96QZ60iMM-ELQOmsCmQakbQgG6wiks96vRo2htW4AaYcRg4p9o2mA0F8abOhM2o6RDqOzkrxfM75PmmrTlJsSE6rSbbZLU8GLPOkrXhZF3lCWFU3dtLJpt5i323zT8qZEvk0TVQkucp6LLN1lKc_XW1k2NS_Ktiy37a7gLOM0oNLr20glyvsTVWmWboos0ViT9lMiF8LQK0y_MiFiQHfVNGb1qfMs4zGN-w-ZoIKeovw0Zyx_guebsTA5-d3UfkhOTlf_HPpOhf5Ur6Udrhtw_ViNzv5JMjBxmKqL63At_1yJvwMAAP__3mLdHQ">