OSDN Git Service

MIPS: Use SLL by 0 for 32-bit truncation in `__read_64bit_c0_split'
authorMaciej W. Rozycki <macro@imgtec.com>
Fri, 29 Sep 2017 15:26:31 +0000 (16:26 +0100)
committerJames Hogan <jhogan@kernel.org>
Wed, 8 Nov 2017 21:50:52 +0000 (21:50 +0000)
commitd3a0b968186a7e197b7551e4d6080676372152ce
tree5b80d9ec87799dde7054bd6daa00ee3c9611ee4c
parentb2ec33d438cca839fbb5764bcf5e29cffb3b9721
MIPS: Use SLL by 0 for 32-bit truncation in `__read_64bit_c0_split'

Optimize `__read_64bit_c0_split' and reduce the instruction count by 1,
observing that a DSLL/DSRA pair by 32, is equivalent to SLL by 0, which
architecturally truncates the value requested to 32 bits on 64-bit MIPS
hardware regardless of whether the input operand is or is not a properly
sign-extended 32-bit value.

Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
Reviewed-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17399/
Signed-off-by: James Hogan <jhogan@kernel.org>
arch/mips/include/asm/mipsregs.h