News for hackers. Stuff that matters.
Re:You Can't Fool the Optimizer by DullPointer on Wednesday December 03, 2025 @11:09AM (#46136152)
ARM is a big target, there could be cpus where lsl is 1 cycle and add is 2+.

Without knowing about specific compiler targets/settings this looks reasonable.

Dumb in the majority case? Absolutely, but smart on the lowest common denominator.

Re:You Can't Fool the Optimizer by adwn on Wednesday December 03, 2025 @01:12PM (#46137876)
> Without knowing about specific compiler targets/settings this looks reasonable.

But we do, armv8-a clang 21.1.0 with O3, and it doesn't.

> […] but smart on the lowest common denominator.

No, that would be the single add instruction.