Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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/libspirv/lib/generic/SOURCES
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ geometric/scale.cl
integer/abs.cl
integer/abs_diff.cl
integer/add_sat.cl
integer/bitfield_extract_signed.cl
integer/bitfield_extract_unsigned.cl
integer/bitfield_insert.cl
integer/clamp.cl
integer/clz.cl
integer/ctz.cl
Expand Down
13 changes: 13 additions & 0 deletions libclc/libspirv/lib/generic/integer/bitfield_extract_signed.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//===----------------------------------------------------------------------===//
//
// 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>
#include <libspirv/spirv.h>

#define __CLC_BODY <bitfield_extract_signed.inc>
#include <clc/integer/gentype.inc>
16 changes: 16 additions & 0 deletions libclc/libspirv/lib/generic/integer/bitfield_extract_signed.inc
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
//
//===----------------------------------------------------------------------===//

#ifdef __CLC_GEN_S

_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE
__spirv_BitFieldSExtract(__CLC_GENTYPE base, uint offset, uint count) {
return __clc_bitfield_extract_signed(base, offset, count);
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//===----------------------------------------------------------------------===//
//
// 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>
#include <libspirv/spirv.h>

#define __CLC_BODY <bitfield_extract_unsigned.inc>
#include <clc/integer/gentype.inc>
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
//
//===----------------------------------------------------------------------===//

#ifdef __CLC_GEN_U

_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE
__spirv_BitFieldUExtract(__CLC_GENTYPE base, uint offset, uint count) {
return __clc_bitfield_extract_unsigned(base, offset, count);
}

#endif
13 changes: 13 additions & 0 deletions libclc/libspirv/lib/generic/integer/bitfield_insert.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//===----------------------------------------------------------------------===//
//
// 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>
#include <libspirv/spirv.h>

#define __CLC_BODY <bitfield_insert.inc>
#include <clc/integer/gentype.inc>
12 changes: 12 additions & 0 deletions libclc/libspirv/lib/generic/integer/bitfield_insert.inc
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
//
//===----------------------------------------------------------------------===//

_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __spirv_BitFieldInsert(
__CLC_GENTYPE base, __CLC_GENTYPE insert, uint offset, uint count) {
return __clc_bitfield_insert(base, insert, offset, count);
}