| ▲ | codedokode a day ago | |||||||
Modifying a constant in code might make sense because it saves several precious bytes of variable storage. | ||||||||
| ▲ | inigyou a day ago | parent [-] | |||||||
No, it might make sense because it saves precious memory bandwidth as well as uop count. This code wasn't called that often, generally once per drawing operation, but I don't like being uselessly wasteful - that mindset is how software got so bloated. Your program is either front-end stalled by uop count or instruction cache latency, or back-end bound by memory bandwidth or ALU throughput or a serial dependency chain. It doesn't matter which is the bottleneck for this case, because inlining constants improves most of the above! | ||||||||
| ||||||||