qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 10/14] tcg: Introduce temp_load
Date: Fri, 15 Jan 2016 14:08:50 -0800	[thread overview]
Message-ID: <56996DF2.4080803@twiddle.net> (raw)
In-Reply-To: <20151231113341.GE360@aurel32.net>

On 12/31/2015 03:33 AM, Aurelien Jarno wrote:
>> -            if (ts->val_type == TEMP_VAL_REG) {
>> -                tcg_out_st(s, ts->type, ts->reg, TCG_REG_CALL_STACK, stack_offset);
>> -            } else if (ts->val_type == TEMP_VAL_MEM) {
>> -                reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type], 
>> -                                    s->reserved_regs);
>> -                /* XXX: not correct if reading values from the stack */
> 
> Shouldn't we keep this comment by moving it to temp_load?

No, because I believe the comment to be inaccurate.

> 
>> -                tcg_out_ld(s, ts->type, reg, ts->mem_base->reg, ts->mem_offset);
>> -                tcg_out_st(s, ts->type, reg, TCG_REG_CALL_STACK, stack_offset);
>> -            } else if (ts->val_type == TEMP_VAL_CONST) {
>> -                reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type], 
>> -                                    s->reserved_regs);
>> -                /* XXX: sign extend may be needed on some targets */
> 
> Same here.
> 
>> -                tcg_out_movi(s, ts->type, reg, ts->val);

Likewise.  If the target needs sign-extend, it will do it here in movi given
the type.

>> -                tcg_out_st(s, ts->type, reg, TCG_REG_CALL_STACK, stack_offset);
>> -            } else {
>> -                tcg_abort();
>> -            }
>> +            temp_load(s, ts, tcg_target_available_regs[ts->type],
>> +                      s->reserved_regs);
>> +            tcg_out_st(s, ts->type, ts->reg, TCG_REG_CALL_STACK, stack_offset);
>>          }
>>  #ifndef TCG_TARGET_STACK_GROWSUP
>>          stack_offset += sizeof(tcg_target_long);
>> @@ -2193,18 +2180,19 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs,
>>              ts = &s->temps[arg];
>>              reg = tcg_target_call_iarg_regs[i];
>>              tcg_reg_free(s, reg);
>> +
>>              if (ts->val_type == TEMP_VAL_REG) {
>>                  if (ts->reg != reg) {
>>                      tcg_out_mov(s, ts->type, reg, ts->reg);
>>                  }
>> -            } else if (ts->val_type == TEMP_VAL_MEM) {
>> -                tcg_out_ld(s, ts->type, reg, ts->mem_base->reg, ts->mem_offset);
>> -            } else if (ts->val_type == TEMP_VAL_CONST) {
>> -                /* XXX: sign extend ? */
> 
> And here.
> 
>> -                tcg_out_movi(s, ts->type, reg, ts->val);

Likewise.


r~

  reply	other threads:[~2016-01-15 22:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 19:58 [Qemu-devel] [PATCH v2 00/14] tcg: Improve sparc register windows Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 02/14] tcg: Change ts->mem_reg to ts->mem_base Richard Henderson
2015-12-31 10:52   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 03/14] tcg: Tidy temporary allocation Richard Henderson
2015-12-31 11:13   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 04/14] tcg: More use of TCGReg where appropriate Richard Henderson
2015-12-31 11:14   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 05/14] tcg: Remove tcg_get_arg_str_i32/64 Richard Henderson
2015-12-31 11:15   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 06/14] tcg: Change reg_to_temp to TCGTemp pointer Richard Henderson
2015-12-31 11:19   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 07/14] tcg: Change temp_dead argument to TCGTemp Richard Henderson
2015-12-31 11:24   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 08/14] tcg: Change temp_sync " Richard Henderson
2015-12-31 11:24   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 09/14] tcg: Change temp_save " Richard Henderson
2015-12-31 11:24   ` Aurelien Jarno
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 10/14] tcg: Introduce temp_load Richard Henderson
2015-12-31 11:33   ` Aurelien Jarno
2016-01-15 22:08     ` Richard Henderson [this message]
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 11/14] tcg: Implement indirect memory registers Richard Henderson
2015-12-31 11:54   ` Aurelien Jarno
2016-01-15 22:31     ` Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 12/14] tcg: Allocate indirect_base temporaries in a different order Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 13/14] target-sparc: Tidy global register initialization Richard Henderson
2015-12-17 20:00 ` [Qemu-devel] [PATCH v2 14/14] target-sparc: Use global registers for the register window Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56996DF2.4080803@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).