target/xtensa: move WINDOW_BASE SR update to postprocessing
commit8df3fd359697d68095c5f1ba47e83e8e237a3055
authorMax Filippov <jcmvbkbc@gmail.com>
Wed, 30 Jan 2019 22:56:29 +0000 (30 14:56 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Thu, 28 Feb 2019 12:43:22 +0000 (28 04:43 -0800)
tree09dc8ab20422770cee30babaf7caa4c4b024db26
parent45b71a795e5add347f0ba7aba526896132e9b986
target/xtensa: move WINDOW_BASE SR update to postprocessing

Opcodes that modify WINDOW_BASE SR don't have dependency on opcodes that
use windowed registers. If such opcodes are combined in a single
instruction they may not be correctly ordered. Instead of adding said
dependency use temporary register to store changed WINDOW_BASE value and
do actual register window rotation as a postprocessing step.
Not all opcodes that change WINDOW_BASE need this: retw, rfwo and rfwu
are also jump opcodes, so they are guaranteed to be translated last and
thus will not affect other opcodes in the same instruction.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target/xtensa/cpu.h
target/xtensa/helper.h
target/xtensa/translate.c
target/xtensa/win_helper.c