[libclc] Move 'half' builtins to CLC library (#139563)
There are no changes to the generated bytecode.
This commit is contained in:
21
libclc/clc/include/clc/math/clc_half_cos.h
Normal file
21
libclc/clc/include/clc/math/clc_half_cos.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_COS_H__
|
||||
#define __CLC_MATH_CLC_HALF_COS_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_cos
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_COS_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_divide.h
Normal file
21
libclc/clc/include/clc/math/clc_half_divide.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_DIVIDE_H__
|
||||
#define __CLC_MATH_CLC_HALF_DIVIDE_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_divide
|
||||
#define __CLC_BODY <clc/shared/binary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_DIVIDE_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_exp.h
Normal file
21
libclc/clc/include/clc/math/clc_half_exp.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_EXP_H__
|
||||
#define __CLC_MATH_CLC_HALF_EXP_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_exp
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_EXP_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_exp10.h
Normal file
21
libclc/clc/include/clc/math/clc_half_exp10.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_EXP10_H__
|
||||
#define __CLC_MATH_CLC_HALF_EXP10_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_exp10
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_EXP10_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_exp2.h
Normal file
21
libclc/clc/include/clc/math/clc_half_exp2.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_EXP2_H__
|
||||
#define __CLC_MATH_CLC_HALF_EXP2_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_exp2
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_EXP2_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_log.h
Normal file
21
libclc/clc/include/clc/math/clc_half_log.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_LOG_H__
|
||||
#define __CLC_MATH_CLC_HALF_LOG_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_log
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_LOG_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_log10.h
Normal file
21
libclc/clc/include/clc/math/clc_half_log10.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_LOG10_H__
|
||||
#define __CLC_MATH_CLC_HALF_LOG10_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_log10
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_LOG10_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_log2.h
Normal file
21
libclc/clc/include/clc/math/clc_half_log2.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_LOG2_H__
|
||||
#define __CLC_MATH_CLC_HALF_LOG2_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_log2
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_LOG2_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_powr.h
Normal file
21
libclc/clc/include/clc/math/clc_half_powr.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_POWR_H__
|
||||
#define __CLC_MATH_CLC_HALF_POWR_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_powr
|
||||
#define __CLC_BODY <clc/shared/binary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_POWR_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_recip.h
Normal file
21
libclc/clc/include/clc/math/clc_half_recip.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_RECIP_H__
|
||||
#define __CLC_MATH_CLC_HALF_RECIP_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_recip
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_RECIP_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_rsqrt.h
Normal file
21
libclc/clc/include/clc/math/clc_half_rsqrt.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_RSQRT_H__
|
||||
#define __CLC_MATH_CLC_HALF_RSQRT_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_rsqrt
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_RSQRT_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_sin.h
Normal file
21
libclc/clc/include/clc/math/clc_half_sin.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_SIN_H__
|
||||
#define __CLC_MATH_CLC_HALF_SIN_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_sin
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_SIN_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_sqrt.h
Normal file
21
libclc/clc/include/clc/math/clc_half_sqrt.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_SQRT_H__
|
||||
#define __CLC_MATH_CLC_HALF_SQRT_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_sqrt
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_SQRT_H__
|
||||
21
libclc/clc/include/clc/math/clc_half_tan.h
Normal file
21
libclc/clc/include/clc/math/clc_half_tan.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef __CLC_MATH_CLC_HALF_TAN_H__
|
||||
#define __CLC_MATH_CLC_HALF_TAN_H__
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_FUNCTION __clc_half_tan
|
||||
#define __CLC_BODY <clc/shared/unary_decl.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __FLOAT_ONLY
|
||||
|
||||
#endif // __CLC_MATH_CLC_HALF_TAN_H__
|
||||
@@ -1,3 +1,12 @@
|
||||
math/clc_half_exp10.cl
|
||||
math/clc_half_exp2.cl
|
||||
math/clc_half_exp.cl
|
||||
math/clc_half_log10.cl
|
||||
math/clc_half_log2.cl
|
||||
math/clc_half_log.cl
|
||||
math/clc_half_recip.cl
|
||||
math/clc_half_rsqrt.cl
|
||||
math/clc_half_sqrt.cl
|
||||
math/clc_native_exp2.cl
|
||||
math/clc_native_exp.cl
|
||||
math/clc_native_log10.cl
|
||||
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_exp.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_exp.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_exp.h>
|
||||
|
||||
#define __CLC_FUNC exp
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_exp10.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_exp10.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_exp10.h>
|
||||
|
||||
#define __CLC_FUNC exp10
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
15
libclc/clc/lib/amdgpu/math/clc_half_exp2.cl
Normal file
15
libclc/clc/lib/amdgpu/math/clc_half_exp2.cl
Normal file
@@ -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>
|
||||
#include <clc/math/clc_native_exp2.h>
|
||||
|
||||
#define __CLC_FUNC exp2
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_log.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_log.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_log.h>
|
||||
|
||||
#define __CLC_FUNC log
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_log10.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_log10.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_log10.h>
|
||||
|
||||
#define __CLC_FUNC log10
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_log2.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_log2.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_log2.h>
|
||||
|
||||
#define __CLC_FUNC log2
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
20
libclc/clc/lib/amdgpu/math/clc_half_native_unary.inc
Normal file
20
libclc/clc/lib/amdgpu/math/clc_half_native_unary.inc
Normal file
@@ -0,0 +1,20 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/utils.h>
|
||||
|
||||
#define __CLC_HALF_FUNC(x) __CLC_CONCAT(__clc_half_, x)
|
||||
#define __CLC_NATIVE_FUNC(x) __CLC_CONCAT(__clc_native_, x)
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE
|
||||
__CLC_HALF_FUNC(__CLC_FUNC)(__CLC_GENTYPE val) {
|
||||
return __CLC_NATIVE_FUNC(__CLC_FUNC)(val);
|
||||
}
|
||||
|
||||
#undef __CLC_NATIVE_FUNC
|
||||
#undef __CLC_HALF_FUNC
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_recip.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_recip.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_recip.h>
|
||||
|
||||
#define __CLC_FUNC recip
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_rsqrt.h>
|
||||
|
||||
#define __CLC_FUNC rsqrt
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
14
libclc/clc/lib/amdgpu/math/clc_half_sqrt.cl
Normal file
14
libclc/clc/lib/amdgpu/math/clc_half_sqrt.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_native_sqrt.h>
|
||||
|
||||
#define __CLC_FUNC sqrt
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_native_unary.inc>
|
||||
#include <clc/math/gentype.inc>
|
||||
@@ -50,6 +50,20 @@ math/clc_floor.cl
|
||||
math/clc_fmod.cl
|
||||
math/clc_fract.cl
|
||||
math/clc_frexp.cl
|
||||
math/clc_half_cos.cl
|
||||
math/clc_half_divide.cl
|
||||
math/clc_half_exp.cl
|
||||
math/clc_half_exp10.cl
|
||||
math/clc_half_exp2.cl
|
||||
math/clc_half_log.cl
|
||||
math/clc_half_log10.cl
|
||||
math/clc_half_log2.cl
|
||||
math/clc_half_powr.cl
|
||||
math/clc_half_rsqrt.cl
|
||||
math/clc_half_recip.cl
|
||||
math/clc_half_sin.cl
|
||||
math/clc_half_sqrt.cl
|
||||
math/clc_half_tan.cl
|
||||
math/clc_hypot.cl
|
||||
math/clc_ldexp.cl
|
||||
math/clc_lgamma.cl
|
||||
|
||||
16
libclc/clc/lib/generic/math/clc_half_cos.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_cos.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_cos.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_cos
|
||||
#define __CLC_FUNCTION(x) __clc_cos
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
14
libclc/clc/lib/generic/math/clc_half_divide.cl
Normal file
14
libclc/clc/lib/generic/math/clc_half_divide.cl
Normal file
@@ -0,0 +1,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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 __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_divide.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
12
libclc/clc/lib/generic/math/clc_half_divide.inc
Normal file
12
libclc/clc/lib/generic/math/clc_half_divide.inc
Normal file
@@ -0,0 +1,12 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_half_divide(__CLC_GENTYPE x,
|
||||
__CLC_GENTYPE y) {
|
||||
return x / y;
|
||||
}
|
||||
16
libclc/clc/lib/generic/math/clc_half_exp.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_exp.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_exp.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_exp
|
||||
#define __CLC_FUNCTION(x) __clc_exp
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_exp10.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_exp10.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_exp10.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_exp10
|
||||
#define __CLC_FUNCTION(x) __clc_exp10
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_exp2.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_exp2.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_exp2.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_exp2
|
||||
#define __CLC_FUNCTION(x) __clc_exp2
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_log.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_log.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_log.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_log
|
||||
#define __CLC_FUNCTION(x) __clc_log
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_log10.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_log10.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_log10.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_log10
|
||||
#define __CLC_FUNCTION(x) __clc_log10
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_log2.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_log2.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_log2.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_log2
|
||||
#define __CLC_FUNCTION(x) __clc_log2
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_powr.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_powr.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_powr.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_powr
|
||||
#define __CLC_FUNCTION(x) __clc_powr
|
||||
#define __CLC_BODY <clc/shared/binary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
12
libclc/clc/lib/generic/math/clc_half_recip.cl
Normal file
12
libclc/clc/lib/generic/math/clc_half_recip.cl
Normal file
@@ -0,0 +1,12 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define __CLC_BODY <clc_half_recip.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
11
libclc/clc/lib/generic/math/clc_half_recip.inc
Normal file
11
libclc/clc/lib/generic/math/clc_half_recip.inc
Normal file
@@ -0,0 +1,11 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_half_recip(__CLC_GENTYPE val) {
|
||||
return 1.0f / val;
|
||||
}
|
||||
16
libclc/clc/lib/generic/math/clc_half_rsqrt.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_rsqrt.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_rsqrt.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_rsqrt
|
||||
#define __CLC_FUNCTION(x) __clc_rsqrt
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_sin.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_sin.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_sin.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_sin
|
||||
#define __CLC_FUNCTION(x) __clc_sin
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_sqrt.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_sqrt.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_sqrt.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_sqrt
|
||||
#define __CLC_FUNCTION(x) __clc_sqrt
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
16
libclc/clc/lib/generic/math/clc_half_tan.cl
Normal file
16
libclc/clc/lib/generic/math/clc_half_tan.cl
Normal file
@@ -0,0 +1,16 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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/math/clc_tan.h>
|
||||
|
||||
#define __FLOAT_ONLY
|
||||
#define FUNCTION __clc_half_tan
|
||||
#define __CLC_FUNCTION(x) __clc_tan
|
||||
#define __CLC_BODY <clc/shared/unary_def.inc>
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
Reference in New Issue
Block a user