Handle small memory compares against 0
authorMike Danes <onemihaid@hotmail.com>
Mon, 19 Dec 2016 06:36:02 +0000 (08:36 +0200)
committerMike Danes <onemihaid@hotmail.com>
Tue, 17 Jan 2017 18:26:26 +0000 (20:26 +0200)
commit9bc2e775a85667fa85a1254fa4138fb98f417543
tree1c6a79dd4f9d93e2a6c270000123a08c59252c6d
parent0fdbd1d2b531a1c0d0e0531e50a5d2c889dd2fb3
Handle small memory compares against 0

The previous commit missed the TYP_BOOL case that the original code handled. But then the original code failed to do this thinking that "test" will be used. But that means we end up with a "movzx" as well:
       movzx    rax, byte  ptr [rsi+24]
       test     eax, eax
instead of just
       cmp      byte  ptr [rsi+24], 0

The Intel manual actually recomends against using the "cmp mem, imm" form but not if other instructions need to be added. This may warrant further investigation though.

FX diff shows a 7579 bytes improvement without any regressions.
src/jit/lower.cpp