Better test narrowing
authorMike Danes <onemihaid@hotmail.com>
Tue, 20 Dec 2016 21:30:35 +0000 (23:30 +0200)
committerMike Danes <onemihaid@hotmail.com>
Tue, 17 Jan 2017 18:26:27 +0000 (20:26 +0200)
commit2e553eb69a40fdc7223f6971141ddd7f52aa7e60
tree393e00c2c15e815001d0b8b62e5822b772b1aa09
parentced5156816df1ae68bca23a847fb2d9d544515fa
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
src/coreclr/src/jit/lower.cpp