| ▲ | jjmarr 2 hours ago | |
> Just don't allow casting to u24, as it makes no sense unless you define u24 to be u32 sized as I think c standard does. The reason u32->u24 casting must be well defined is because some hardware (e.g. many GPUs, microcontrollers) only have floating point multipliers. A 24 bit unsigned integer (stored in a 32 bit register) can be losslessly converted to a 32 bit float by the hardware, multiplied, then converted back. This is much faster than doing 32 bit multiplication in software, however, you still need to tell the compiler about this constraint. | ||
| ▲ | mathisfun123 a minute ago | parent [-] | |
> many GPUs Citation please - every single GPU in the literal world supports integer arithmetic for operating on tid, gid, etc. | ||