aboutsummaryrefslogtreecommitdiff
path: root/target/xtensa/win_helper.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-02-11 12:22:29 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2019-02-28 04:43:22 -0800
commitc949009bc0612cbfc7bc5b80c3e9ea3e24313434 (patch)
treef9db6c6424c5ccc8a7b6309edc7da6e7268ec19c /target/xtensa/win_helper.c
parent8df3fd359697d68095c5f1ba47e83e8e237a3055 (diff)
target/xtensa: only rotate window in the retw helper
Move return address calculation and WINDOW_START adjustment out of the retw helper to simplify logic a bit and avoid using registers directly. Pass a0 as a parameter to the helper. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target/xtensa/win_helper.c')
-rw-r--r--target/xtensa/win_helper.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/target/xtensa/win_helper.c b/target/xtensa/win_helper.c
index d7a4e27821..f6f96a64c3 100644
--- a/target/xtensa/win_helper.c
+++ b/target/xtensa/win_helper.c
@@ -184,15 +184,11 @@ void HELPER(test_underflow_retw)(CPUXtensaState *env, uint32_t pc)
}
}
-uint32_t HELPER(retw)(CPUXtensaState *env, uint32_t pc)
+void HELPER(retw)(CPUXtensaState *env, uint32_t a0)
{
- int n = (env->regs[0] >> 30) & 0x3;
- uint32_t windowbase = windowbase_bound(env->sregs[WINDOW_BASE], env);
- uint32_t ret_pc = (pc & 0xc0000000) | (env->regs[0] & 0x3fffffff);
+ int n = (a0 >> 30) & 0x3;
xtensa_rotate_window(env, -n);
- env->sregs[WINDOW_START] &= ~windowstart_bit(windowbase, env);
- return ret_pc;
}
void xtensa_restore_owb(CPUXtensaState *env)