remarkable-linux/arch/parisc
George Spelvin 773e1c5fa4 parisc: Add <asm/hash.h>
PA-RISC is interesting; integer multiplies are implemented in the
FPU, so are painful in the kernel.  But it tries to be friendly to
shift-and-add sequences for constant multiplies.

__hash_32 is implemented using the same shift-and-add sequence as
Microblaze, just scheduled for the PA7100.  (It's 2-way superscalar
but in-order, like the Pentium.)

hash_64 was tricky, but a suggestion from Jason Thong allowed a
good solution by breaking up the multiplier.  After a lot of manual
optimization, I found a 19-instruction sequence for the multiply that
can be executed in 10 cycles using only 4 temporaries.

(The PA8xxx can issue 4 instructions per cycle, but 2 must be ALU ops
and 2 must be loads/stores.  And the final add can't be paired.)

An alternative considered, but ultimately not used, was Thomas Wang's
64-to-32-bit integer hash.  At 12 instructions, it's smaller, but they're
all sequentially dependent, so it has longer latency.

https://web.archive.org/web/2011/http://www.concentric.net/~Ttwang/tech/inthash.htm
http://burtleburtle.net/bob/hash/integer.html

Signed-off-by: George Spelvin <linux@sciencehorizons.net>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Helge Deller <deller@gmx.de>
2016-08-02 16:44:29 +02:00
..
configs KEYS: CONFIG_KEYS_DEBUG_PROC_KEYS is no longer an option 2016-02-10 10:13:27 +00:00
include parisc: Add <asm/hash.h> 2016-08-02 16:44:29 +02:00
kernel parisc: Move die_if_kernel() prototype into traps.h header 2016-06-05 08:49:01 +02:00
lib parisc: Add native high-resolution sched_clock() implementation 2016-05-22 21:39:25 +02:00
math-emu parisc: Fix typo in fpudispatch.c 2016-05-22 22:29:07 +02:00
mm parisc: Unbreak handling exceptions from kernel modules 2016-04-08 22:14:14 +02:00
oprofile
defpalo.conf
install.sh
Kconfig parisc: Add <asm/hash.h> 2016-08-02 16:44:29 +02:00
Kconfig.debug parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
Makefile parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
nm