aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--target-xtensa/translate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 1688bb2462..b724d466d6 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -466,7 +466,7 @@ static void gen_wsr_windowbase(DisasContext *dc, uint32_t sr, TCGv_i32 v)
static void gen_wsr_windowstart(DisasContext *dc, uint32_t sr, TCGv_i32 v)
{
- tcg_gen_mov_i32(cpu_SR[sr], v);
+ tcg_gen_andi_i32(cpu_SR[sr], v, (1 << dc->config->nareg / 4) - 1);
reset_used_window(dc);
}