qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Laurent Vivier <laurent@vivier.eu>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 2/4] target/m68k: pass sign directly into make_quotient()
Date: Mon, 2 Jan 2023 09:35:36 -0800	[thread overview]
Message-ID: <06c9ed84-22f3-a423-52be-4e006f20cffc@linaro.org> (raw)
In-Reply-To: <004c686f-b5ed-be4f-087d-2736bedd57b9@ilande.co.uk>

On 1/2/23 02:10, Mark Cave-Ayland wrote:
>>> I think you need an "abs(floatx80_to_int32())" in both cases as you do in PATCH 4
>>
>> Or in fact
>>
>>      sign = extractFloatx80Sign(res);
>>      quot = floatx80_to_int32(floatx80_abs(res->d), status);
>>      make_quotient(env, sign, quot);
> 
> Thanks for the suggestion. Just out of curiosity, how does moving the abs to before the 
> integer conversion make a difference here? Is it because floatx80_to_int32() can fail in 
> some circumstances because of the sign of the result?

It's a simple and operation on floats, instead of cmp+cmov on integers.

I think it's a touch clearer as well, having just saved the fp sign, you discard it before 
moving on to the next thing.


r~


  reply	other threads:[~2023-01-02 17:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-01 14:43 [PATCH 0/4] target/m68k: fix FPSR quotient byte for fmod and frem Mark Cave-Ayland
2023-01-01 14:43 ` [PATCH 1/4] target/m68k: pass quotient directly into make_quotient() Mark Cave-Ayland
2023-01-01 17:20   ` Laurent Vivier
2023-01-01 14:43 ` [PATCH 2/4] target/m68k: pass sign " Mark Cave-Ayland
2023-01-01 17:20   ` Laurent Vivier
2023-01-01 17:26   ` Laurent Vivier
2023-01-01 18:53     ` Richard Henderson
2023-01-02 10:10       ` Mark Cave-Ayland
2023-01-02 17:35         ` Richard Henderson [this message]
2023-01-02 10:04     ` Mark Cave-Ayland
2023-01-01 14:43 ` [PATCH 3/4] target/m68k: fix FPSR quotient byte for fmod instruction Mark Cave-Ayland
2023-01-01 17:21   ` Laurent Vivier
2023-01-01 14:43 ` [PATCH 4/4] target/m68k: fix FPSR quotient byte for frem instruction Mark Cave-Ayland
2023-01-01 17:26   ` Laurent Vivier

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=06c9ed84-22f3-a423-52be-4e006f20cffc@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=mark.cave-ayland@ilande.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).