[libclc] libclc: Add fast version utility functions for div, sqrt and reciprocal (PR #185823)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 11 01:44:11 PDT 2026


================
@@ -0,0 +1,15 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <clc/internal/clc.h>
+
+#define __CLC_FUNCTION __clc_sqrt_fast
+#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_sqrt
----------------
arsenm wrote:

native_sqrt isn't required to handle inf/nan. I also would like to eventually change the representation to be a specific ulp bounds, as opposed to the poorly specified afn flag 

https://github.com/llvm/llvm-project/pull/185823


More information about the cfe-commits mailing list