All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] target/ppc: Fix FPSCR.FI bit
@ 2022-05-10 20:46 Víctor Colombo
  2022-05-10 20:46 ` [PATCH v2 1/3] target/ppc: Fix FPSCR.FI bit being cleared when it shouldn't Víctor Colombo
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Víctor Colombo @ 2022-05-10 20:46 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: clg, danielhb413, david, groug, richard.henderson, victor.colombo

Hello everyone,

The FI bit in FPSCR is said to be a non-sticky bit on Power ISA.
One could think this means that, if an instruction is said to modify
the FPSCR register, the bit FI should be cleared. This is what QEMU
does today.

This is not, however, what the real hardware appears to do. It looks
like QEMU's interpretation of Power ISA was not correct for the
implementation of this bit.

This patch set fixes inconsistencies found in QEMU's handling of the
FPSCR.FI bit.

I found this while investigating how to enable Hardfpu for Power
guests. This change in the understanding on how the Power arch
handles the inexact bit makes it trivial to enable hardfpu for
affected instructions (mostly vsx-vector), but actually seems to
create even more complexity for the changes that will be required
to enable hardfpu for all float instructions. I'll instigate this
discussion more in the next few weeks.

Thanks!

v2:
- move the FI change from float_inexact_excp to do_float_check_status
- remove the setting of FI from float_overflow_excp, making
  do_float_check_status() the only responsible for it.
- make float_overflow_excp() return float_flag_inexact if it should
  update the inexact flags.
- Add patch 3, moving the renaming of sfprf to sfifprf to it
  (previously on patch 1)

Víctor Colombo (3):
  target/ppc: Fix FPSCR.FI bit being cleared when it shouldn't
  target/ppc: Fix FPSCR.FI changing in float_overflow_excp()
  target/ppc: Rename sfprf to sfifprf where it's also used as set fi
    flag

 target/ppc/cpu.h        |   2 +
 target/ppc/fpu_helper.c | 223 +++++++++++++++++++++-------------------
 2 files changed, 117 insertions(+), 108 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-05-11 18:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 20:46 [PATCH v2 0/3] target/ppc: Fix FPSCR.FI bit Víctor Colombo
2022-05-10 20:46 ` [PATCH v2 1/3] target/ppc: Fix FPSCR.FI bit being cleared when it shouldn't Víctor Colombo
2022-05-10 23:56   ` Richard Henderson
2022-05-11 10:12   ` Rashmica Gupta
2022-05-11 18:29     ` Víctor Colombo
2022-05-10 20:46 ` [PATCH v2 2/3] target/ppc: Fix FPSCR.FI changing in float_overflow_excp() Víctor Colombo
2022-05-10 23:58   ` Richard Henderson
2022-05-11 10:12   ` Rashmica Gupta
2022-05-10 20:46 ` [PATCH v2 3/3] target/ppc: Rename sfprf to sfifprf where it's also used as set fi flag Víctor Colombo
2022-05-10 23:58   ` Richard Henderson
2022-05-11 10:12   ` Rashmica Gupta

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.