qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Programmingkid <programmingkidx@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	"list@suse.de:PowerPC list:PowerPC" <qemu-ppc@nongnu.org>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC] target-ppc/fpu_helper.c: Use C99 code to speed up floating point unit
Date: Sat, 3 Dec 2016 12:07:35 -0500	[thread overview]
Message-ID: <F5D2D047-AD72-4378-AD8A-F411D3453CAF@gmail.com> (raw)
In-Reply-To: <cfcf1388-0366-99ed-7800-b7c1fe152001@redhat.com>


On Dec 3, 2016, at 3:44 AM, Paolo Bonzini wrote:

> 
> 
> On 03/12/2016 06:59, Programmingkid wrote:
>> The floating point code used in fpu_helper.c can be sped up by using
>> the IEEE 754 support added to the C99 standard. To test this code out
>> simply set and unset the I_NEED_SPEED macro. The program to test out
>> each version of the helper_fmadd() function is below the patch. It
>> needs to be ran in the guest. The emulator to use is qemu-system-ppc.
>> I used a Mac OS X guest, but the test program would compile on a
>> Linux guest.
>> 
>> This patch does make the fused multiply-add instruction fmadd work
>> faster and still give a correct result.
>> 
>> This documentation might be of help to those who want to learn more
>> about C99's IEEE 754 support: 
>> http://grouper.ieee.org/groups/754/meeting-materials/2001-07-18-c99.pdf
> 
> You're undoing what was done in 2007:
> 
> commit 76a66253e5e48f1744f689041c1c21cedcaff630
> Author: j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>
> Date:   Wed Mar 7 08:32:30 2007 +0000
> 
>    Great PowerPC emulation code resynchronisation and improvments:
> ...
>    - Micro-operation fixes:
> ...
>      * use softfloat routines for all floating-point operations
> 
> Paolo

Yes it would be. The commit message never stated why he wanted to switch
to floating point softfloat routines. These are my guesses:

- Different versions of gcc might have produced different results?
- Different hosts produced different results and instead wanted consistency?
- Author did not know about the C99 numerics support?

The C99 standard will keep results accurate on both different versions of 
gcc and different host architecture. It will also give us speed over
the softfloat routines. 

  reply	other threads:[~2016-12-03 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03  5:59 [Qemu-devel] [RFC] target-ppc/fpu_helper.c: Use C99 code to speed up floating point unit Programmingkid
2016-12-03  8:44 ` Paolo Bonzini
2016-12-03 17:07   ` Programmingkid [this message]
2016-12-04  1:32     ` Richard Henderson
2016-12-05 16:42       ` Eric Blake
2016-12-05 10:40 ` no-reply

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=F5D2D047-AD72-4378-AD8A-F411D3453CAF@gmail.com \
    --to=programmingkidx@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).