This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: IEEE128 binary float to decimal float conversion routines
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Steve Munroe <sjmunroe at us dot ibm dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, Michael R Meissner <mrmeissn at us dot ibm dot com>, "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>, Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Date: Thu, 19 Nov 2015 01:22:04 +0000
- Subject: Re: IEEE128 binary float to decimal float conversion routines
- Authentication-results: sourceware.org; auth=none
- References: <564A16D5 dot 3020105 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 10 dot 1511161803500 dot 30498 at digraph dot polyomino dot org dot uk> <564A6A90 dot 40607 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 10 dot 1511162356020 dot 32387 at digraph dot polyomino dot org dot uk> <201511180131 dot tAI1Vs2L023118 at d03av01 dot boulder dot ibm dot com> <alpine dot DEB dot 2 dot 10 dot 1511180144150 dot 2302 at digraph dot polyomino dot org dot uk> <201511182301 dot tAIN1Igc011083 at d03av02 dot boulder dot ibm dot com> <alpine dot DEB dot 2 dot 10 dot 1511182322260 dot 26547 at digraph dot polyomino dot org dot uk> <201511190052 dot tAJ0qd4x018924 at d03av02 dot boulder dot ibm dot com>
On Thu, 19 Nov 2015, Steve Munroe wrote:
> Trying again. Please take some time to study PowerISA-2.07B :Book I Decimal
> Floating-Point (DFP)
> Facility Overview" and consider the implications that Decimal unit has
> rounding modes that separate and independent of binary float. And the one
> of the rounding modes is "Round to Prepare for Shorter Precision".
>
> This seems to be the decimal analog of round to odd ?
Yes, it is, but it doesn't help here. What it helps for is implementing
formatOf arithmetic operations that take wider operands and round just
once to narrower precision *with the same radix*, such as d32muld64 from
TS 18661-2 - you'd do the multiplication in decimal64 format using that
mode, restore the original mode and do the conversion to decimal32 in the
original mode (and it can also be used in implementing fma). But when
what you want to do doesn't have a DFP instruction that can use that
rounding mode, or when you are producing a binary result and so the binary
rounding mode is the relevant rounding mode and you essentially need all
decimal computations to be exact, it doesn't solve your problem.
In other words: if you had a DFP instruction "convert decimal128 to
binary64, using the decimal rounding mode", but no instruction "convert
decimal128 to binary32, using the binary rounding mode", you could use the
former, in the "Round to Prepare for Shorter Precision" mode, to implement
the latter. But you don't have such instructions, and I don't think this
mode helps implement these particular conversions at all.
--
Joseph S. Myers
joseph@codesourcery.com