logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

bitfieldExtract - extract a range of bits from an integer

Declaration

genITypebitfieldExtract(genITypevalue,intoffset,intbits);genUTypebitfieldExtract(genUTypevalue,intoffset,intbits);

Description

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].

       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 signextended to the width of the return type).

       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.

Name

       bitfieldExtract - extract a range of bits from an integer

Parameters

value
           Specifies the integer from which to extract bits.

       offset
           Specifies the index of the first bit to extract.

       bits
           Specifies the number of bits to extract.

See Also

bitfieldExtract()

Version Support

       ┌────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
       │                │        OpenGLShadingLanguageVersion                                            │
       ├────────────────┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┤
       │ Function1.101.201.301.401.503.304.004.104.204.304.404.50 │
       │ Name           │      │      │      │      │      │      │      │      │      │      │      │      │
       ├────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
       │ bitfieldInsert │  -   │  -   │  -   │  -   │  -   │  -   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │  ✔   │
       └────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘

See Also