qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ronald Hecht <ronald.hecht@gmx.de>
To: qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>, chouteau@adacore.com
Subject: Re: [Qemu-devel] [PATCH] Added more entries to the LEON processor configuration register
Date: Thu, 20 Sep 2012 09:15:36 +0200	[thread overview]
Message-ID: <505AC298.10506@gmx.de> (raw)
In-Reply-To: <CAAu8pHuKqnKYKBXhNp2cCzA0_KbdCQbaBfSVUhF=qxwS4=QsaQ@mail.gmail.com>

On 09/19/2012 08:56 PM, Blue Swirl wrote:
>> --- a/target-sparc/translate.c
>> +++ b/target-sparc/translate.c
>> @@ -2590,13 +2590,9 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
>>                                          microSPARC II */
>>                       /* Read Asr17 */
>>                       if (rs1 == 0x11&&  dc->def->features&  CPU_FEATURE_ASR17) {
>> -                        TCGv r_const;
>> -
>> -                        /* Read Asr17 for a Leon3 monoprocessor */
>> -                        r_const = tcg_const_tl((1<<  8)
>> -                                               | (dc->def->nwindows - 1));
>> -                        gen_movl_TN_reg(rd, r_const);
>> -                        tcg_temp_free(r_const);
>> +                        /* Read Asr17 on LEON3 */
>> +                        gen_helper_rdasr17(cpu_dst, cpu_env);
>>      
> Is the register is read very often? If it is, we could avoid the
> helper call by performing the load of env->cpu_index, the shift and OR
> with the above constant with TCG ops. The arithmetic could be even
> avoided completely by storing precalculated values in cpu_index, then
> other accesses to cpu_index need to shift right by 28 to read the
> index (depends on balance of other cpu_index uses vs. this
> instruction).
>    

The register is read quite often, but not as often as the PSR. It is 
normally read when entering the OS (Linux, PikeOS ...) Kernel to know on 
which CPU we are running a thread. But polluting the cpu_index in env 
sounds a bit strange and overkill to me. Do you really mean the 
cpu_index in the structure CPUSPARCState? Or could we place it in 
dc->def as a constant?

Best regards,
Ronald

  reply	other threads:[~2012-09-20  7:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 13:29 [Qemu-devel] [PATCH] Added more entries to the LEON processor configuration register Ronald Hecht
2012-09-18 14:21 ` Fabien Chouteau
2012-09-19 18:56 ` Blue Swirl
2012-09-20  7:15   ` Ronald Hecht [this message]
2012-09-22 12:19     ` Blue Swirl

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=505AC298.10506@gmx.de \
    --to=ronald.hecht@gmx.de \
    --cc=blauwirbel@gmail.com \
    --cc=chouteau@adacore.com \
    --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).