All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Laurent Vivier <laurent@vivier.eu>, qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v4 7/7] target-m68k: add FPCR and FPSR
Date: Mon, 19 Jun 2017 14:16:26 -0700	[thread overview]
Message-ID: <bc38850c-cc93-80da-1c67-534a42d3ebcd@twiddle.net> (raw)
In-Reply-To: <20170611231633.32582-8-laurent@vivier.eu>

On 06/11/2017 04:16 PM, Laurent Vivier wrote:
> @@ -95,8 +101,14 @@ static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n)
>           env->fregs[n].d = float64_to_floatx80(ldfq_p(mem_buf), &s);
>           return 8;
>       }
> -    if (n < 11) {
> -        /* FP control registers (not implemented)  */
> +    switch (n) {
> +    case 8: /* fpcontrol */
> +        env->fpcr = ldl_p(mem_buf);
> +        return 4;

Should use cpu_m68k_set_fpcr.


> +DEF_HELPER_2(set_fpcr, void, env, i32)

Hmm.  I suppose the write to env->fpcr means you can't indicate 
TCG_CALL_NO_RWG.  I wonder if it's better as

uint32_t HELPER(set_fpcr)(CPUM68KState *env, uint32_t val)
{
    cpu_m68k_set_fpcr(env, val);
    return env->fpcr;
}

DEF_HELPER_FLAGS_2(set_fpcr, i32, env, i32)

gen_helper_set_fpcr(QEMU_FPCR, cpu_env, val);

This skirts the rules of TCG, but it'll work, since we disguise the (incorrect) 
write to env->fpcr with a (correct but redundant) write to QEMU_FPCR.

Any time we can avoid spilling all globals we're better off.

As an alternative, is it really that important to represent FPSR and FPCR as 
tcg registers?  Perhaps it's better to just tcg_gen_ld/st instead?


r~

      reply	other threads:[~2017-06-19 21:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-11 23:16 [Qemu-devel] [PATCH v4 0/7] target-m68k: implement 680x0 FPU Laurent Vivier
2017-06-11 23:16 ` [Qemu-devel] [PATCH v4 1/7] softfloat: define 680x0 specific values Laurent Vivier
2017-06-11 23:16 ` [Qemu-devel] [PATCH v4 2/7] target-m68k: move FPU helpers to fpu_helper.c Laurent Vivier
2017-06-11 23:16 ` [Qemu-devel] [PATCH v4 3/7] target-m68k: define ext_opsize Laurent Vivier
2017-06-11 23:16 ` [Qemu-devel] [PATCH v4 4/7] target-m68k: move fmove CR to a function Laurent Vivier
2017-06-12 16:13   ` Richard Henderson
2017-06-12 17:56     ` Laurent Vivier
2017-06-12 18:37       ` Richard Henderson
2017-06-12 19:12   ` Philippe Mathieu-Daudé
2017-06-11 23:16 ` [Qemu-devel] [PATCH v4 5/7] target-m68k: use floatx80 internally Laurent Vivier
2017-06-13  4:48   ` Thomas Huth
2017-06-19 20:53   ` Richard Henderson
2017-06-19 21:03     ` Laurent Vivier
2017-06-19 21:42       ` Laurent Vivier
2017-06-19 22:04         ` Richard Henderson
2017-06-11 23:16 ` [Qemu-devel] [PATCH v4 6/7] target-m68k: define 96bit FP registers for gdb on 680x0 Laurent Vivier
2017-06-11 23:16 ` [Qemu-devel] [PATCH v4 7/7] target-m68k: add FPCR and FPSR Laurent Vivier
2017-06-19 21:16   ` Richard Henderson [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=bc38850c-cc93-80da-1c67-534a42d3ebcd@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /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.