<br><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 21, 2017, 11:53 PM Jan Vesely via Libclc-dev <<a href="mailto:libclc-dev@lists.llvm.org">libclc-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, 2017-10-11 at 23:36 -0400, Jan Vesely wrote:<br>
> Use llvm instrinsic by default<br>
> Provide amdgpu workaround<br>
><br>
> Signed-off-by: Jan Vesely <<a href="mailto:jan.vesely@rutgers.edu" target="_blank">jan.vesely@rutgers.edu</a>><br>
> ---<br>
> This is the last missing native_builtin.<br>
<br>
ping.<br>
<br>
Jan<br>
<br>
><br>
>  amdgpu/lib/SOURCES                        |  1 +<br>
>  amdgpu/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a>           | 27 ++++++++++++++++++++++++++<br>
>  amdgpu/lib/math/native_log10.inc          | 25 ++++++++++++++++++++++++<br>
>  generic/include/clc/clc.h                 |  1 +<br>
>  generic/include/clc/math/native_log10.h   | 27 ++++++++++++++++++++++++++<br>
>  generic/include/clc/math/native_log10.inc | 23 ++++++++++++++++++++++<br>
>  generic/lib/SOURCES                       |  1 +<br>
>  generic/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a>          | 32 +++++++++++++++++++++++++++++++<br>
>  generic/lib/math/native_log10.inc         | 25 ++++++++++++++++++++++++<br>
>  9 files changed, 162 insertions(+)<br>
>  create mode 100644 amdgpu/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
>  create mode 100644 amdgpu/lib/math/native_log10.inc<br>
>  create mode 100644 generic/include/clc/math/native_log10.h<br>
>  create mode 100644 generic/include/clc/math/native_log10.inc<br>
>  create mode 100644 generic/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
>  create mode 100644 generic/lib/math/native_log10.inc<br>
><br>
> diff --git a/amdgpu/lib/SOURCES b/amdgpu/lib/SOURCES<br>
> index 8cbe1d4..59d8b22 100644<br>
> --- a/amdgpu/lib/SOURCES<br>
> +++ b/amdgpu/lib/SOURCES<br>
> @@ -1,3 +1,4 @@<br>
>  math/<a href="http://native_log.cl" rel="noreferrer" target="_blank">native_log.cl</a><br>
> +math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
>  math/<a href="http://nextafter.cl" rel="noreferrer" target="_blank">nextafter.cl</a><br>
>  math/<a href="http://sqrt.cl" rel="noreferrer" target="_blank">sqrt.cl</a><br>
> diff --git a/amdgpu/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a> b/amdgpu/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
> new file mode 100644<br>
> index 0000000..619b634<br>
> --- /dev/null<br>
> +++ b/amdgpu/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
> @@ -0,0 +1,27 @@<br>
> +/*<br>
> + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc.<br></blockquote></div><div><br></div><div>I think you should probably remove these copyright statements, or at least replace them with the standard LLVM copyright notice.</div><div><br></div><div>Patch looks good otherwise.  No need to send a version 2.</div><div><br></div><div>--Aaron</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
> + * of this software and associated documentation files (the "Software"), to deal<br>
> + * in the Software without restriction, including without limitation the rights<br>
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
> + * copies of the Software, and to permit persons to whom the Software is<br>
> + * furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
> + * THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#include <clc/clc.h><br>
> +<br>
> +#define __CLC_BODY <native_log10.inc><br>
> +#define __FLOAT_ONLY<br>
> +#include <clc/math/gentype.inc><br>
> diff --git a/amdgpu/lib/math/native_log10.inc b/amdgpu/lib/math/native_log10.inc<br>
> new file mode 100644<br>
> index 0000000..a84b91b<br>
> --- /dev/null<br>
> +++ b/amdgpu/lib/math/native_log10.inc<br>
> @@ -0,0 +1,25 @@<br>
> +/*<br>
> + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
> + * of this software and associated documentation files (the "Software"), to deal<br>
> + * in the Software without restriction, including without limitation the rights<br>
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
> + * copies of the Software, and to permit persons to whom the Software is<br>
> + * furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
> + * THE SOFTWARE.<br>
> + */<br>
> +<br>
> +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log10(__CLC_GENTYPE val) {<br>
> +  return native_log2(val) * (M_LN2_F / M_LN10_F);<br>
> +}<br>
> diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h<br>
> index 3701336..5d64751 100644<br>
> --- a/generic/include/clc/clc.h<br>
> +++ b/generic/include/clc/clc.h<br>
> @@ -104,6 +104,7 @@<br>
>  #include <clc/math/native_exp10.h><br>
>  #include <clc/math/native_exp2.h><br>
>  #include <clc/math/native_log.h><br>
> +#include <clc/math/native_log10.h><br>
>  #include <clc/math/native_log2.h><br>
>  #include <clc/math/native_powr.h><br>
>  #include <clc/math/native_recip.h><br>
> diff --git a/generic/include/clc/math/native_log10.h b/generic/include/clc/math/native_log10.h<br>
> new file mode 100644<br>
> index 0000000..e95671d<br>
> --- /dev/null<br>
> +++ b/generic/include/clc/math/native_log10.h<br>
> @@ -0,0 +1,27 @@<br>
> +/*<br>
> + * Copyright (c) 2015 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
> + * of this software and associated documentation files (the "Software"), to deal<br>
> + * in the Software without restriction, including without limitation the rights<br>
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
> + * copies of the Software, and to permit persons to whom the Software is<br>
> + * furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
> + * THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#define __CLC_BODY <clc/math/native_log10.inc><br>
> +#define __FLOAT_ONLY<br>
> +#include <clc/math/gentype.inc><br>
> +#undef __CLC_BODY<br>
> +#undef __FLOAT_ONLY<br>
> diff --git a/generic/include/clc/math/native_log10.inc b/generic/include/clc/math/native_log10.inc<br>
> new file mode 100644<br>
> index 0000000..7b2971f<br>
> --- /dev/null<br>
> +++ b/generic/include/clc/math/native_log10.inc<br>
> @@ -0,0 +1,23 @@<br>
> +/*<br>
> + * Copyright (c) 2015 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
> + * of this software and associated documentation files (the "Software"), to deal<br>
> + * in the Software without restriction, including without limitation the rights<br>
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
> + * copies of the Software, and to permit persons to whom the Software is<br>
> + * furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
> + * THE SOFTWARE.<br>
> + */<br>
> +<br>
> +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE native_log10(__CLC_GENTYPE a);<br>
> diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES<br>
> index 50f45da..b6c2019 100644<br>
> --- a/generic/lib/SOURCES<br>
> +++ b/generic/lib/SOURCES<br>
> @@ -121,6 +121,7 @@ math/<a href="http://logb.cl" rel="noreferrer" target="_blank">logb.cl</a><br>
>  math/<a href="http://mad.cl" rel="noreferrer" target="_blank">mad.cl</a><br>
>  math/<a href="http://modf.cl" rel="noreferrer" target="_blank">modf.cl</a><br>
>  math/<a href="http://native_log.cl" rel="noreferrer" target="_blank">native_log.cl</a><br>
> +math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
>  math/<a href="http://native_log2.cl" rel="noreferrer" target="_blank">native_log2.cl</a><br>
>  math/<a href="http://tables.cl" rel="noreferrer" target="_blank">tables.cl</a><br>
>  math/<a href="http://clc_nextafter.cl" rel="noreferrer" target="_blank">clc_nextafter.cl</a><br>
> diff --git a/generic/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a> b/generic/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
> new file mode 100644<br>
> index 0000000..a715907<br>
> --- /dev/null<br>
> +++ b/generic/lib/math/<a href="http://native_log10.cl" rel="noreferrer" target="_blank">native_log10.cl</a><br>
> @@ -0,0 +1,32 @@<br>
> +/*<br>
> + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
> + * of this software and associated documentation files (the "Software"), to deal<br>
> + * in the Software without restriction, including without limitation the rights<br>
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
> + * copies of the Software, and to permit persons to whom the Software is<br>
> + * furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
> + * THE SOFTWARE.<br>
> + */<br>
> +<br>
> +#include <clc/clc.h><br>
> +<br>
> +#define __CLC_FUNCTION __clc_native_log10<br>
> +#define __CLC_INTRINSIC "llvm.log10"<br>
> +#undef cl_khr_fp64<br>
> +#include <clc/math/unary_intrin.inc><br>
> +<br>
> +#define __CLC_BODY <native_log10.inc><br>
> +#define __FLOAT_ONLY<br>
> +#include <clc/math/gentype.inc><br>
> diff --git a/generic/lib/math/native_log10.inc b/generic/lib/math/native_log10.inc<br>
> new file mode 100644<br>
> index 0000000..e9b3b7a<br>
> --- /dev/null<br>
> +++ b/generic/lib/math/native_log10.inc<br>
> @@ -0,0 +1,25 @@<br>
> +/*<br>
> + * Copyright (c) 2014,2015 Advanced Micro Devices, Inc.<br>
> + *<br>
> + * Permission is hereby granted, free of charge, to any person obtaining a copy<br>
> + * of this software and associated documentation files (the "Software"), to deal<br>
> + * in the Software without restriction, including without limitation the rights<br>
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
> + * copies of the Software, and to permit persons to whom the Software is<br>
> + * furnished to do so, subject to the following conditions:<br>
> + *<br>
> + * The above copyright notice and this permission notice shall be included in<br>
> + * all copies or substantial portions of the Software.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br>
> + * THE SOFTWARE.<br>
> + */<br>
> +<br>
> +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log10(__CLC_GENTYPE val) {<br>
> +  return __clc_native_log10(val);<br>
> +}<br>
<br>
--<br>
Jan Vesely <<a href="mailto:jan.vesely@rutgers.edu" target="_blank">jan.vesely@rutgers.edu</a>>_______________________________________________<br>
Libclc-dev mailing list<br>
<a href="mailto:Libclc-dev@lists.llvm.org" target="_blank">Libclc-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev</a><br>
</blockquote></div>