RE: [PATCH] ppc/pvn.c: fix "system-id" FDT when -uuid is set

2021-12-06 Thread Luis Fernando Fujita Pires
From: Daniel Henrique Barboza > Subject: [PATCH] ppc/pvn.c: fix "system-id" FDT when -uuid is set I don't know enough to review this, but there's a typo on the commit message (pvn.c -> pnv.c). :) -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: Fwd: New Defects reported by Coverity Scan for QEMU

2021-11-16 Thread Luis Fernando Fujita Pires
From: Matheus K. Ferst > Hi Cédric, > > The only change was the helper name that is now uppercase, so nothing new > here. The underlying cause is that dfp_finalize_decimal64 only sets > dfp->vt.VsrD(1) and set_dfp64 receives a pointer to the complete struct. > > But since set_dfp64 also only

RE: [PATCH] tcg: Extend call args using the correct opcodes

2021-10-28 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pretending that the source is i64 when it is in fact i32 is incorrect; we > have type- > changing opcodes that must be used. > This bug trips up the subsequent change to the optimizer. > > Fixes: 4f2331e5b67a > Signed-off-by: Richard Henderson > --- > > This fixes a

RE: [PATCH v4 51/51] tcg/optimize: Propagate sign info for shifting

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > For constant shifts, we can simply shift the s_mask. > > For variable shifts, we know that sar does not reduce the s_mask, which helps > for sequences like > > ext32s_i64 t, in > sar_i64 t, t, v > ext32s_i64 out, t > > allowing the final extend to be

RE: [PATCH v4 49/51] tcg/optimize: Propagate sign info for setcond

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > The result is either 0 or 1, which means that we have a 2 bit signed result, > and > thus 62 bits of sign. > For clarity, use the smask_from_zmask function. > > Reviewed-by: Alex Bennée > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 2 ++ > 1 file

RE: [PATCH v4 50/51] tcg/optimize: Propagate sign info for bit counting

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > The results are generally 6 bit unsigned values, though the count leading and > trailing bits may produce any value for a zero input. > > Reviewed-by: Alex Bennée > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 3 ++- > 1 file changed, 2 insertions(+), 1

RE: [PATCH v4 47/51] tcg/optimize: Optimize sign extensions

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Certain targets, like riscv, produce signed 32-bit results. > This can lead to lots of redundant extensions as values are manipulated. > > Begin by tracking only the obvious sign-extensions, and converting them to > simple copies when possible. > > Reviewed-by: Alex

RE: [PATCH v4 48/51] tcg/optimize: Propagate sign info for logical operations

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Sign repetitions are perforce all identical, whether they are 1 or 0. > Bitwise operations preserve the relative quantity of the repetitions. > > Reviewed-by: Alex Bennée > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c

RE: [PATCH v4 46/51] tcg/optimize: Use fold_xx_to_i for rem

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > static bool fold_remainder(OptContext *ctx, TCGOp *op) { > -return fold_const2(ctx, op); > +if (fold_const2(ctx, op) || > +fold_xx_to_i(ctx, op, 1)) { Should this be fold_xx_to_i(ctx, op, 0)? If arg[2] is 0, we would have different results than

RE: [PATCH v4 43/51] tcg/optimize: Use fold_xx_to_i for orc

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Recognize the constant function for or-compliment. Minor typo: or-complement. Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v4 45/51] tcg/optimize: Use fold_xi_to_x for div

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Recognize the identity function for division. > > Suggested-by: Luis Pires > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO

RE: [PATCH v4 44/51] tcg/optimize: Use fold_xi_to_x for mul

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Recognize the identity function for low-part multiply. > > Suggested-by: Luis Pires > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas

RE: [PATCH v4 41/51] tcg/optimize: Sink commutative operand swapping into fold functions

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > static bool fold_add2(OptContext *ctx, TCGOp *op) { > +swap_commutative(op->args[0], >args[2], >args[4]); > +swap_commutative(op->args[1], >args[3], >args[5]); This was existing code, but I would've understood it easier if it had a comment noting that, even

RE: [PATCH v4 42/51] tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > This "garbage" setting pre-dates the addition of the type changing opcodes > INDEX_op_ext_i32_i64, INDEX_op_extu_i32_i64, and > INDEX_op_extr{l,h}_i64_i32. > > So now we have a definitive points at which to adjust z_mask to eliminate such > bits from the 32-bit

RE: [PATCH v4 40/51] tcg/optimize: Expand fold_addsub2_i32 to 64-bit ops

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Rename to fold_addsub2. > Use Int128 to implement the wider operation. > > Reviewed-by: Alex Bennée > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 65 ++ > 1 file

RE: [PATCH v4 39/51] tcg/optimize: Expand fold_mulu2_i32 to all 4-arg multiplies

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Rename to fold_multiply2, and handle muls2_i32, mulu2_i64, and muls2_i64. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 44 +++- > 1 file changed, 35 insertions(+), 9

RE: [PATCH v4 38/51] tcg/optimize: Split out fold_masks

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > @@ -1084,7 +1215,15 @@ static bool fold_extract(OptContext *ctx, TCGOp > *op) > t = extract64(t, op->args[2], op->args[3]); > return tcg_opt_gen_movi(ctx, op, op->args[0], t); > } > -return false; > + > +z_mask_old =

RE: [PATCH v4 34/51] tcg/optimize: Split out fold_to_not

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Split out the conditional conversion from a more complex logical operation to > a > simple NOT. Create a couple more helpers to make this easy for the outer-most > logical operations. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 158

RE: [PATCH v4 36/51] tcg/optimize: Split out fold_xi_to_x

2021-10-27 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, a, i => mov r, a" optimization into a function, and use them > in the > outer-most logical operations. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 61 +- > 1 file changed, 26

RE: [PATCH v3 07/22] host-utils: add 128-bit quotient support to divu128/divs128

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > > A new argument, prem, was added to divu128/divs128 to receive the > > remainder, freeing up phigh to receive the high 64 bits of the > > quotient. > > > > Signed-off-by: Luis Pires > > Why not return the remainder? That would avoid the need for an extra > argument,

RE: [PATCH v3 16/22] target/ppc: Move dtstdc[q]/dtstdg[q] to decodetree

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > On 9/10/21 4:26 AM, Luis Pires wrote: > > +_bf_fra bf fra dm > > +@Z22_bf_fra .. bf:3 .. fra:5 dm:6 . . _bf_fra > > + > > +%z22_frap 17:4 !function=times_2 > > +@Z22_bf_frap.. bf:3 .. 0 dm:6 . . _bf_fra >

RE: [PATCH v3 15/22] target/ppc: Implement DCTFIXQQ

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > > +static void set_dfp128_to_avr(ppc_avr_t *dst, ppc_vsr_t *src) { > > +dst->VsrD(0) = src->VsrD(0); > > +dst->VsrD(1) = src->VsrD(1); > > +} > > Given that these two are typedef of one another, I would think this is > unnecessary and you should just write *dst

RE: [PATCH v3 34/48] tcg/optimize: Split out fold_to_not

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > >> static bool fold_eqv(OptContext *ctx, TCGOp *op) { > >> -return fold_const2(ctx, op); > >> +if (fold_const2(ctx, op) || > >> +fold_xi_to_not(ctx, op, 0)) { > > > > Should be fold_ix_to_not (not fold xi_to_not). > > No, because for eqv we expect

RE: [PATCH v3 37/48] tcg/optimize: Split out fold_ix_to_i

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, 0, b => movi r, 0" optimization into a function, and use it in > fold_shift. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 28 ++-- > 1 file changed, 10 insertions(+), 18 deletions(-) Reviewed-by: Luis Pires

RE: [PATCH v3 36/48] tcg/optimize: Split out fold_xi_to_x

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, a, i => mov r, a" optimization into a function, and use them > int the > outer-most logical operations. Typo: "int" -> "in". > -/* Simplify expression for "op r, a, const => mov r, a" cases */ > -switch (opc) { > -

RE: [PATCH v3 34/48] tcg/optimize: Split out fold_to_not

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Split out the conditional conversion from a more complex logical operation to > a > simple NOT. Create a couple more helpers to make this easy for the outer-most > logical operations. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 154

RE: [PATCH v3 35/48] tcg/optimize: Split out fold_sub_to_neg

2021-10-25 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Even though there is only one user, place this more complex conversion into > its > own helper. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 84 -- > 1 file changed, 47 insertions(+), 37 deletions(-)

RE: [PATCH v3 33/48] tcg/optimize: Add type to OptContext

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > @@ -1392,18 +1408,18 @@ void tcg_optimize(TCGContext *s) > /* Proceed with possible constant folding. */ > break; > } > -if (opc == INDEX_op_sub_i32) { > +switch (ctx.type) { > +

RE: [PATCH v3 32/48] tcg/optimize: Split out fold_xi_to_i

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, a, 0 => movi r, 0" optimization into a function, and use it > in the > outer opcode fold functions. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 32 +++- > 1 file

RE: [PATCH v3 31/48] tcg/optimize: Split out fold_xx_to_x

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, a, a => mov r, a" optimization into a function, and use it in > the > outer opcode fold functions. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 39 --- > 1

RE: [PATCH v3 30/48] tcg/optimize: Split out fold_xx_to_i

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Pull the "op r, a, a => movi r, 0" optimization into a function, and use it > in the > outer opcode fold functions. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 41 - > 1

RE: [PATCH v3 29/48] tcg/optimize: Split out fold_mov

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > This is the final entry in the main switch that was in a different form. > After this, > we have the option to convert the switch into a function dispatch table. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 27

RE: [PATCH v3 26/48] tcg/optimize: Split out fold_count_zeros

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 32 ++-- > 1 file changed, 18 insertions(+), 14 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v3 28/48] tcg/optimize: Split out fold_dup, fold_dup2

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 53 +- > 1 file changed, 31 insertions(+), 22 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v3 24/48] tcg/optimize: Split out fold_extract, fold_sextract

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 48 ++-- > 1 file changed, 30 insertions(+), 18 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v3 27/48] tcg/optimize: Split out fold_bswap

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 27 --- > 1 file changed, 16 insertions(+), 11 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal -

RE: [PATCH v3 22/48] tcg/optimize: Split out fold_movcond

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 56 -- > 1 file changed, 31 insertions(+), 25 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v3 25/48] tcg/optimize: Split out fold_deposit

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 25 +++-- > 1 file changed, 15 insertions(+), 10 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v3 23/48] tcg/optimize: Split out fold_extract2

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 39 ++- > 1 file changed, 22 insertions(+), 17 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v3 21/48] tcg/optimize: Split out fold_addsub2_i32

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Add two additional helpers, fold_add2_i32 and fold_sub2_i32 which will not be > simple wrappers forever. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 70 +++--- > 1 file changed, 44 insertions(+), 26

RE: [PATCH v3 20/48] tcg/optimize: Split out fold_mulu2_i32

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 37 + > 1 file changed, 21 insertions(+), 16 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v3 17/48] tcg/optimize: Split out fold_brcond2

2021-10-22 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Reduce some code duplication by folding the NE and EQ cases. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 159 + > 1 file changed, 81 insertions(+), 78 deletions(-) Reviewed-by: Luis Pires -- Luis

RE: [PATCH v2 18/48] tcg/optimize: Split out fold_brcond

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 33 +++-- > 1 file changed, 19 insertions(+), 14 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v2 01/48] tcg/optimize: Rename "mask" to "z_mask"

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Prepare for tracking different masks by renaming this one. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 142 + > 1 file changed, 72 insertions(+), 70 deletions(-)

RE: [PATCH v2 19/48] tcg/optimize: Split out fold_setcond

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 23 ++- > 1 file changed, 14 insertions(+), 9 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v2 11/48] tcg/optimize: Return true from tcg_opt_gen_{mov, movi}

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > This will allow callers to tail call to these functions and return true > indicating > processing complete. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 9 + > 1 file changed, 5 insertions(+), 4

RE: [PATCH v2 17/48] tcg/optimize: Split out fold_brcond2

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Reduce some code duplication by folding the NE and EQ cases. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 161 + > 1 file changed, 83 insertions(+), 78 deletions(-) > +case TCG_COND_NE: > +

RE: [PATCH v2 13/48] tcg/optimize: Use a boolean to avoid a mass of continues

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH v2 15/48] tcg/optimize: Split out fold_const{1,2}

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Split out a whole bunch of placeholder functions, which are currently > identical. > That won't last as more code gets moved. > > Use CASE_32_64_VEC for some logical operators that previously missed the > addition of vectors. > > Signed-off-by: Richard Henderson >

RE: [PATCH v2 12/48] tcg/optimize: Split out finish_folding

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Copy z_mask into OptContext, for writeback to the first output within the new > function. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 49 + > 1 file changed, 33 insertions(+), 16 deletions(-)

RE: [PATCH v2 16/48] tcg/optimize: Split out fold_setcond2

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Reduce some code duplication by folding the NE and EQ cases. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 145 - > 1 file changed, 72 insertions(+), 73 deletions(-) > -i =

RE: [PATCH v2 06/48] tcg/optimize: Split out init_arguments

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > There was no real reason for calls to have separate code here. > Unify init for calls vs non-calls using the call path, which handles > TCG_CALL_DUMMY_ARG. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 25

RE: [PATCH v2 07/48] tcg/optimize: Split out copy_propagate

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Continue splitting tcg_optimize. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 22 ++ > 1 file changed, 14 insertions(+), 8 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de

RE: [PATCH v2 09/48] tcg/optimize: Drop nb_oargs, nb_iargs locals

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Rather than try to keep these up-to-date across folding, re-read nb_oargs at > the > end, after re-reading the opcode. > > A couple of asserts need dropping, but that will take care of itself as we > split the > function further. > > Signed-off-by: Richard Henderson

RE: [PATCH v2 10/48] tcg/optimize: Change fail return for do_constant_folding_cond*

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Return -1 instead of 2 for failure. > This us to use comparisons against 0 for all cases. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 145 + > 1 file changed, 74 insertions(+), 71 deletions(-)

RE: [PATCH v2 14/48] tcg/optimize: Split out fold_mb, fold_qemu_{ld,st}

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > This puts the separate mb optimization into the same framework as the others. > While fold_qemu_{ld,st} are currently identical, that won't last as more code > gets moved. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 89

RE: [PATCH v2 05/48] tcg/optimize: Move prev_mb into OptContext

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > This will expose the variable to subroutines that will be broken out of > tcg_optimize. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto

RE: [PATCH v2 04/48] tcg/optimize: Change tcg_opt_gen_{mov, movi} interface

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Adjust the interface to take the OptContext parameter instead of TCGContext or > both. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 67 +- > 1 file changed, 34 insertions(+), 33 deletions(-)

RE: [PATCH v2 03/48] tcg/optimize: Remove do_default label

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Break the final cleanup clause out of the main switch statement. When fully > folding an opcode to mov/movi, use "continue" to process the next opcode, else > break to fall into the final cleanup. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 190

RE: [PATCH v2 02/48] tcg/optimize: Split out OptContext

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Provide what will become a larger context for splitting the very large > tcg_optimize function. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 77 ++ > 1 file changed, 40 insertions(+), 37 deletions(-)

RE: [PATCH v2 08/48] tcg/optimize: Split out fold_call

2021-10-20 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Calls are special in that they have a variable number of arguments, and need > to > be able to clobber globals. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 63 -- > 1 file changed, 41 insertions(+), 22

RE: [PATCH v3 00/22] target/ppc: DFP instructions using decodetree

2021-10-15 Thread Luis Fernando Fujita Pires
Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html> > -Original Message- > From: da...@gibson.dropbear.id.au > Sent: sexta-feira, 15 de outubro de 2021 00:15 > To: Luis Fernando Fujita Pires > Cc: qemu-de

RE: [PATCH v3 00/22] target/ppc: DFP instructions using decodetree

2021-10-14 Thread Luis Fernando Fujita Pires
Ping? > -Original Message- > From: Luis Fernando Fujita Pires > Sent: segunda-feira, 20 de setembro de 2021 15:51 > To: Luis Fernando Fujita Pires ; qemu- > de...@nongnu.org; qemu-...@nongnu.org > Cc: da...@gibson.dropbear.id.au; gr...@kaod.org; > richard.hender...

RE: [PATCH v3 00/22] target/ppc: DFP instructions using decodetree

2021-09-20 Thread Luis Fernando Fujita Pires
Ping. Patches 1-4 were already applied, and patches 5-8, 12, 15, 18 are missing reviews. Thanks, -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer From: Luis Pires > This series moves all existing DFP instructions to

RE: [PATCH v4 4/4] target/ppc: Fix 64-bit decrementer

2021-09-20 Thread Luis Fernando Fujita Pires
From: Cédric Le Goater > The current way the mask is built can overflow with a 64-bit decrementer. > Use sextract64() to extract the signed values and remove the logic to handle > negative values which has become useless. > > Cc: Luis Fernando Fujita Pires > Fixes: a8dafa5

RE: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-17 Thread Luis Fernando Fujita Pires
From: Cédric Le Goater > >> +target_long signed_value; > >> +target_long signed_decr; > > > > Since these values will be the results of sextract64, it's probably better > > to > define them as int64_t. > > but then it breaks the code doing the logging on PPC32 targets :/ You mean here?

RE: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-16 Thread Luis Fernando Fujita Pires
Hi Cédric, These changes look good and seem to replicate the exact behavior we had before, while fixing the 64-bit dec from MicroWatt. A few notes, in case they help others, too: According to the Power ISA: When not in Large Decrementer mode: - the maximum positive value for the

RE: [PATCH] target/ppc: Fix 64-bit decrementer

2021-09-13 Thread Luis Fernando Fujita Pires
> > value = extract64(value, 0, nr_bits); > > value = ((target_long)value << (64 - nr_bits)) >> (64 - nr_bits); > > Oops, sorry. 64 might not be correct here. It would depend on the target being > either 32 or 64. In fact, sextract already does the sign extension, so this should be all

RE: [PATCH] target/ppc: Fix 64-bit decrementer

2021-09-13 Thread Luis Fernando Fujita Pires
> value = extract64(value, 0, nr_bits); > value = ((target_long)value << (64 - nr_bits)) >> (64 - nr_bits); Oops, sorry. 64 might not be correct here. It would depend on the target being either 32 or 64. -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH] target/ppc: Fix 64-bit decrementer

2021-09-13 Thread Luis Fernando Fujita Pires
> > bool negative; > > > > /* Truncate value to decr_width and sign extend for simplicity */ > > -value &= ((1ULL << nr_bits) - 1); > > +value &= MAKE_64BIT_MASK(0, nr_bits); > > What about: > >value = extract64(value, 0, nr_bits); >if (value !=

RE: [PATCH v2 04/19] host-utils: add 128-bit quotient support to divu128/divs128

2021-09-02 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Hmm. I'll note that we have a better divmod primitive in tree, but we aren't > using it > here: udiv_qrnnd in include/fpu/softfloat-macros.h. Good to know! I'll change to a (much simpler) implementation using udiv_qrnnd. Any pointers on what would be a good place to

RE: [PATCH v2 03/19] host-utils: move checks out of divu128/divs128

2021-09-02 Thread Luis Fernando Fujita Pires
From: Richard Henderson > > -static inline int divs128(int64_t *plow, int64_t *phigh, int64_t > > divisor) > > +static inline void divs128(int64_t *plow, int64_t *phigh, int64_t > > +divisor) > > { > > -if (divisor == 0) { > > -return 1; > > -} else { > > -__int128_t

RE: [PATCH v2 09/19] target/ppc: Implement DCFFIXQQ

2021-09-01 Thread Luis Fernando Fujita Pires
From: Matheus K. Ferst > > On 8/31/21 9:39 AM, Luis Pires wrote: > >> +DEF_HELPER_3(DCFFIXQQ, void, env, fprp, avr) > > > > Shouldn't be upcase. None of the others are. > > > > The reason for this change is on patch 13 and onwards. Matching the case of > the > instruction name in the trans_

RE: [PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-27 Thread Luis Fernando Fujita Pires
> >> Oh, I wasn't referring to any specific users. What I meant is that, > >> if we make abs64() generically available from host-utils, callers > >> could expect it to behave the same way as abs() in stdlib, for > >> example. > > > > That would be surprising, but do you think there are cases where

RE: [PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-25 Thread Luis Fernando Fujita Pires
From: Eduardo Habkost > > Right, that's true of any standard implementation of abs(). > > I thought about making it return uint64_t, but that could make it > > weird for other uses of abs64(), where callers wouldn't expect a type > > change from int64_t to uint64_t. Maybe create a separate

RE: [PATCH 02/19] host-utils: move abs64() to host-utils

2021-08-25 Thread Luis Fernando Fujita Pires
From: David Gibson > Hrm.. I'm a bit concerned about mkaing this a more widespread function, > because it has a nasty edge case... which is basically unavoidable in an > abs64() > implementation. Specifically: > > abs64(0x800___0) == 0x800___ < 0 > > At least in the

RE: [PATCH for-6.2 v2 2/2] target/ppc: fix vector registers access in gdbstub for little-endian

2021-08-19 Thread Luis Fernando Fujita Pires
> Maybe we should fix this by making the 'struct Int128' field order depend on > HOST_WORDS_BIGENDIAN... +1 for that. -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH 01/26] accel/tcg: Introduce translator_use_goto_tb

2021-06-21 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Add a generic version of the common use_goto_tb test. > > Signed-off-by: Richard Henderson > --- > include/exec/translator.h | 10 ++ > accel/tcg/translator.c| 11 +++ > 2 files changed, 21 insertions(+) Reviewed-by: Luis Pires -- Luis Pires

RE: [PATCH 17/26] target/ppc: Use translator_use_goto_tb

2021-06-21 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Cc: David Gibson > Signed-off-by: Richard Henderson > --- > target/ppc/translate.c | 10 +- > 1 file changed, 1 insertion(+), 9 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal - Disclaimer

RE: [PATCH] tcg: Fix documentation for tcg_constant_* vs tcg_temp_free_*

2021-06-10 Thread Luis Fernando Fujita Pires
From: Richard Henderson > At some point during the development of tcg_constant_*, I changed my mind > about whether such temps should be able to be passed to tcg_temp_free_*. > The final version committed allows this, but the commentary was not updated > to match. > > Fixes: c0522136adf >

RE: [PATCH] accel/tcg: Use MiB in tcg_init_machine

2021-06-10 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Suggested-by: Alex Bennée > Signed-off-by: Richard Henderson > --- > > This sits in the middle of my "Clean up code_gen_buffer allocation" > patch set. Alex mentioned it during review, and I had already made the > change. > > This is the only patch in the set that

RE: [PATCH v3 26/28] tcg: Merge buffer protection and guard page protection

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Do not handle protections on a case-by-case basis in the various > alloc_code_gen_buffer instances; do it within a single loop in > tcg_region_init. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 45 +++-- > 1 file

RE: [PATCH v3 25/28] tcg: Round the tb_size default from qemu_get_host_physmem

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > If qemu_get_host_physmem returns an odd number of pages, then physmem / 8 > will not be a multiple of the page size. > > The following was observed on a gitlab runner: > > ERROR qtest-arm/boot-serial-test - Bail out! > ERROR:../util/osdep.c:80:qemu_mprotect__osdep: \ >

RE: [PATCH v3 28/28] tcg: Move tcg_init_ctx and tcg_ctx from accel/tcg/

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > These variables belong to the jit side, not the user side. > > Since tcg_init_ctx is no longer used outside of tcg/, move the declaration to > tcg/internal.h. > > Suggested-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > include/tcg/tcg.h

RE: [PATCH v3 24/28] util/osdep: Add qemu_mprotect_rw

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > For --enable-tcg-interpreter on Windows, we will need this. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > include/qemu/osdep.h | 1 + > util/osdep.c | 9 + > 2 files changed, 10 insertions(+) Reviewed-by: Luis

RE: [PATCH v3 21/28] tcg: Allocate code_gen_buffer into struct tcg_region_state

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Do not mess around with setting values within tcg_init_ctx. > Put the values into 'region' directly, which is where they will live for the > lifetime > of the program. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 64

RE: [PATCH v3 27/28] tcg: When allocating for !splitwx, begin with PROT_NONE

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > There's a change in mprotect() behaviour [1] in the latest macOS on M1 and > it's > not yet clear if it's going to be fixed by Apple. > > In this case, instead of changing permissions of N guard pages, we change > permissions of N rwx regions. The same number of

RE: [PATCH v3 18/28] tcg: Tidy tcg_n_regions

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Compute the value using straight division and bounds, rather than a loop. > Pass > in tb_size rather than reading from tcg_init_ctx.code_gen_buffer_size, > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 29 - > 1 file changed,

RE: [PATCH v3 16/28] tcg: Replace region.end with region.total_size

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > A size is easier to work with than an end point, particularly during initial > buffer > allocation. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 29 + > 1 file changed, 17 insertions(+), 12 deletions(-) Reviewed-by: Luis

RE: [PATCH v3 23/28] tcg: Sink qemu_madvise call to common code

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Move the call out of the N versions of alloc_code_gen_buffer and into > tcg_region_init. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto

RE: [PATCH v3 14/28] tcg: Introduce tcg_max_ctxs

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Finish the divorce of tcg/ from hw/, and do not take the max cpu value from > MachineState; just remember what we were passed in tcg_init. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > tcg/internal.h | 3 ++- > tcg/region.c |

RE: [PATCH v3 13/28] accel/tcg: Pass down max_cpus to tcg_init

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Start removing the include of hw/boards.h from tcg/. > Pass down the max_cpus value from tcg_init_machine, where we have the > MachineState already. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > include/tcg/tcg.h | 2 +- >

RE: [PATCH v3 20/28] tcg: Move in_code_gen_buffer and tests to region.c

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Shortly, the full code_gen_buffer will only be visible to region.c, so move > in_code_gen_buffer out-of-line. > > Move the debugging versions of tcg_splitwx_to_{rx,rw} to region.c as well, so > that the compiler gets to see the implementation of in_code_gen_buffer. > >

RE: [PATCH v3 22/28] tcg: Return the map protection from alloc_code_gen_buffer

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Change the interface from a boolean error indication to a negative error vs a > non-negative protection. For the moment this is only interface change, not > making use of the new data. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 63

RE: [PATCH v3 11/28] tcg: Create tcg_init

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Perform both tcg_context_init and tcg_region_init. > Do not leave this split to the caller. > > Signed-off-by: Richard Henderson > --- > include/tcg/tcg.h | 3 +-- > tcg/internal.h| 1 + > accel/tcg/translate-all.c | 3 +-- > tcg/tcg.c

RE: [PATCH v3 09/28] accel/tcg: Move alloc_code_gen_buffer to tcg/region.c

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Buffer management is integral to tcg. Do not leave the allocation to code > outside of tcg/. This is code movement, with further cleanups to follow. > > Signed-off-by: Richard Henderson > --- > include/tcg/tcg.h | 2 +- > accel/tcg/translate-all.c | 414

RE: [PATCH v3 19/28] tcg: Tidy split_cross_256mb

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Return output buffer and size via output pointer arguments, rather than > returning size via tcg_ctx->code_gen_buffer_size. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 15 +++ > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff

RE: [PATCH v3 17/28] tcg: Rename region.start to region.after_prologue

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > Give the field a name reflecting its actual meaning. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 15 --- > 1 file changed, 8 insertions(+), 7 deletions(-) Reviewed-by: Luis Pires -- Luis Pires Instituto de Pesquisas ELDORADO Aviso Legal

RE: [PATCH v3 10/28] accel/tcg: Rename tcg_init to tcg_init_machine

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > We shortly want to use tcg_init for something else. > Since the hook is called init_machine, match that. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > accel/tcg/tcg-all.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-)

RE: [PATCH v3 07/28] tcg: Split out region.c

2021-06-09 Thread Luis Fernando Fujita Pires
From: Richard Henderson > > Signed-off-by: Richard Henderson > --- > tcg/internal.h | 37 > tcg/region.c| 572 > tcg/tcg.c | 547 + > tcg/meson.build | 1 + > 4 files changed, 613

  1   2   >