You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't know you could do that.
The only instructions I know that access the non-lowest part of an integer register are the byte operations that access AH, BH, CH, DH (bits 8-15).
Even if such an instruction exists, I don't see how you would use it. We need to test that bits 32-63 match bit 31. How would you factor bit 31 into the equation? (x == int64(uint32(x)) might be doable, though.)
This is the standard way to check whether a value is 32 bit:
On amd64, this compiles to a MOVLQSX and a CMPQ. However, it could compile to just a TESTL of the top half of the register.
Is there a reason that we don't have any optimizations like this, other than that no one has bothered to write any yet?
The text was updated successfully, but these errors were encountered: