logo
Free, Micro AI Code Reviews That Run on Git Commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt git-lrc - Free, Micro AI Code Reviews That Run on Git Commit | Product Hunt

bitfieldInsert - insert a range of bits into an integer

Declaration

genITypebitfieldInsert(genITypebase,genITypeinsert,intoffset,intbits);genUTypebitfieldInsert(genUTypebase,genUTypeinsert,intoffset,intbits);

Description

bitfieldInsert inserts the bits least significant bits of insert into base at offset offset. The returned
       value will have bits [offset, offset + bits + 1] taken from [0, bits - 1] of insert and all other bits
       taken directly from the corresponding bits of base. If bits is zero, the result will simply be the
       original value of base. 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

       bitfieldInsert - insert a range of bits into an integer

Parameters

base
           Specifies the integer into which to insert insert.

       insert
           Specifies the the value of the bits to insert.

       offset
           Specifies the index of the first bit to insert.

       bits
           Specifies the number of bits to insert.

See Also

bitfieldExtract()

Version Support

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

See Also