BITFIELDEXTRACT(3G)

    .SH "NAME" bitfieldExtract - extract a range of bits from an integer
    .SH "DECLARATION"

            .HP u genIType bitfieldExtract(genIType value, int offset, int bits);
            .HP u genUType bitfieldExtract(genUType value, int offset, int bits);

    .SH "PARAMETERS"

        .PP value

                    Specifies the integer from which to extract bits.

            .RE
            .PP offset

                        Specifies the index of the first bit to extract.

                .RE
                .PP bits

                            Specifies the number of bits to extract.

                    .RE

                .SH "DESCRIPTION"
                    .PP bitfieldExtract extracts a subset of the bits of value and returns it in the least significant bits of the result. The range of bits extracted is [offset, offset + bits - 1].
                    .PP For unsigned data types, the most significant bits of the result will be set to zero. For signed data types, the most significant bits will be set to the value of bit offset + base - 1 (i.e., it is sign extended to the width of the return type).
                    .PP If bits is zero, the result will be zero. The result will be undefined if offset or bits is negative, or if the sum of offset and bits is greater than the number of bits used to store the operand.

                .SH "VERSION SUPPORT"
                    .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ OpenGL Shading Language Version T} T{ Function Name T}:T{ 1.10 T}:T{ 1.20 T}:T{ 1.30 T}:T{ 1.40 T}:T{ 1.50 T}:T{ 3.30 T}:T{ 4.00 T}:T{ 4.10 T}:T{ 4.20 T}:T{ 4.30 T}:T{ 4.40 T}:T{ 4.50 T} l c c c c c c c c c c c c. T{ bitfieldInsert T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ - T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}

                .SH "SEE ALSO"
                    .PP bitfieldExtract()

                .SH "COPYRIGHT"
                    .PP Copyright © 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. https://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2011-2014 Khronos Group