All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@snapgear.com>
To: Richard Henderson <rth@twiddle.net>
Cc: Greg Ungerer <gerg@uclinux.org>,
	qemu-devel@nongnu.org, paul@codesourcery.com
Subject: Re: [Qemu-devel] [PATCH] m68k: implement move to/from usp register instruction
Date: Fri, 14 Sep 2012 09:36:34 +1000	[thread overview]
Message-ID: <50526E02.8040009@snapgear.com> (raw)
In-Reply-To: <50521917.6020208@twiddle.net>

Hi Richard,

On 14/09/12 03:34, Richard Henderson wrote:
> On 09/12/2012 11:33 PM, gerg@snapgear.com wrote:
>> +uint32_t HELPER(move_from_usp)(CPUM68KState * env)
>> +{
>> +    return env->sp[M68K_USP];
>> +}
>
> You don't need helpers for these.
>
>>   DISAS_INSN(move_from_usp)
>>   {
>> +    TCGv reg;
>>       if (IS_USER(s)) {
>>           gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
>>           return;
>>       }
>> -    /* TODO: Implement USP.  */
>> -    gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
>> +    reg = AREG(insn, 0);
>> +    gen_helper_move_from_usp(reg, cpu_env);
>
>    tcg_gen_ld_i32(AREG(insn, 0), offsetof(CPUM68KState, sp[M68K_USP]));
>
>>   DISAS_INSN(move_to_usp)
>>   {
>> +    TCGv reg;
>>       if (IS_USER(s)) {
>>           gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
>>           return;
>>       }
>> -    /* TODO: Implement USP.  */
>> -    gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
>> +    reg = AREG(insn, 0);
>> +    gen_helper_move_to_usp(cpu_env, reg);
>
>    tcg_gen_st_i32(AREG(insn, 0), offsetof(CPUM68KState, sp[M68K_USP]));

That looks cleaner, thanks. I'll send a revised patch.

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

      reply	other threads:[~2012-09-13 23:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13  6:33 [Qemu-devel] [PATCH] m68k: implement move to/from usp register instruction gerg
2012-09-13 17:34 ` Richard Henderson
2012-09-13 23:36   ` Greg Ungerer [this message]

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=50526E02.8040009@snapgear.com \
    --to=gerg@snapgear.com \
    --cc=gerg@uclinux.org \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 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.