Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tralarpa
· 5y ago · 0 comments
What about
pos1 += (v1<=v2); ?
Comments
[–]
zorgmonkey
5y ago
I haven't benchmarked it, but surprisingly that seems to be enough to get the gcc assembly almost identical to what clang is producing
https://gcc.godbolt.org/z/hfcYdP5rv
[–]
Google234
5y ago
Throw it in godbolt and see if the assembly is different. I would doubt not.
[–]
layoutIfNeeded
5y ago
The optimizer will do this anyway.
[–]
OskarS
5y ago
The whole point of the article is that the optimizer in GCC did not do this.