Re: [PATCH 08/18] target/i386: implement CMPccXADD

2023-10-18 Thread Richard Henderson
On 10/14/23 03:01, Paolo Bonzini wrote: +static void gen_CMPccXADD(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode) +{ +TCGv z_tl = tcg_constant_tl(0); +TCGLabel *label_top = gen_new_label(); +TCGLabel *label_bottom = gen_new_label(); +TCGv oldv = tcg_temp_new(); +T

[PATCH 08/18] target/i386: implement CMPccXADD

2023-10-14 Thread Paolo Bonzini
The main difficulty here is that a page fault when writing to the destination must not overwrite the flags. Therefore, the compute-flags helper must be called with a temporary destination instead of using gen_jcc1*. For simplicity, I am using an unconditional cmpxchg operation, that becomes a NOP