Skip to content

Commit 93fe52f

Browse files
authored
[libclc] Add __clc_nan implementation with signed nancode argument (#146485)
In OpenCL Extended Instruction Set Specification, nancode can be signed integer or vector of signed integers values. This PR has no change to amdgcn--amdhsa.bc and nvptx64--nvidiacl.bc because the newly added clc functions are not used in OpenCL library.
1 parent 2b16af8 commit 93fe52f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libclc/clc/include/clc/math/clc_nan.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
//===----------------------------------------------------------------------===//
88

99
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_nan(__CLC_U_GENTYPE code);
10+
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_nan(__CLC_S_GENTYPE code);

libclc/clc/lib/generic/math/clc_nan.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_nan(__CLC_U_GENTYPE code) {
2020
return __CLC_AS_GENTYPE(res);
2121
}
2222

23+
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_nan(__CLC_S_GENTYPE code) {
24+
return __clc_nan(__CLC_AS_U_GENTYPE(code));
25+
}
26+
2327
#undef NAN_MASK

0 commit comments

Comments
 (0)