[X86] Better handling of impossibly large stack frames (#124217)
[llvm-project.git] / libclc / generic / lib / math / copysign.cl
blob08045bebf88a1cbdf572dd1c57ae1c8f672ac2dd
1 #include <clc/clc.h>
2 #include <clc/clcmacro.h>
4 _CLC_DEFINE_BINARY_BUILTIN(float, copysign, __builtin_copysignf, float, float)
6 #ifdef cl_khr_fp64
8 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
10 _CLC_DEFINE_BINARY_BUILTIN(double, copysign, __builtin_copysign, double, double)
12 #endif
14 #ifdef cl_khr_fp16
16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable
18 _CLC_DEF _CLC_OVERLOAD half copysign(half x, half y)
20 ushort sign_x = as_ushort(x) & 0x8000u;
21 ushort unsigned_y = as_ushort(y) & 0x7ffffu;
23 return as_half((ushort)(sign_x | unsigned_y));
25 _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, copysign, half, half)
27 #endif