On the topic of rotates,
It is much easier to add a few extra ops into a language and not use them
very often, than to leave them out and have to rely on tricks by programmers
and compiler writers.
I must have missed the part where someone explained where rotate
is useful in the first place. I can see it for hash functions;
where else? (I'm not saying there's no use, just that it's rare.
I've used them myself, I'm sure, decades ago, but don't remember
why and I'm sure it was quite rare.)
Speaking of compiler support for commonly used ops,
what about
q = a / b;
r = a % b;
also doable as
struct { long q, r; } res = ldiv(a, b);
or whatever it is.
When I tried the above on gcc, I found that
with the first form, gcc avoided the redundant
division, but with the second it didn't!!!!!!
Exactly opposite to what one might expect!
Did I do something wrong ????
James