linux/arch/powerpc
Christophe Leroy da74f65920 powerpc/32: add memset16()
Commit 694fc88ce2 ("powerpc/string: Implement optimized
memset variants") added memset16(), memset32() and memset64()
for the 64 bits PPC.

On 32 bits, memset64() is not relevant, and as shown below,
the generic version of memset32() gives a good code, so only
memset16() is candidate for an optimised version.

000009c0 <memset32>:
 9c0:   2c 05 00 00     cmpwi   r5,0
 9c4:   39 23 ff fc     addi    r9,r3,-4
 9c8:   4d 82 00 20     beqlr
 9cc:   7c a9 03 a6     mtctr   r5
 9d0:   94 89 00 04     stwu    r4,4(r9)
 9d4:   42 00 ff fc     bdnz    9d0 <memset32+0x10>
 9d8:   4e 80 00 20     blr

The last part of memset() handling the not 4-bytes multiples
operates on bytes, making it unsuitable for handling word without
modification. As it would increase memset() complexity, it is
better to implement memset16() from scratch. In addition it
has the advantage of allowing a more optimised memset16() than what
we would have by using the memset() function.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-09-01 16:42:45 +10:00
..
boot powerpc: conditionally compile platform-specific serial drivers 2017-08-31 14:26:48 +10:00
configs powerpc/configs: Enable THP and 64K for ppc64(le)_defconfig 2017-08-31 14:26:47 +10:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-05-02 15:53:46 -07:00
include powerpc/32: add memset16() 2017-09-01 16:42:45 +10:00
kernel powerpc: Use instruction emulation infrastructure to handle alignment faults 2017-09-01 16:42:43 +10:00
kvm Merge branch 'topic/ppc-kvm' into next 2017-08-29 21:26:30 +10:00
lib powerpc/32: add memset16() 2017-09-01 16:42:45 +10:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm powerpc/mm/radix: Prettify mapped memory range print out 2017-08-31 14:26:42 +10:00
net powerpc/bpf: Use memset32() to pre-fill traps in BPF page(s) 2017-08-17 23:04:47 +10:00
oprofile ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
perf Merge branch 'topic/ppc-kvm' into next 2017-08-17 23:14:17 +10:00
platforms powerpc/pseries: Don't attempt to acquire drc during memory hot add for assigned lmbs 2017-08-31 20:02:23 +10:00
purgatory powerpc/asm: Convert .llong directives to .8byte 2017-08-31 14:26:47 +10:00
sysdev powerpc/xive: Fix the size of the cpumask used in xive_find_target_in_mask() 2017-08-24 15:20:18 +10:00
tools powerpc/64: Tool to check head sections location sanity 2017-05-30 14:59:51 +10:00
xmon powerpc/xmon: Add ISA v3.0 SPRs to SPR dump 2017-08-31 14:26:45 +10:00
Kconfig powerpc: Use instruction emulation infrastructure to handle alignment faults 2017-09-01 16:42:43 +10:00
Kconfig.debug powerpc/xmon: Enable disassembly files (compilation changes) 2017-02-15 20:02:42 +11:00
Makefile Merge branch 'fixes' into next 2017-08-23 22:20:10 +10:00
Makefile.postlink powerpc/64: Tool to check head sections location sanity 2017-05-30 14:59:51 +10:00