summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib/math/clc_sqrt_impl.inc
diff options
context:
space:
mode:
Diffstat (limited to 'libclc/generic/lib/math/clc_sqrt_impl.inc')
-rw-r--r--libclc/generic/lib/math/clc_sqrt_impl.inc13
1 files changed, 7 insertions, 6 deletions
diff --git a/libclc/generic/lib/math/clc_sqrt_impl.inc b/libclc/generic/lib/math/clc_sqrt_impl.inc
index e97b5403db0..fe724e8c143 100644
--- a/libclc/generic/lib/math/clc_sqrt_impl.inc
+++ b/libclc/generic/lib/math/clc_sqrt_impl.inc
@@ -20,14 +20,15 @@
* THE SOFTWARE.
*/
-#if __CLC_FPSIZE == 32
-#define __CLC_NAN NAN
-#define ZERO 0.0f
-#elif __CLC_FPSIZE == 64
+#if __CLC_FPSIZE == 64
#define __CLC_NAN __builtin_nan("")
#define ZERO 0.0
-#else
-#error "Invalid value for __CLC_FPSIZE"
+#elif __CLC_FPSIZE == 32
+#define __CLC_NAN NAN
+#define ZERO 0.0f
+#elif __CLC_FPSIZE == 16
+#define __CLC_NAN (half)NAN
+#define ZERO 0.0h
#endif
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_sqrt(__CLC_GENTYPE val) {
OpenPOWER on IntegriCloud