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: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] m68k: implement move to/from usp register instruction
Date: Thu, 13 Sep 2012 10:34:15 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

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]));


r~




reply via email to

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