qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] m68k: implement move to/from usp register instr


From: Greg Ungerer
Subject: Re: [Qemu-devel] [PATCH] m68k: implement move to/from usp register instruction
Date: Fri, 14 Sep 2012 09:36:34 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0

Hi Richard,

On 14/09/12 03:34, Richard Henderson wrote:
On 09/12/2012 11:33 PM, address@hidden 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:     address@hidden
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 via email to

[Prev in Thread] Current Thread [Next in Thread]