From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30009 invoked by alias); 16 May 2011 09:15:51 -0000 Received: (qmail 29993 invoked by uid 22791); 16 May 2011 09:15:50 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_TM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 May 2011 09:15:32 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4G9FW2p027724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 16 May 2011 05:15:32 -0400 Received: from zebedee.pink (ovpn-113-73.phx2.redhat.com [10.3.113.73]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4G9FUxJ004007; Mon, 16 May 2011 05:15:31 -0400 Message-ID: <4DD0EB31.2080202@redhat.com> Date: Mon, 16 May 2011 11:03:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: question about equivalent x87/x64-64 fpu code... References: <201105132011.34453.pluto@agmk.net> In-Reply-To: <201105132011.34453.pluto@agmk.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00206.txt.bz2 On 13/05/11 19:11, Paweł Sikora wrote: > Hi, > > i'm using a 3rd-party engine http://glaros.dtc.umn.edu/gkhome/metis/metis/overview > for partitioning some complex data. it worked fine for years until today (may 13)... > > observations: > - the 32-bit metis build produces nice and balanced partitons. > - the 64-bit metis build produces bad and unbalanced partitons. > > the metis' engine uses arrays of integers on the public interface and internally > some float-based and unsafe in terms of precison (x > so, i've built/tested following metis variants: > > 1). -m32 -march=pentium4 -O1 - works fine. > 2). -m32 -march=pentium4 -O1 -mfpmath=sse - works fine. > 3). -m64 -march=x86-64 -O1 - bad/unbalanced partitions. > 4). -m64 -march=x86-64 -O1 -mfpmath=387 - bad/unbalanced partitions. > > at this point i've expected wrong results (< 80-bit precision) from variants 2/3 > and good results from variants 1/4 but the real world differs. > > next, i've isolated a one place in sources with float x to (x-y)<0.00001. with such change both native 1/3 variants give nice/equivalent results. > > so, where is the problem? is the variants 1/4 really equivalent? It's going to be very hard for gcc specialists to answer this. You really need a numerical analyst who is familiar with the code to have a look. This may be a gcc bug, or it may be a bug in the code. It'd impossible to know without doing more digging into the problem. Andrew.