Description
If the cl_khr_ extension macro is supported, the
functions described in the Built-in
Scalar and Vector Extended Bit Operations table can be used with built-in
scalar or vector integer types to perform extended bit operations.
The functions that operate on vector types operate component-wise.
The description is per-component.
In the table below, the generic type name gentype refers to the built-in
integer types char, charn, uchar, ucharn, short,
shortn, ushort, ushortn, int, intn, uint,
uintn, long, longn, ulong, and ulongn.
The generic type name igentype refers to the built-in signed integer types
char, charn, short, shortn, int, intn, long, and
longn.
The generic type name ugentype refers to the built-in unsigned integer
types uchar, ucharn, ushort, ushortn, uint, uintn,
ulong, and ulongn.
n is 2, 3, 4, 8, or 16.
| Function | Description |
|---|---|
|
Returns a copy of base, with a modified bitfield that comes from insert. Any bits of the result value numbered outside [offset, offset + count - 1] (inclusive) will come from the corresponding bits in base. Any bits of the result value numbered inside [offset, offset + count - 1] (inclusive) will come from the bits numbered [0, count - 1] (inclusive) of insert. count is the number of bits to be modified. If count equals 0, the return value will be equal to base. If count or offset or offset + count is greater than number of
bits in Requires support for the
|
|
Returns an extracted bitfield from base with sign extension. The type of the return value is always a signed type. The bits of base numbered in [offset, offset + count - 1] (inclusive) are returned as the bits numbered in [0, count - 1] (inclusive) of the result. The remaining bits in the result will be sign extended by replicating the bit numbered offset + count - 1 of base. count is the number of bits to be extracted. If count equals 0, the result is 0. If the count or offset or offset + count is greater than
number of bits in Requires support for the
|
|
Returns an extracted bitfield from base with zero extension. The type of the return value is always an unsigned type. The bits of base numbered in [offset, offset + count - 1] (inclusive) are returned as the bits numbered in [0, count - 1] (inclusive) of the result. The remaining bits in the result will be zero. count is the number of bits to be extracted. If count equals 0, the result is 0. If the count or offset or offset + count is greater than
number of bits in Requires support for the
|
|
Returns the value of base with reversed bits.
That is, the bit numbered n of the result value will be taken from
the bit numbered width - n - 1 of base (for scalar types) or a
component of base (for vector types), where width is number of
bits of Requires support for the
|
Document Notes
For more information, see the OpenCL C Specification
This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.