From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37653 invoked by alias); 19 Nov 2015 01:22:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 37642 invoked by uid 89); 19 Nov 2015 01:22:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Thu, 19 Nov 2015 01:22:00 -0000 From: Joseph Myers To: Steve Munroe CC: "libc-alpha@sourceware.org" , Michael R Meissner , "Paul E. Murphy" , Tulio Magno Quites Machado Filho Subject: Re: IEEE128 binary float to decimal float conversion routines In-Reply-To: <201511190052.tAJ0qd4x018924@d03av02.boulder.ibm.com> Message-ID: References: <564A16D5.3020105@linux.vnet.ibm.com> <564A6A90.40607@linux.vnet.ibm.com> <201511180131.tAI1Vs2L023118@d03av01.boulder.ibm.com> <201511182301.tAIN1Igc011083@d03av02.boulder.ibm.com> <201511190052.tAJ0qd4x018924@d03av02.boulder.ibm.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2015-11/txt/msg00448.txt.bz2 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