snappy (Revision: r69) update, ported by VOKU.
http://code.google.com/p/snappy/source/detail?r=69

more things/changes for testing here -> http://code.google.com/p/snappy/source/list

Change a few ORs to additions where they don't matter. This helps the compiler
use the LEA instruction more efficiently, since e.g. a + (b << 2) can be encoded
as one instruction. Even more importantly, it can constant-fold the
COPY_* enums together with the shifted negative constants, which also saves
some instructions. (We don't need it for LITERAL, since it happens to be 0.)

I am unsure why the compiler couldn't do this itself, but the theory is that
it cannot prove that len-1 and len-4 cannot underflow/wrap, and thus can't
do the optimization safely.

The gains are small but measurable; 0.5-1.0% over the BM_Z* benchmarks
(measured on Westmere, Sandy Bridge and Istanbul).

commit 9439bd401ac645e15d7b5315de9a4af72ebf9d35 1 parent 904ea3b
voku authored 17 hours ago