-
Notifications
You must be signed in to change notification settings - Fork 363
Description
While the specification for insertBits and similar built-ins are very precise with their use of bit positions they miss one crucial detail: They do not declare whether bit 0 or bit 31 is least significant (or 15, 63 for some types).
This information is especially relevant when the result of bit-operations is used with hard-to-debug arithmetic operations e.g. target blend states or atomic operations.
I think a simple line like:
The least significant bit is at position 0
would suffice if added to all affected functions. Built-ins which come to mind are:
extractBits, insertBits, firstLeadingBit, firstTrailingBit as well as all pack... and unpack... functions.
Summary:
The concept of least and most significant bit is never associated with numerical bit positions