4 ms·
A lot of this "undefined behaviour" should have been "implementation defined" or "unspecified behaviour" in my opinion. I don't know why they chose "undefined b
by Rexxar 3y ago
A lot of this "undefined behaviour" should have been "implementation defined" or "unspecified behaviour" in my opinion. I don't know why they chose "undefined behaviour" in this case. It was a long time ago, they probably weren't aware it would lead to such problems.
- mike_hock 3y agoSHL masks the shift count, PSLLW/D/Q overshifts "correctly." While that part of the specification predates MMX, they may very well have had the possibility in mind that shifts might be accomplished by multiple instructions with different behavior (if we're gonna give them this much credit). But one way or the other, it's useful now for auto-vectorization.