On Thu, 9 Sept 2021 at 13:10, Yoshinori Sato <ys...@users.sourceforge.jp> wrote: > > Due to an incorrect definition of helper, > TCG optimization could sometimes behave unexpectedly. > > Signed-off-by: Yoshinori Sato <ys...@users.sourceforge.jp>
Could you give more detail, please? I had a look at one or two -- it looks like the floating point related helpers like fadd write to env->fpsw. That is a TCG global, but we only use it in the implementation of the "move from FPSW to a general-purpose register" instruction. So I think the better fix for that case would be to stop defining fpsw as a TCG global and instead make the "move from FPSW" insn use tcg_gen_ld_i32() to read from env->fpsw. Probably doing the same thing for every helper function is not right -- some will be better handled by reducing the use of TCG globals, and some will indeed need to have the TCG_CALL_NO_WG flag removed. thanks -- PMM