Re: [PATCH 03/17] target/i386: add core of new i386 decoder

2022-08-25 Thread Paolo Bonzini
On 8/25/22 03:47, Richard Henderson wrote: On 8/24/22 10:31, Paolo Bonzini wrote: diff --git a/target/i386/tcg/decode-old.c.inc b/target/i386/tcg/decode-old.c.inc index 603642d6e1..fb86855501 100644 --- a/target/i386/tcg/decode-old.c.inc +++ b/target/i386/tcg/decode-old.c.inc @@ -1808,10

Re: [PATCH 03/17] target/i386: add core of new i386 decoder

2022-08-25 Thread Paolo Bonzini
On 8/25/22 02:12, Richard Henderson wrote: Surely it would be just as readable as static const X86OpEntry onebyte[256] = {     /* * Table A-2: One-byte Opcode Map: 00H — F7H */     [0x00] = X86_OP_ENTRY2(ADD, E,b, G,b),     [0x01] = X86_OP_ENTRY2(ADD, E,v, G,v),     ...    

Re: [PATCH 03/17] target/i386: add core of new i386 decoder

2022-08-24 Thread Richard Henderson
On 8/24/22 10:31, Paolo Bonzini wrote: > diff --git a/target/i386/tcg/decode-old.c.inc > b/target/i386/tcg/decode-old.c.inc > index 603642d6e1..fb86855501 100644 > --- a/target/i386/tcg/decode-old.c.inc > +++ b/target/i386/tcg/decode-old.c.inc > @@ -1808,10 +1808,24 @@ static target_ulong

Re: [PATCH 03/17] target/i386: add core of new i386 decoder

2022-08-24 Thread Richard Henderson
On 8/24/22 10:31, Paolo Bonzini wrote: +static X86OpEntry A4_00_F7[16][8] = { const. Especially for the big tables, but really for anything static that you can get away with. +static void decode_threebyte_38(DisasContext *s, CPUX86State *env, X86OpEntry *entry, uint8_t *b) +{ +*b =

[PATCH 03/17] target/i386: add core of new i386 decoder

2022-08-24 Thread Paolo Bonzini
The new decoder is based on three principles: - use mostly table-driven decoding, using tables derived as much as possible from the Intel manual, keeping the code as "non-branchy" as possible - keep address generation and (for ALU operands) memory loads and write back as much in common code