Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libclc/amdgcn-amdhsa/libspirv/SOURCES
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ math/fmin.cl
math/fmod.cl
math/frexp.cl
math/hypot.cl
math/ilogb.cl
math/ldexp.cl
math/lgamma.cl
math/log.cl
math/log2.cl
math/log10.cl
math/log1p.cl
math/logb.cl
math/mangle_common.h
math/modf.cl
math/nextafter.cl
math/pow.cl
math/remainder.cl
math/round.cl
math/rsqrt.cl
math/sin.cl
Expand Down
36 changes: 36 additions & 0 deletions libclc/amdgcn-amdhsa/libspirv/math/ilogb.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//===----------------------------------------------------------------------===//
//
// 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 <clcmacro.h>
#include <spirv/spirv.h>

int __ocml_ilogb_f64(double);
int __ocml_ilogb_f32(float);

_CLC_DEFINE_UNARY_BUILTIN(int, __spirv_ocl_ilogb, __ocml_ilogb_f32, float)

#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable

_CLC_DEFINE_UNARY_BUILTIN(int, __spirv_ocl_ilogb, __ocml_ilogb_f64, double)
#endif

#ifdef cl_khr_fp16
#pragma OPENCL EXTENSION cl_khr_fp16 : enable

_CLC_OVERLOAD _CLC_DEF int __spirv_ocl_ilogb(half x) {
float t = x;
return __spirv_ocl_ilogb(t);
}

_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, int, __spirv_ocl_ilogb, half);
#endif

#undef __CLC_BUILTIN
#undef __CLC_BUILTIN_F
#undef __CLC_FUNCTION
19 changes: 19 additions & 0 deletions libclc/amdgcn-amdhsa/libspirv/math/log2.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//===----------------------------------------------------------------------===//
//
// 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 <clcmacro.h>
#include <spirv/spirv.h>

double __ocml_log2_f64(double);
float __ocml_log2_f32(float);

#define __CLC_FUNCTION __spirv_ocl_log2
#define __CLC_BUILTIN __ocml_log2
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32)
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64)
#include <math/unary_builtin.inc>
18 changes: 18 additions & 0 deletions libclc/amdgcn-amdhsa/libspirv/math/remainder.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===----------------------------------------------------------------------===//
//
// 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 <spirv/spirv.h>

float __ocml_remainder_f32(float,float);
double __ocml_remainder_f64(double,double);

#define __CLC_FUNCTION __spirv_ocl_remainder
#define __CLC_BUILTIN __ocml_remainder
#define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32)
#define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64)
#include <math/binary_builtin.inc>
2 changes: 1 addition & 1 deletion libclc/generic/libspirv/SOURCES
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ math/nextafter.cl
math/pow.cl
math/pown.cl
math/powr.cl
math/remainer.cl
math/remainder.cl
math/remquo.cl
math/rint.cl
math/rootn.cl
Expand Down
2 changes: 1 addition & 1 deletion libclc/ptx-nvidiacl/libspirv/SOURCES
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ math/native_sqrt.cl
math/native_tan.cl
math/nextafter.cl
math/pow.cl
math/remainer.cl
math/remainder.cl
math/round.cl
math/rsqrt.cl
math/sin.cl
Expand Down