From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCDIy-0005nj-1d for qemu-devel@nongnu.org; Thu, 13 Sep 2012 13:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCDIx-0007Fn-2f for qemu-devel@nongnu.org; Thu, 13 Sep 2012 13:34:19 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:44581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCDIw-0007FU-TH for qemu-devel@nongnu.org; Thu, 13 Sep 2012 13:34:19 -0400 Received: by pbbrp12 with SMTP id rp12so4519682pbb.4 for ; Thu, 13 Sep 2012 10:34:17 -0700 (PDT) Sender: Richard Henderson Message-ID: <50521917.6020208@twiddle.net> Date: Thu, 13 Sep 2012 10:34:15 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1347517980-16721-1-git-send-email-gerg@snapgear.com> In-Reply-To: <1347517980-16721-1-git-send-email-gerg@snapgear.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] m68k: implement move to/from usp register instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: gerg@snapgear.com Cc: Greg Ungerer , qemu-devel@nongnu.org, paul@codesourcery.com 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])); r~