All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Leon Alrae <leon.alrae@imgtec.com>, qemu-devel@nongnu.org
Cc: aurelien@aurel32.net
Subject: Re: [Qemu-devel] [2.4 PATCH] target-mips: add Config5.FRE support allowing Status.FR=0 emulation
Date: Tue, 17 Mar 2015 15:08:58 +0000	[thread overview]
Message-ID: <5508438A.3040504@imgtec.com> (raw)
In-Reply-To: <55082750.7020401@imgtec.com>

[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

On 17/03/15 13:08, Leon Alrae wrote:
> Hi James,
> 
> On 17/03/2015 10:55, James Hogan wrote:
>> Hi Leon,
>>
>> On 17/03/15 09:56, Leon Alrae wrote:
>>> +    case 5:
>>> +        /* FRE Support - clear Config5.FRE bit */
>>> +        if (!((env->active_fpu.fcr0 & (1 << FCR0_FREP)) && (rt == 0))) {
>>> +            return;
>>> +        }
>>
>> If rt != 0, is it really desired for a Config5 bit (which is privileged
>> state) to be modified? Assuming these behave similarly to UFR/UNFR, the
>> behaviour is architecturally UNPREDICTABLE when rt != $0, not UNDEFINED
>> (and at least UNFR is required to produce an RI exception in r5
>> implementations).
> 
> Hmm, I believe the code above is correct and is doing exactly what you
> described :) Note that "&& (rt == 0)" is inside parenthesis following
> the logical NOT operator. It is no-op if rt != 0.

Yep, my apologies. Stupid brackets :-).

>>>  /* Floating point register moves. */
>>> -static void gen_load_fpr32(TCGv_i32 t, int reg)
>>> +static void gen_load_fpr32(DisasContext *ctx, TCGv_i32 t, int reg)
>>>  {
>>> +    if (ctx->hflags & MIPS_HFLAG_FRE) {
>>> +        generate_exception(ctx, EXCP_RI);
>>
>> Maybe return to avoid generating dead code?
> 
> The reason is to avoid leaving the TCG temp marked as TEMP_VAL_DEAD
> which would cause assertion failures in TCG as we still generate code
> using this temp after returning from gen_load_fpr().

Okay, fair enough.

Cheers
James


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-03-17 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  9:56 [Qemu-devel] [2.4 PATCH] target-mips: add Config5.FRE support allowing Status.FR=0 emulation Leon Alrae
2015-03-17 10:55 ` James Hogan
2015-03-17 13:08   ` Leon Alrae
2015-03-17 15:08     ` James Hogan [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=5508438A.3040504@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=leon.alrae@imgtec.com \
    --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.