[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] How to add my implementation of the fmadds instruction
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU |
Date: |
Tue, 27 Sep 2016 11:16:40 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 09/27/2016 09:33 AM, G 3 wrote:
>>> void fmadds(float *frD, float frA, float frC, float frB)
>>> {
>>> *frD = frA * frC + frB;
>>> }
>
> It sounds like I should change my argument types to double.
Insufficient. The whole reason that fmadds exists is that there are
provably cases where two operations that both round are GUARANTEED to
get the wrong answer when compared to a single operation, regardless of
the precisions involved. Widening from float to double does NOT
eliminate the double-rounding problem.
>
> I still want to try implementing this function. I'm thinking rewriting the
> helper_fmadd() function in target-ppc/fpu_helper.c. Does that
> sound correct?
I seriously doubt you would be able to write a correct implementation,
if you aren't even aware of the double-rounding reasons why fmadds was
added to the IEEE floating point specification in the first place. Your
idea that you would be able to speed things up is probably a premature
optimization, given that you have no realistic clue how hard it is to
CORRECTLY implement fused-multiply-add.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, G 3, 2016/09/26
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, David Gibson, 2016/09/26
- Re: [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Peter Maydell, 2016/09/27
- Re: [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, G 3, 2016/09/27
- Re: [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Peter Maydell, 2016/09/27
- Re: [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU,
Eric Blake <=
- Re: [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, G 3, 2016/09/27
- Re: [Qemu-devel] How to add my implementation of the fmadds instruction to QEMU, Peter Maydell, 2016/09/27
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, David Gibson, 2016/09/29
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, Programmingkid, 2016/09/29
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, Alex Bennée, 2016/09/29
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, Programmingkid, 2016/09/29
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, Alex Bennée, 2016/09/29
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, Programmingkid, 2016/09/29
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, Peter Maydell, 2016/09/29
- Re: [Qemu-devel] [Qemu-ppc] How to add my implementation of the fmadds instruction to QEMU, Programmingkid, 2016/09/29