-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[libclc] Add generic implementation of bitfield_insert/extract,bit_reverse #149070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
9f8b12e
[libclc] Add generic implementation of bitfield_insert/extract,bit_re…
wenju-he 78d4dd1
add cl_khr_extended_bit_ops to opencl header, rename clc_bitfield_ext…
wenju-he 5d7c86e
delete redundant clc/opencl/integer/bitfield_extract_decl.inc clc/ope…
wenju-he File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef __CLC_INTEGER_CLC_BIT_REVERSE_H__ | ||
| #define __CLC_INTEGER_CLC_BIT_REVERSE_H__ | ||
|
|
||
| #define FUNCTION __clc_bit_reverse | ||
| #define __CLC_BODY <clc/shared/unary_decl.inc> | ||
|
|
||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #undef FUNCTION | ||
|
|
||
| #endif // __CLC_INTEGER_CLC_BIT_REVERSE_H__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_DECL __RETTYPE FUNCTION(__CLC_GENTYPE base, uint offset, | ||
| uint count); | ||
23 changes: 23 additions & 0 deletions
23
libclc/clc/include/clc/integer/clc_bitfield_extract_signed.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ | ||
| #define __CLC_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ | ||
|
|
||
| #include <clc/internal/clc.h> | ||
|
|
||
| #define FUNCTION __clc_bitfield_extract_signed | ||
| #define __RETTYPE __CLC_S_GENTYPE | ||
|
|
||
| #define __CLC_BODY <clc/integer/clc_bitfield_extract.inc> | ||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #undef __RETTYPE | ||
| #undef FUNCTION | ||
|
|
||
| #endif // __CLC_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ |
23 changes: 23 additions & 0 deletions
23
libclc/clc/include/clc/integer/clc_bitfield_extract_unsigned.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ | ||
| #define __CLC_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ | ||
|
|
||
| #include <clc/internal/clc.h> | ||
|
|
||
| #define FUNCTION __clc_bitfield_extract_unsigned | ||
| #define __RETTYPE __CLC_U_GENTYPE | ||
|
|
||
| #define __CLC_BODY <clc/integer/clc_bitfield_extract.inc> | ||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #undef __RETTYPE | ||
| #undef FUNCTION | ||
|
|
||
| #endif // __CLC_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_INTEGER_CLC_BITFIELD_INSERT_H__ | ||
| #define __CLC_INTEGER_CLC_BITFIELD_INSERT_H__ | ||
|
|
||
| #include <clc/internal/clc.h> | ||
|
|
||
| #define __CLC_BODY <clc/integer/clc_bitfield_insert.inc> | ||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #endif // __CLC_INTEGER_CLC_BITFIELD_INSERT_H__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_DECL __CLC_GENTYPE __clc_bitfield_insert( | ||
| __CLC_GENTYPE base, __CLC_GENTYPE insert, uint offset, uint count); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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/integer/clc_bit_reverse.h> | ||
|
|
||
| #define FUNCTION __clc_bit_reverse | ||
| #define __IMPL_FUNCTION(x) __builtin_elementwise_bitreverse | ||
| #define __CLC_BODY <clc/shared/unary_def.inc> | ||
|
|
||
| #include <clc/integer/gentype.inc> |
12 changes: 12 additions & 0 deletions
12
libclc/clc/lib/generic/integer/clc_bitfield_extract_signed.cl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include <clc/integer/clc_bitfield_extract_signed.h> | ||
|
|
||
| #define __CLC_BODY <clc_bitfield_extract_signed.inc> | ||
| #include <clc/integer/gentype.inc> |
19 changes: 19 additions & 0 deletions
19
libclc/clc/lib/generic/integer/clc_bitfield_extract_signed.inc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF __CLC_S_GENTYPE | ||
| __clc_bitfield_extract_signed(__CLC_GENTYPE base, uint offset, uint count) { | ||
| if (count == 0) | ||
| return 0; | ||
| __CLC_U_GENTYPE x = __CLC_AS_U_GENTYPE(base) | ||
| << (__CLC_GENSIZE - offset - count); | ||
| // Implement an arithmetic shift right. | ||
| __CLC_U_GENTYPE s = -(x >> (__CLC_GENSIZE - 1)); | ||
| __CLC_U_GENTYPE result = ((s ^ x) >> (__CLC_GENSIZE - count)) ^ s; | ||
| return __CLC_AS_S_GENTYPE(result); | ||
| } |
12 changes: 12 additions & 0 deletions
12
libclc/clc/lib/generic/integer/clc_bitfield_extract_unsigned.cl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include <clc/integer/clc_bitfield_extract_unsigned.h> | ||
|
|
||
| #define __CLC_BODY <clc_bitfield_extract_unsigned.inc> | ||
| #include <clc/integer/gentype.inc> |
16 changes: 16 additions & 0 deletions
16
libclc/clc/lib/generic/integer/clc_bitfield_extract_unsigned.inc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE | ||
| __clc_bitfield_extract_unsigned(__CLC_GENTYPE base, uint offset, uint count) { | ||
| if (count == 0) | ||
| return 0; | ||
| __CLC_U_GENTYPE result = __CLC_AS_U_GENTYPE(base) | ||
| << (__CLC_GENSIZE - offset - count); | ||
| return result >> (__CLC_GENSIZE - count); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include <clc/integer/clc_bitfield_insert.h> | ||
|
|
||
| #define __CLC_BODY <clc_bitfield_insert.inc> | ||
| #include <clc/integer/gentype.inc> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_bitfield_insert(__CLC_GENTYPE base, | ||
| __CLC_GENTYPE insert, | ||
| uint offset, | ||
| uint count) { | ||
| __CLC_U_GENTYPE u_base = __CLC_AS_U_GENTYPE(base); | ||
| __CLC_U_GENTYPE u_insert = __CLC_AS_U_GENTYPE(insert); | ||
| __CLC_U_GENTYPE mask = (((__CLC_U_GENTYPE)1 << count) - (__CLC_U_GENTYPE)1) | ||
| << offset; | ||
| mask = count < __CLC_GENSIZE ? mask : ~(__CLC_U_GENTYPE)0; | ||
| __CLC_U_GENTYPE result = ((u_insert << offset) & mask) | (u_base & ~mask); | ||
| return __CLC_AS_GENTYPE(result); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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_OPENCL_INTEGER_BIT_REVERSE_H__ | ||
frasercrmck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #define __CLC_OPENCL_INTEGER_BIT_REVERSE_H__ | ||
|
|
||
| #include <clc/opencl/opencl-base.h> | ||
|
|
||
| #define FUNCTION bit_reverse | ||
| #define __CLC_BODY <clc/shared/unary_decl.inc> | ||
|
|
||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #undef FUNCTION | ||
|
|
||
| #endif // __CLC_OPENCL_INTEGER_BIT_REVERSE_H__ | ||
10 changes: 10 additions & 0 deletions
10
libclc/opencl/include/clc/opencl/integer/bitfield_extract.inc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_DECL __RETTYPE FUNCTION(__CLC_GENTYPE base, uint offset, | ||
| uint count); |
23 changes: 23 additions & 0 deletions
23
libclc/opencl/include/clc/opencl/integer/bitfield_extract_signed.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_OPENCL_INTEGER_BITFIELD_EXTRACT_SIGNED_H__ | ||
| #define __CLC_OPENCL_INTEGER_BITFIELD_EXTRACT_SIGNED_H__ | ||
|
|
||
| #include <clc/opencl/opencl-base.h> | ||
|
|
||
| #define FUNCTION bitfield_extract_signed | ||
| #define __RETTYPE __CLC_S_GENTYPE | ||
|
|
||
| #define __CLC_BODY <clc/opencl/integer/bitfield_extract.inc> | ||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #undef __RETTYPE | ||
| #undef FUNCTION | ||
|
|
||
| #endif // __CLC_OPENCL_INTEGER_BITFIELD_EXTRACT_SIGNED_H__ |
23 changes: 23 additions & 0 deletions
23
libclc/opencl/include/clc/opencl/integer/bitfield_extract_unsigned.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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_OPENCL_INTEGER_BITFIELD_EXTRACT_UNSIGNED_H__ | ||
| #define __CLC_OPENCL_INTEGER_BITFIELD_EXTRACT_UNSIGNED_H__ | ||
|
|
||
| #include <clc/opencl/opencl-base.h> | ||
|
|
||
| #define FUNCTION bitfield_extract_unsigned | ||
| #define __RETTYPE __CLC_U_GENTYPE | ||
|
|
||
| #define __CLC_BODY <clc/opencl/integer/bitfield_extract.inc> | ||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #undef __RETTYPE | ||
| #undef FUNCTION | ||
|
|
||
| #endif // __CLC_OPENCL_INTEGER_BITFIELD_EXTRACT_UNSIGNED_H__ |
19 changes: 19 additions & 0 deletions
19
libclc/opencl/include/clc/opencl/integer/bitfield_insert.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef __CLC_OPENCL_INTEGER_BITFIELD_INSERT_H__ | ||
| #define __CLC_OPENCL_INTEGER_BITFIELD_INSERT_H__ | ||
|
|
||
| #include <clc/opencl/opencl-base.h> | ||
|
|
||
| #define __CLC_BODY <clc/integer/clc_bitfield_insert.inc> | ||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #undef FUNCTION | ||
|
|
||
| #endif // __CLC_OPENCL_INTEGER_BITFIELD_INSERT_H__ |
11 changes: 11 additions & 0 deletions
11
libclc/opencl/include/clc/opencl/integer/bitfield_insert.inc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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_DECL __CLC_GENTYPE bitfield_insert(__CLC_GENTYPE base, | ||
| __CLC_GENTYPE insert, | ||
| uint offset, uint count); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_extended_bit_ops | ||
|
|
||
| #include <clc/integer/clc_bit_reverse.h> | ||
| #include <clc/opencl/integer/bit_reverse.h> | ||
|
|
||
| #define FUNCTION bit_reverse | ||
| #define __CLC_BODY <clc/shared/unary_def.inc> | ||
|
|
||
| #include <clc/integer/gentype.inc> | ||
|
|
||
| #endif // cl_khr_extended_bit_ops |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef __IMPL_FUNCTION | ||
| #define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) | ||
| #endif | ||
|
|
||
| _CLC_OVERLOAD _CLC_DEF __RETTYPE FUNCTION(__CLC_GENTYPE base, uint offset, | ||
| uint count) { | ||
| return __IMPL_FUNCTION(FUNCTION)(base, offset, count); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.