target/xtensa: pass actual frame size to the entry helper
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 7 Feb 2017 10:43:12 +0000 (02:43 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 19 Dec 2017 05:26:18 +0000 (21:26 -0800)
Currently 'entry' opcode helper accepts frame size divided by 8, as it
is encoded in the opcode. Make it more natural and accept actual frame
size instead.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target/xtensa/op_helper.c
target/xtensa/translate.c

index 3d990c0caa44f722c509953a777883a46ec6b489..012552817f74545f3f47a0fd7f95db21bf62489f 100644 (file)
@@ -249,7 +249,7 @@ void HELPER(entry)(CPUXtensaState *env, uint32_t pc, uint32_t s, uint32_t imm)
         if (windowstart & ((1 << callinc) - 1)) {
             HELPER(window_check)(env, pc, callinc);
         }
-        env->regs[(callinc << 2) | (s & 3)] = env->regs[s] - (imm << 3);
+        env->regs[(callinc << 2) | (s & 3)] = env->regs[s] - imm;
         rotate_window(env, callinc);
         env->sregs[WINDOW_START] |=
             windowstart_bit(env->sregs[WINDOW_BASE], env);
index 20f7ddf042f8ac74f0cc15c5da06618136e81b15..225e4a5fe870a099710fcd371b076b06119b77d2 100644 (file)
@@ -2830,7 +2830,7 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc)
                 {
                     TCGv_i32 pc = tcg_const_i32(dc->pc);
                     TCGv_i32 s = tcg_const_i32(BRI12_S);
-                    TCGv_i32 imm = tcg_const_i32(BRI12_IMM12);
+                    TCGv_i32 imm = tcg_const_i32(BRI12_IMM12 << 3);
                     gen_helper_entry(cpu_env, pc, s, imm);
                     tcg_temp_free(imm);
                     tcg_temp_free(s);