Better test narrowing
The previous implementation attemped to narrow down the test mask to have the same type as the memory operand. Appart from unnecessary complications that arise from sign extension the approach doesn't yield the best results in terms of code size.
FX diff shows a 586 bytes improvement without any regressions. All improvements are of the form
test byte ptr [rcx+64], 1
instead of the 3 byte longer
test dword ptr [rcx+64], 1
Commit migrated from https://github.com/dotnet/coreclr/commit/
07d7c735947a7bc11a1e168fdde1388cc66f0b78