/
usr
/
src
/
linux-headers-5.15.0-181
/
arch
/
microblaze
/
include
/
asm
/
/usr/src/linux-headers-5.15.0-181/arch/microblaze/include/asm
mkdir
upload
Name
Size
Mode
Actions
asm-compat.h
518
0644
edit
dl
rm
asm-offsets.h
35
0644
edit
dl
rm
barrier.h
313
0644
edit
dl
rm
cache.h
510
0644
edit
dl
rm
cacheflush.h
3209
0644
edit
dl
rm
checksum.h
806
0644
edit
dl
rm
cpuinfo.h
2043
0644
edit
dl
rm
current.h
714
0644
edit
dl
rm
delay.h
2138
0644
edit
dl
rm
dma.h
432
0644
edit
dl
rm
elf.h
602
0644
edit
dl
rm
entry.h
1018
0644
edit
dl
rm
exceptions.h
1928
0644
edit
dl
rm
fixmap.h
1874
0644
edit
dl
rm
flat.h
1982
0644
edit
dl
rm
ftrace.h
642
0644
edit
dl
rm
futex.h
2179
0644
edit
dl
rm
hash.h
2429
0644
edit
dl
rm
highmem.h
1800
0644
edit
dl
rm
io.h
1691
0644
edit
dl
rm
irq.h
376
0644
edit
dl
rm
irqflags.h
2529
0644
edit
dl
rm
Kbuild
250
0644
edit
dl
rm
kgdb.h
739
0644
edit
dl
rm
mmu.h
4050
0644
edit
dl
rm
mmu_context.h
72
0644
edit
dl
rm
mmu_context_mm.h
3893
0644
edit
dl
rm
module.h
704
0644
edit
dl
rm
page.h
4076
0644
edit
dl
rm
pci-bridge.h
4473
0644
edit
dl
rm
pci.h
1986
0644
edit
dl
rm
pgalloc.h
1042
0644
edit
dl
rm
pgtable.h
14526
0644
edit
dl
rm
processor.h
2693
0644
edit
dl
rm
ptrace.h
591
0644
edit
dl
rm
pvr.h
8791
0644
edit
dl
rm
registers.h
1508
0644
edit
dl
rm
seccomp.h
256
0644
edit
dl
rm
sections.h
501
0644
edit
dl
rm
setup.h
823
0644
edit
dl
rm
string.h
494
0644
edit
dl
rm
switch_to.h
493
0644
edit
dl
rm
syscall.h
2346
0644
edit
dl
rm
thread_info.h
3979
0644
edit
dl
rm
timex.h
266
0644
edit
dl
rm
tlbflush.h
1579
0644
edit
dl
rm
uaccess.h
8121
0644
edit
dl
rm
unistd.h
1051
0644
edit
dl
rm
unwind.h
611
0644
edit
dl
rm
vmalloc.h
108
0644
edit
dl
rm
Edit:
/usr/src/linux-headers-5.15.0-181/arch/microblaze/include/asm/hash.h
(2429B)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_HASH_H #define _ASM_HASH_H /* * Fortunately, most people who want to run Linux on Microblaze enable * both multiplier and barrel shifter, but omitting them is technically * a supported configuration. * * With just a barrel shifter, we can implement an efficient constant * multiply using shifts and adds. GCC can find a 9-step solution, but * this 6-step solution was found by Yevgen Voronenko's implementation * of the Hcub algorithm at http://spiral.ece.cmu.edu/mcm/gen.html. * * That software is really not designed for a single multiplier this large, * but if you run it enough times with different seeds, it'll find several * 6-shift, 6-add sequences for computing x * 0x61C88647. They are all * c = (x << 19) + x; * a = (x << 9) + c; * b = (x << 23) + a; * return (a<<11) + (b<<6) + (c<<3) - b; * with variations on the order of the final add. * * Without even a shifter, it's hopless; any hash function will suck. */ #if CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL == 0 #define HAVE_ARCH__HASH_32 1 /* Multiply by GOLDEN_RATIO_32 = 0x61C88647 */ static inline u32 __attribute_const__ __hash_32(u32 a) { #if CONFIG_XILINX_MICROBLAZE0_USE_BARREL unsigned int b, c; /* Phase 1: Compute three intermediate values */ b = a << 23; c = (a << 19) + a; a = (a << 9) + c; b += a; /* Phase 2: Compute (a << 11) + (b << 6) + (c << 3) - b */ a <<= 5; a += b; /* (a << 5) + b */ a <<= 3; a += c; /* (a << 8) + (b << 3) + c */ a <<= 3; return a - b; /* (a << 11) + (b << 6) + (c << 3) - b */ #else /* * "This is really going to hurt." * * Without a barrel shifter, left shifts are implemented as * repeated additions, and the best we can do is an optimal * addition-subtraction chain. This one is not known to be * optimal, but at 37 steps, it's decent for a 31-bit multiplier. * * Question: given its size (37*4 = 148 bytes per instance), * and slowness, is this worth having inline? */ unsigned int b, c, d; b = a << 4; /* 4 */ c = b << 1; /* 1 5 */ b += a; /* 1 6 */ c += b; /* 1 7 */ c <<= 3; /* 3 10 */ c -= a; /* 1 11 */ d = c << 7; /* 7 18 */ d += b; /* 1 19 */ d <<= 8; /* 8 27 */ d += a; /* 1 28 */ d <<= 1; /* 1 29 */ d += b; /* 1 30 */ d <<= 6; /* 6 36 */ return d + c; /* 1 37 total instructions*/ #endif } #endif /* !CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL */ #endif /* _ASM_HASH_H */
Save
cmd:
run