All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] PowerPC Decimal Floating Point
@ 2014-02-11 17:14 Tom Musta
  2014-02-12  7:38 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Musta @ 2014-02-11 17:14 UTC (permalink / raw)
  To: QEMU Developers, qemu-ppc

QEMU is currently lacking support for the Decimal Floating Point category of instructions
(see Power ISA V2.07 Chapter 6).  I intend to add this support.

Has this topic been investigated before and if so can anyone point me to that discussion?
A Google search came up empty for me.

My proposal is to incorporate the libdecnumber component of libdfp
(http://www.eglibc.org/cgi-bin/viewvc.cgi/libdfp/trunk/) in a manner analogous to how
softfloat is used for binary floating point.  So, for example, the helper for the dadd
instruction would look something like the following:

   - map FPSCR state to a decContext.
   - convert the contents of the source FPRs to decNumbers (decimal64ToNumber).
   - call decNumberAdd
   - convert the resultant decNumber to DPD (decimal64FromNumber)
   - update FPSCR per the decContext.status and result.

Comments?

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

* Re: [Qemu-devel] [Qemu-ppc] PowerPC Decimal Floating Point
  2014-02-11 17:14 [Qemu-devel] PowerPC Decimal Floating Point Tom Musta
@ 2014-02-12  7:38 ` Alexander Graf
  2014-02-14 21:22   ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2014-02-12  7:38 UTC (permalink / raw)
  To: Tom Musta; +Cc: Peter Maydell, qemu-ppc, QEMU Developers, Richard Henderson


On 11.02.2014, at 18:14, Tom Musta <tommusta@gmail.com> wrote:

> QEMU is currently lacking support for the Decimal Floating Point category of instructions
> (see Power ISA V2.07 Chapter 6).  I intend to add this support.
> 
> Has this topic been investigated before and if so can anyone point me to that discussion?
> A Google search came up empty for me.
> 
> My proposal is to incorporate the libdecnumber component of libdfp
> (http://www.eglibc.org/cgi-bin/viewvc.cgi/libdfp/trunk/) in a manner analogous to how
> softfloat is used for binary floating point.  So, for example, the helper for the dadd
> instruction would look something like the following:
> 
>   - map FPSCR state to a decContext.
>   - convert the contents of the source FPRs to decNumbers (decimal64ToNumber).
>   - call decNumberAdd
>   - convert the resultant decNumber to DPD (decimal64FromNumber)
>   - update FPSCR per the decContext.status and result.
> 
> Comments?

I think that approach makes a lot of sense, but let's ask Richard and Peter as well.


Alex

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

* Re: [Qemu-devel] [Qemu-ppc] PowerPC Decimal Floating Point
  2014-02-12  7:38 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
@ 2014-02-14 21:22   ` Richard Henderson
  2014-02-14 22:22     ` Tom Musta
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2014-02-14 21:22 UTC (permalink / raw)
  To: Alexander Graf, Tom Musta; +Cc: Peter Maydell, qemu-ppc, QEMU Developers

On 02/11/2014 11:38 PM, Alexander Graf wrote:
>> > My proposal is to incorporate the libdecnumber component of libdfp
>> > (http://www.eglibc.org/cgi-bin/viewvc.cgi/libdfp/trunk/) in a manner analogous to how
>> > softfloat is used for binary floating point.  So, for example, the helper for the dadd
>> > instruction would look something like the following:
>> > 
>> >   - map FPSCR state to a decContext.
>> >   - convert the contents of the source FPRs to decNumbers (decimal64ToNumber).
>> >   - call decNumberAdd
>> >   - convert the resultant decNumber to DPD (decimal64FromNumber)
>> >   - update FPSCR per the decContext.status and result.
>> > 
>> > Comments?
> I think that approach makes a lot of sense, but let's ask Richard and Peter as well.

Reasonable, as far as the implementation details go.

I am a teeny bit concerned which version of libdecnumber is considered most
"upstream".  Ordinarily I'd point to the copy in gcc, but that is of course
GPLv3 + GCC runtime exception.  I see the version from eglibc you quote above
is LGPLv2.1.  I also see that the last change is 18 months old.  On the other
hand, there is only one non-autoconf change in the gcc sources in the same period.

The original import is from IBM sources.  Is there somewhere "upstream" at IBM
that we ought to be importing from instead?


r~

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

* Re: [Qemu-devel] [Qemu-ppc]   PowerPC Decimal Floating Point
  2014-02-14 21:22   ` Richard Henderson
@ 2014-02-14 22:22     ` Tom Musta
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Musta @ 2014-02-14 22:22 UTC (permalink / raw)
  To: Richard Henderson, Alexander Graf
  Cc: Peter Maydell, qemu-ppc, QEMU Developers

On 2/14/2014 3:22 PM, Richard Henderson wrote:
> On 02/11/2014 11:38 PM, Alexander Graf wrote:
>>>> My proposal is to incorporate the libdecnumber component of libdfp
>>>> (http://www.eglibc.org/cgi-bin/viewvc.cgi/libdfp/trunk/) in a manner analogous to how
>>>> softfloat is used for binary floating point.  So, for example, the helper for the dadd
>>>> instruction would look something like the following:
>>>>
>>>>   - map FPSCR state to a decContext.
>>>>   - convert the contents of the source FPRs to decNumbers (decimal64ToNumber).
>>>>   - call decNumberAdd
>>>>   - convert the resultant decNumber to DPD (decimal64FromNumber)
>>>>   - update FPSCR per the decContext.status and result.
>>>>
>>>> Comments?
>> I think that approach makes a lot of sense, but let's ask Richard and Peter as well.
> 
> Reasonable, as far as the implementation details go.
> 
> I am a teeny bit concerned which version of libdecnumber is considered most
> "upstream".  Ordinarily I'd point to the copy in gcc, but that is of course
> GPLv3 + GCC runtime exception.  I see the version from eglibc you quote above
> is LGPLv2.1.  I also see that the last change is 18 months old.  On the other
> hand, there is only one non-autoconf change in the gcc sources in the same period.
> 
> The original import is from IBM sources.  Is there somewhere "upstream" at IBM
> that we ought to be importing from instead?
> 

Richard:

I will check with folks inside of IBM here that I have the latest and greatest.

FWIW ... I have about 20 instructions prototyped and running in a test harness
(not QEMU) and comparing results against actual P7/P8 hardware.  So far, this
looks pretty good.  I haven't yet worked through any details of importing the library
into QEMU.

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

end of thread, other threads:[~2014-02-14 22:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11 17:14 [Qemu-devel] PowerPC Decimal Floating Point Tom Musta
2014-02-12  7:38 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-02-14 21:22   ` Richard Henderson
2014-02-14 22:22     ` Tom Musta

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.