All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH v3 10/16] tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE
       [not found] ` <1398713302-29657-11-git-send-email-rth@twiddle.net>
@ 2014-05-02 15:19   ` Peter Maydell
  2014-05-02 15:24     ` Richard Henderson
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-05-02 15:19 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 28 April 2014 20:28, Richard Henderson <rth@twiddle.net> wrote:
> And use tcg pointer differencing functions as appropriate.
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> @@ -1670,51 +1651,28 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
>
>      switch (opc) {
>      case INDEX_op_exit_tb:
> -        if (use_armv7_instructions || check_fit_imm(args[0])) {
> -            tcg_out_movi32(s, COND_AL, TCG_REG_R0, args[0]);
> -            tcg_out_goto(s, COND_AL, (tcg_target_ulong) tb_ret_addr);
> -        } else {
> -            uint8_t *ld_ptr = s->code_ptr;
> -            tcg_out_ld32_12(s, COND_AL, TCG_REG_R0, TCG_REG_PC, 0);
> -            tcg_out_goto(s, COND_AL, (tcg_target_ulong) tb_ret_addr);
> -            *ld_ptr = (uint8_t) (s->code_ptr - ld_ptr) - 8;
> -            tcg_out32(s, args[0]);
> -        }
> +        tcg_out_movi32(s, COND_AL, TCG_REG_R0, args[0]);
> +        tcg_out_goto(s, COND_AL, tb_ret_addr);

Why is it OK not to have the pre-v7/non-fitting-immediate
code now? I guess movi32 will handle it all though probably
in a less efficient way.

>          break;
>      case INDEX_op_goto_tb:
>          if (s->tb_jmp_offset) {
>              /* Direct jump method */
> -#if defined(USE_DIRECT_JUMP)
> -            s->tb_jmp_offset[args[0]] = s->code_ptr - s->code_buf;
> +            s->tb_jmp_offset[args[0]] = tcg_current_code_size(s);
>              tcg_out_b_noaddr(s, COND_AL);
> -#else
> -            tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_PC, -4);
> -            s->tb_jmp_offset[args[0]] = s->code_ptr - s->code_buf;
> -            tcg_out32(s, 0);
> -#endif
>          } else {
>              /* Indirect jump method */
> -#if 1
> -            c = (int) (s->tb_next + args[0]) - ((int) s->code_ptr + 8);
> -            if (c > 0xfff || c < -0xfff) {
> -                tcg_out_movi32(s, COND_AL, TCG_REG_R0,
> -                                (tcg_target_long) (s->tb_next + args[0]));
> -                tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_R0, 0);
> -            } else
> -                tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_PC, c);
> -#else
> -            tcg_out_ld32_12(s, COND_AL, TCG_REG_R0, TCG_REG_PC, 0);
> -            tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_R0, 0);
> -            tcg_out32(s, (tcg_target_long) (s->tb_next + args[0]));
> -#endif
> +            intptr_t ptr = (intptr_t)(s->tb_next + args[0]);
> +            tcg_out_movi32(s, COND_AL, TCG_REG_R0, ptr & ~0xfff);
> +            tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_R0, ptr & 0xfff);
>          }

This change also confused me but we're again relying on movi32
generating correct-but-inefficient code now, right?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 10/16] tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE
  2014-05-02 15:19   ` [Qemu-devel] [PATCH v3 10/16] tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE Peter Maydell
@ 2014-05-02 15:24     ` Richard Henderson
  2014-05-09 14:08       ` Peter Maydell
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Henderson @ 2014-05-02 15:24 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 05/02/2014 08:19 AM, Peter Maydell wrote:
> This change also confused me but we're again relying on movi32
> generating correct-but-inefficient code now, right?

Yes.  IMO if we want to do a constant pool, let's do a proper one,
not just in a few places.


r~

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 12/16] tcg-s390: Define TCG_TARGET_INSN_UNIT_SIZE
       [not found] ` <1398713302-29657-13-git-send-email-rth@twiddle.net>
@ 2014-05-09 13:35   ` Peter Maydell
  2014-05-12 17:05     ` Richard Henderson
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-05-09 13:35 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 28 April 2014 20:28, Richard Henderson <rth@twiddle.net> wrote:
> And use tcg pointer differencing functions as appropriate.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/s390/tcg-target.c | 91 ++++++++++++++++++++++++---------------------------
>  tcg/s390/tcg-target.h |  2 ++
>  2 files changed, 45 insertions(+), 48 deletions(-)
>
> diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
> index 1d912a7..ae1be1c 100644
> --- a/tcg/s390/tcg-target.c
> +++ b/tcg/s390/tcg-target.c
> @@ -320,7 +320,7 @@ static const uint8_t tcg_cond_to_ltr_cond[] = {
>  #ifdef CONFIG_SOFTMMU
>  /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
>     int mmu_idx) */
> -static const void * const qemu_ld_helpers[4] = {
> +static void * const qemu_ld_helpers[4] = {
>      helper_ldb_mmu,
>      helper_ldw_mmu,
>      helper_ldl_mmu,
> @@ -329,7 +329,7 @@ static const void * const qemu_ld_helpers[4] = {
>
>  /* helper signature: helper_st_mmu(CPUState *env, target_ulong addr,
>     uintxx_t val, int mmu_idx) */
> -static const void * const qemu_st_helpers[4] = {
> +static void * const qemu_st_helpers[4] = {
>      helper_stb_mmu,
>      helper_stw_mmu,
>      helper_stl_mmu,

Why do these lose the 'const' ?

Patch looks ok otherwise from a quick scan.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 14/16] tcg-mips: Define TCG_TARGET_INSN_UNIT_SIZE
       [not found] ` <1398713302-29657-15-git-send-email-rth@twiddle.net>
@ 2014-05-09 13:39   ` Peter Maydell
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2014-05-09 13:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Aurelien Jarno

On 28 April 2014 20:28, Richard Henderson <rth@twiddle.net> wrote:
> And use tcg pointer differencing functions as appropriate.
>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 15/16] tci: Define TCG_TARGET_INSN_UNIT_SIZE
       [not found] ` <1398713302-29657-16-git-send-email-rth@twiddle.net>
@ 2014-05-09 13:52   ` Peter Maydell
  2014-05-12 23:13     ` Richard Henderson
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2014-05-09 13:52 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Stefan Weil, QEMU Developers

On 28 April 2014 20:28, Richard Henderson <rth@twiddle.net> wrote:
> And use tcg pointer differencing functions as appropriate.
>
> Cc: Stefan Weil <sw@weilnetz.de>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/tci/tcg-target.c | 19 +++++++++++++------
>  tcg/tci/tcg-target.h |  1 +
>  2 files changed, 14 insertions(+), 6 deletions(-)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

though I note there are a number of functions that
use the pattern

    uint8_t *old_code_ptr = s->code_ptr;
    [...emit stuff...]
    old_code_ptr[1] = s->code_ptr - old_code_ptr;

which could perhaps use tcg_insn_unit * rather than uint8_t * ?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 10/16] tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE
  2014-05-02 15:24     ` Richard Henderson
@ 2014-05-09 14:08       ` Peter Maydell
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2014-05-09 14:08 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 2 May 2014 16:24, Richard Henderson <rth@twiddle.net> wrote:
> On 05/02/2014 08:19 AM, Peter Maydell wrote:
>> This change also confused me but we're again relying on movi32
>> generating correct-but-inefficient code now, right?
>
> Yes.  IMO if we want to do a constant pool, let's do a proper one,
> not just in a few places.

Fair enough. I don't care very much about pre-v7 hosts
anyway...

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 11/16] tcg-aarch64: Define TCG_TARGET_INSN_UNIT_SIZE
       [not found] ` <1398713302-29657-12-git-send-email-rth@twiddle.net>
@ 2014-05-09 14:09   ` Peter Maydell
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2014-05-09 14:09 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Claudio Fontana, QEMU Developers

On 28 April 2014 20:28, Richard Henderson <rth@twiddle.net> wrote:
> And use tcg pointer differencing functions as appropriate.
>
> Cc: Claudio Fontana <claudio.fontana@huawei.com>
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 12/16] tcg-s390: Define TCG_TARGET_INSN_UNIT_SIZE
  2014-05-09 13:35   ` [Qemu-devel] [PATCH v3 12/16] tcg-s390: " Peter Maydell
@ 2014-05-12 17:05     ` Richard Henderson
  2014-05-12 20:41       ` Peter Maydell
  0 siblings, 1 reply; 10+ messages in thread
From: Richard Henderson @ 2014-05-12 17:05 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 05/09/2014 06:35 AM, Peter Maydell wrote:
> On 28 April 2014 20:28, Richard Henderson <rth@twiddle.net> wrote:
>> And use tcg pointer differencing functions as appropriate.
>>
>> Signed-off-by: Richard Henderson <rth@twiddle.net>
>> ---
>>  tcg/s390/tcg-target.c | 91 ++++++++++++++++++++++++---------------------------
>>  tcg/s390/tcg-target.h |  2 ++
>>  2 files changed, 45 insertions(+), 48 deletions(-)
>>
>> diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
>> index 1d912a7..ae1be1c 100644
>> --- a/tcg/s390/tcg-target.c
>> +++ b/tcg/s390/tcg-target.c
>> @@ -320,7 +320,7 @@ static const uint8_t tcg_cond_to_ltr_cond[] = {
>>  #ifdef CONFIG_SOFTMMU
>>  /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
>>     int mmu_idx) */
>> -static const void * const qemu_ld_helpers[4] = {
>> +static void * const qemu_ld_helpers[4] = {
>>      helper_ldb_mmu,
>>      helper_ldw_mmu,
>>      helper_ldl_mmu,
>> @@ -329,7 +329,7 @@ static const void * const qemu_ld_helpers[4] = {
>>
>>  /* helper signature: helper_st_mmu(CPUState *env, target_ulong addr,
>>     uintxx_t val, int mmu_idx) */
>> -static const void * const qemu_st_helpers[4] = {
>> +static void * const qemu_st_helpers[4] = {
>>      helper_stb_mmu,
>>      helper_stw_mmu,
>>      helper_stl_mmu,
> 
> Why do these lose the 'const' ?

Because "const void *" has a conversion warning to
non-const "tcg_type_unit *".  One would have to carry
the const all the way through all of the relocation
routines to solve it.

You had the exact same question about the ppc patch.


r~

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 12/16] tcg-s390: Define TCG_TARGET_INSN_UNIT_SIZE
  2014-05-12 17:05     ` Richard Henderson
@ 2014-05-12 20:41       ` Peter Maydell
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Maydell @ 2014-05-12 20:41 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 12 May 2014 18:05, Richard Henderson <rth@twiddle.net> wrote:
> On 05/09/2014 06:35 AM, Peter Maydell wrote:
>> Why do these lose the 'const' ?
>
> Because "const void *" has a conversion warning to
> non-const "tcg_type_unit *".  One would have to carry
> the const all the way through all of the relocation
> routines to solve it.

Ah, right.

> You had the exact same question about the ppc patch.

Whoops :-)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH v3 15/16] tci: Define TCG_TARGET_INSN_UNIT_SIZE
  2014-05-09 13:52   ` [Qemu-devel] [PATCH v3 15/16] tci: " Peter Maydell
@ 2014-05-12 23:13     ` Richard Henderson
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Henderson @ 2014-05-12 23:13 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Stefan Weil, QEMU Developers

On 05/09/2014 06:52 AM, Peter Maydell wrote:
> though I note there are a number of functions that
> use the pattern
> 
>     uint8_t *old_code_ptr = s->code_ptr;
>     [...emit stuff...]
>     old_code_ptr[1] = s->code_ptr - old_code_ptr;
> 
> which could perhaps use tcg_insn_unit * rather than uint8_t * ?

Yes, probably.  There are quite a few changes I'd like to make to tci...


r~

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-12 23:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1398713302-29657-1-git-send-email-rth@twiddle.net>
     [not found] ` <1398713302-29657-11-git-send-email-rth@twiddle.net>
2014-05-02 15:19   ` [Qemu-devel] [PATCH v3 10/16] tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE Peter Maydell
2014-05-02 15:24     ` Richard Henderson
2014-05-09 14:08       ` Peter Maydell
     [not found] ` <1398713302-29657-13-git-send-email-rth@twiddle.net>
2014-05-09 13:35   ` [Qemu-devel] [PATCH v3 12/16] tcg-s390: " Peter Maydell
2014-05-12 17:05     ` Richard Henderson
2014-05-12 20:41       ` Peter Maydell
     [not found] ` <1398713302-29657-15-git-send-email-rth@twiddle.net>
2014-05-09 13:39   ` [Qemu-devel] [PATCH v3 14/16] tcg-mips: " Peter Maydell
     [not found] ` <1398713302-29657-16-git-send-email-rth@twiddle.net>
2014-05-09 13:52   ` [Qemu-devel] [PATCH v3 15/16] tci: " Peter Maydell
2014-05-12 23:13     ` Richard Henderson
     [not found] ` <1398713302-29657-12-git-send-email-rth@twiddle.net>
2014-05-09 14:09   ` [Qemu-devel] [PATCH v3 11/16] tcg-aarch64: " Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.