3 ms·
What about pos1 += (v1<=v2); ?
by tralarpa 5y ago
What about
pos1 += (v1<=v2);
?
- zorgmonkey 5y agoI 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 https://gcc.godbolt.org/z/hfcYdP5rv
- layoutIfNeeded 5y agoThe optimizer will do this anyway.
- OskarS 5y agoThe whole point of the article is that the optimizer in GCC did not do this.
- Google234 5y agoThrow it in godbolt and see if the assembly is different. I would doubt not.
- deleted 5y ago[deleted]