From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCIud-0007YM-C0 for qemu-devel@nongnu.org; Thu, 13 Sep 2012 19:33:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCIuc-00044z-51 for qemu-devel@nongnu.org; Thu, 13 Sep 2012 19:33:35 -0400 Received: from dalsmrelay2.nai.com ([205.227.136.216]:37269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCIub-00041X-Tc for qemu-devel@nongnu.org; Thu, 13 Sep 2012 19:33:34 -0400 Message-ID: <50526E02.8040009@snapgear.com> Date: Fri, 14 Sep 2012 09:36:34 +1000 From: Greg Ungerer MIME-Version: 1.0 References: <1347517980-16721-1-git-send-email-gerg@snapgear.com> <50521917.6020208@twiddle.net> In-Reply-To: <50521917.6020208@twiddle.net> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed 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: Richard Henderson Cc: Greg Ungerer , qemu-devel@nongnu.org, paul@codesourcery.com 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