3 ms·
adrianmsmith is suggesting that everytime the variable is read, the compiler inserts byte-swapping code. I disagree with that.
by alexchamberlain 15y ago
adrianmsmith is suggesting that everytime the variable is read, the compiler inserts byte-swapping code. I disagree with that.
- pmjordan 15y agoI don't necessarily see a problem with that: it would avoid the messy cpu_to_le64 calls.
- adrianmsmith 15y agoIt would, in the worst case, not be worse than what the original poster is suggesting. And at least in that case, the code would be more readable. But, as the compiler knows more about what's going on (it's not just parsing and compiling a general expression with ORs and shifts) then it could well be faster (e.g. if there were a CPU instruction to do this, then it could be used, etc.).