Messages in this thread | | | Subject | Re: [PATCH 2/2] The new jhash implementation | From | Eric Dumazet <> | Date | Thu, 25 Nov 2010 15:05:46 +0100 |
| |
Le jeudi 25 novembre 2010 à 21:55 +0800, Changli Gao a écrit :
> > I suggest : > > > > #include <linux/unaligned/packed_struct.h> > > ... > > a += __get_unaligned_cpu32(k); > > b += __get_unaligned_cpu32(k+4); > > c += __get_unaligned_cpu32(k+8); > > > > Fits nicely in registers. > > > > I think you mean get_unaligned_le32(). >
No, I meant __get_unaligned_cpu32()
We do same thing in jhash2() :
a += k[0]; b += k[1]; c += k[2];
We dont care of bit order of the 32bit quantity we are adding to a,b or c , as long its consistent for the current machine ;)
get_unaligned_le32() would be slow on big endian arches.
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |