mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 05:40:09 +00:00
libclc: generic: add half implementation for erf/erfc (#66901)
libclc does not have a half implementation for erf/erfc Add one based on the float implementation by extending the input and truncating the output.
This commit is contained in:
parent
51bf0dff53
commit
9160f49e08
@ -399,4 +399,16 @@ _CLC_OVERLOAD _CLC_DEF double erf(double y) {
|
||||
|
||||
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, erf, double);
|
||||
|
||||
#ifdef cl_khr_fp16
|
||||
|
||||
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF half erf(half h) {
|
||||
return (half)erf((float)h);
|
||||
}
|
||||
|
||||
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, erf, half);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -410,4 +410,16 @@ _CLC_OVERLOAD _CLC_DEF double erfc(double x) {
|
||||
|
||||
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, erfc, double);
|
||||
|
||||
#ifdef cl_khr_fp16
|
||||
|
||||
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
|
||||
|
||||
_CLC_OVERLOAD _CLC_DEF half erfc(half h) {
|
||||
return (half)erfc((float)h);
|
||||
}
|
||||
|
||||
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, erfc, half);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user