Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760280AbYFMPtm (ORCPT ); Fri, 13 Jun 2008 11:49:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756601AbYFMPte (ORCPT ); Fri, 13 Jun 2008 11:49:34 -0400 Received: from gate.crashing.org ([63.228.1.57]:59014 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756547AbYFMPte (ORCPT ); Fri, 13 Jun 2008 11:49:34 -0400 Cc: joseph@codesourcery.com, linux-kernel@vger.kernel.org, libc-alpha@sourceware.org Message-Id: From: Kumar Gala To: David Miller In-Reply-To: <20080612.212457.01943346.davem@davemloft.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Subject: Re: math-emu issue with fp divide Date: Fri, 13 Jun 2008 10:49:04 -0500 References: <20080604.144950.117343339.davem@davemloft.net> <20080612.212457.01943346.davem@davemloft.net> X-Mailer: Apple Mail (2.924) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2092 Lines: 65 On Jun 12, 2008, at 11:24 PM, David Miller wrote: > From: Kumar Gala > Date: Thu, 5 Jun 2008 08:38:44 -0500 (CDT) > >> Now that I'm digging into this a bit I'm thinking my issue has to >> do with >> the fix you put in place from back in Aug 2007 (commit >> 405849610fd96b4f34cd1875c4c033228fea6c0f): >> >> [MATH-EMU]: Fix underflow exception reporting. >> >> 2) we ended up rounding back up to normal (this is the case where >> we set the exponent to 1 and set the fraction to zero), this >> should set inexact too >> ... >> >> Another example, "0x0.0000000000001p-1022 / 16.0", should signal >> both >> inexact and underflow. The cpu implementations and ieee1754 >> literature is very clear about this. This is case #2 above. >> >> I'm not clear from your commit comment on what actual number >> 0x0.0....01p-1022 is? > > I haven't been able to look closely at this yet but I think I > happened to stumble over the test case that lead me to that > changeset you are referencing here. > > The "actual number" is exactly as listed "0x0.0000000000001p-1022", > I don't know what's so confusing about it :-))) I don't think I've ever seen the notation before :) > I think this was distilled by Jakub Jelinek from some glibc test case. > > #include > #include > #include > > volatile double d = DBL_MIN; > volatile double e = 0x0.0000000000001p-1022; > volatile double f = 16.0; > int > main (void) > { > printf ("%x\n", fetestexcept (FE_UNDERFLOW)); > d /= f; > printf ("%x\n", fetestexcept (FE_UNDERFLOW)); > e /= f; > printf ("%x\n", fetestexcept (FE_UNDERFLOW)); > return 0; > } Cool, I'll try this out and see what it does on PPC HW and w/my current EMU. I'll also see if I can work up a test case to show the issue I've set a patch for. - k -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/