On Sat, Oct 14, 2023 at 6:06 PM Richard Henderson <
richard.henderson@linaro.org> wrote:
>
> On 10/14/23 03:01, Paolo Bonzini wrote:
> > +static void prepare_update1_cc(X86DecodedInsn *decode, DisasContext *s, CCOp op)
> > +{
> > + decode->cc_dst = s->T0;
> > + set_cc_op(s, op);
> > +}
>
> You must delay the set_cc_op() until the end too, for the same reason. The function call
> will emit discard opcodes, which will kill cc_foo while still live via the memory exception.
Right, that can affect previous instructions due to dead code elimination.
I even wrote part of that code. :)
Since I have to add decode->cc_op, I'll add CC_OP_DYNAMIC handling as well, and
assert that everything is NULL if the gen_* function didn't touch decode->cc_op.
Thanks!
Paolo
>
>
> r~
>