arm64/io: Allow I/O writes to use {W,X}ZR
authorRobin Murphy <robin.murphy@arm.com>
Thu, 8 Sep 2016 10:02:20 +0000 (11:02 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 8 Sep 2016 10:04:13 +0000 (11:04 +0100)
commitee5e41b5f21a5438664effce1ba5bdd11e03ee24
tree215fee038e2e7a2a8e864495c867205b59828215
parentefd9e03facd075f5b76bf82e6c785bd45d5cbf4f
arm64/io: Allow I/O writes to use {W,X}ZR

When zeroing an I/O location, the current accessors are forced to
allocate a temporary register to store the zero for the write. By
tweaking the assembly constraints, we can allow the compiler to use
the zero register directly in such cases, and save some juggling.
Compiling a representative kernel configuration with GCC 6 shows
that 2.3KB worth of code can be wasted just on that!

  text     data    bss      dec      hex     filename
 13316776 3248256 18176769 34741801 2121e29 vmlinux.o.new
 13319140 3248256 18176769 34744165 2122765 vmlinux.o.old

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/io.h