From: Daniel Cederman <cederman@gaisler.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
libc-alpha@sourceware.org
Cc: daniel@gaisler.com, andreas@gaisler.com
Subject: Re: [PATCH] sparc: Force calculation that raises exception
Date: Mon, 15 Jan 2024 10:41:57 +0100 [thread overview]
Message-ID: <2ce8b915-6c61-4e33-82f7-1c013bcd0c93@gaisler.com> (raw)
In-Reply-To: <8dee0ad6-196b-40c1-b3fb-6be7147d8dc7@linaro.org>
On 2024-01-12 17:45, Adhemerval Zanella Netto wrote:
>
>
> On 12/01/24 06:26, Daniel Cederman wrote:
>> Read out the FPU control word to force the calculation to complete and
>> raise the exception.
>>
>> With this change the math/test-fenv test pass for LEON.
>
> Is this to try mitigate 'GRFPU Floating-point controller: Missing
> FDIV/FSQRT Result' [1]?
>
No, this change is not for any errata. The current implementation
generates code that looks like this:
ac: 91 a2 09 ca fdivd %f8, %f10, %f8
b0: 90 10 20 00 clr %o0
b4: 81 c3 e0 08 retl
bc: 9c 03 a0 50 add %sp, 0x50, %sp
The division performed will raise an exception, but if the FPU is
running asynchronous with the CPU the exception will not happen until
the division is finished and another fp operation accesses the FPU.
Reading out the control word forces the division to finish and the
exception to trigger.
But looking at it now I think this is the more correct change:
- __asm __volatile ("" : : "e" (d));
+ __asm __volatile ("" : : "m" (d));
That would generate a store instruction with the same effect as the stfsr.
/Daniel
next prev parent reply other threads:[~2024-01-15 9:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 9:26 [PATCH] sparc: Do not test preservation of NaN payloads for LEON Daniel Cederman
2024-01-12 9:26 ` [PATCH] sparc: Prevent stfsr from directly following floating-point instruction Daniel Cederman
2024-01-12 14:38 ` Adhemerval Zanella Netto
2024-01-15 9:37 ` Daniel Cederman
2024-01-12 9:26 ` [PATCH] sparc: Force calculation that raises exception Daniel Cederman
2024-01-12 16:45 ` Adhemerval Zanella Netto
2024-01-15 9:41 ` Daniel Cederman [this message]
2024-01-15 11:47 ` Adhemerval Zanella Netto
2024-01-12 9:26 ` [PATCH] sparc: Treat the version field in the FPU control word as reserved Daniel Cederman
2024-01-12 17:42 ` Adhemerval Zanella Netto
2024-02-15 9:31 ` Daniel Cederman
2024-02-19 14:55 ` Adhemerval Zanella Netto
2024-01-12 9:26 ` [PATCH] sparc: Fix llrint and llround missing exceptions on SPARC32 Daniel Cederman
2024-01-12 18:05 ` Adhemerval Zanella Netto
2024-01-15 14:38 ` Daniel Cederman
2024-01-15 17:52 ` Adhemerval Zanella Netto
2024-01-12 9:26 ` [PATCH] sparc: Remove unwind information from signal return stub functions Daniel Cederman
2024-01-15 13:41 ` Adhemerval Zanella Netto
2024-01-15 14:22 ` Daniel Cederman
2024-01-15 16:57 ` Adhemerval Zanella Netto
2024-01-16 15:37 ` [PATCH] sparc: Do not test preservation of NaN payloads for LEON Adhemerval Zanella Netto
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=2ce8b915-6c61-4e33-82f7-1c013bcd0c93@gaisler.com \
--to=cederman@gaisler.com \
--cc=adhemerval.zanella@linaro.org \
--cc=andreas@gaisler.com \
--cc=daniel@gaisler.com \
--cc=libc-alpha@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).