Re: [patch 2/3] ipc: use shifts to extract seq/idx

From: Manfred Spraul
Date: Thu May 20 2010 - 14:14:50 EST


On 05/20/2010 09:00 AM, Nick Piggin wrote:
All the ipc ids and sequences are signed integers, so power of 2
sequence multiplier does not work so well. Convert it to use shifts,
which improves generated code particularly in ipc_lock/ipc_lock_check
fast paths.

Have you checked the asm output?
I would expect that gcc auto-optimizes constant divides by power-of-two.

--
Manfred
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/