News for hackers. Stuff that matters.
Re:The byte order fallacy by alexchamberlain on Wednesday April 04, 2012 @06:39AM (#3796939)
adrianmsmith is suggesting that everytime the variable is read, the compiler inserts byte-swapping code. I disagree with that.
Re:The byte order fallacy by adrianmsmith on Wednesday April 04, 2012 @09:43AM (#3797509)
It 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.).

Re:The byte order fallacy by pmjordan on Wednesday April 04, 2012 @06:41AM (#3796945)
I don't necessarily see a problem with that: it would avoid the messy cpu_to_le64 calls.