]> git.proxmox.com Git - qemu.git/commit
tcg/arm: fix cross-endian qemu_st16
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 9 Oct 2012 19:53:11 +0000 (21:53 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 24 Nov 2012 12:19:53 +0000 (13:19 +0100)
commit7aab08aa786e3a8838beac758ee61c5000144937
tree7b05548fe1c860313b666d43a66c78f4cbd4ccb5
parentd17bd1d8cc27f8c1a24c65f555a77a661c332b7f
tcg/arm: fix cross-endian qemu_st16

The bswap16 TCG opcode assumes that the high bytes of the temp equal
to 0 before calling it. The ARM backend implementation takes this
assumption to slightly optimize the generated code.

The same implementation is called for implementing the cross-endian
qemu_st16 opcode, where this assumption is not true anymore. One way to
fix that would be to zero the high bytes before calling it. Given the
store instruction just ignore them, it is possible to provide a slightly
more optimized version. With ARMv6+ the rev16 instruction does the work
correctly. For lower ARM versions the patch provides a version which
behaves correctly with non-zero high bytes, but fill them with junk.

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/arm/tcg-target.c