qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Fix qemu_strtosz regression
@ 2021-03-15 15:58 Richard Henderson
  2021-03-15 15:58 ` [PATCH v2 1/1] utils: Use fixed-point arithmetic in qemu_strtosz Richard Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Henderson @ 2021-03-15 15:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, thuth

Supercedes: 20210314234821.1954428-1-richard.henderson@linaro.org
("utils: Use fma in qemu_strtosz")

On second thoughts, using fma isn't the best workaround.

Let's just do some fixed-point arithmetic and compute the exact
result of the multiply.  This makes overflow detection simple
and obvious.

Round up from 0.5, because.  This fixes one testsuite failure
and causes another, so amend the testsuite.


r~


Richard Henderson (1):
  utils: Use fixed-point arithmetic in qemu_strtosz

 tests/unit/test-cutils.c |  2 +-
 util/cutils.c            | 50 ++++++++++++++++++++++++++++------------
 2 files changed, 36 insertions(+), 16 deletions(-)

-- 
2.25.1



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

end of thread, other threads:[~2021-03-17 13:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-15 15:58 [PATCH v2 0/1] Fix qemu_strtosz regression Richard Henderson
2021-03-15 15:58 ` [PATCH v2 1/1] utils: Use fixed-point arithmetic in qemu_strtosz Richard Henderson
2021-03-15 16:17   ` Philippe Mathieu-Daudé
2021-03-15 16:30   ` Eric Blake
2021-03-17  7:09   ` Thomas Huth
2021-03-17 11:16     ` Eric Blake
2021-03-17 13:02       ` Eric Blake

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).