gatchat: Optimize ringbuffer modulo operations
authorPatrick Porlan <patrick.porlan@linux.intel.com>
Wed, 2 Mar 2011 10:15:35 +0000 (11:15 +0100)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 3 Mar 2011 04:50:32 +0000 (22:50 -0600)
commit992019cad42eb4c9ca5a558c2a18d4a594d1155e
treec2ae7a43a37e138ec53f1d904d4e29d99c6ec7ea
parent9b1675c000a8d09f7cb77d1c7df036636a443e94
gatchat: Optimize ringbuffer modulo operations

Replace modulo operations in ringbuffer.c by masking operations.  This
is possible because the size of the ring buffers is always a power of
two, and yields a small performance improvement.

The improvement should be mostly visible on processors that implement
division in microcode (Atom) or lack a division instruction (ARM).
gatchat/ringbuffer.c