Re: CSV arm check failure

From: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
To: Marko Kreen <marko(at)l-t(dot)ee>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CSV arm check failure
Date: 2005-01-06 15:06:38
Message-ID: 20050106150102.M70588@contactbda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marko/All,

I wrote the following test program

#include <stdio.h>
#include <math.h>

#define HYPOT(A, B) sqrt((A) * (A) + (B) * (B))
int main()
{
printf("SQRT Test\n");
long double a;

a = HYPOT(0-10,0-10);
printf("double a = %20.12Lf\n",a);
exit(0);
}

and compiled it as follows
gcc -lm -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -fno-strict-aliasing -g -o sqrttest sqrt.c

with the following results:
SQRT Test
double a = 14.142135623731

which is the exact answer in the "results" file for point.

Now if I use perl instead of "C" I get the wrong answer 14.1421356237309 which is what postgres is also reporting. So
this looks like a compile time problem which is alittle over my head.

Any idea's
Jim

Jim

---------- Original Message -----------
From: Marko Kreen <marko(at)l-t(dot)ee>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: jim(at)contactbda(dot)com, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Sent: Thu, 6 Jan 2005 15:26:05 +0200
Subject: Re: [HACKERS] CSV arm check failure

> On Thu, Jan 06, 2005 at 10:18:58AM +0100, Peter Eisentraut wrote:
> > Am Dienstag, 4. Januar 2005 19:03 schrieb Jim Buttafuoco:
> > > ARM platform fails the "point" test see below.
> >
> > For the 7.4 release we got a report for the ARM platform where all tests
> > passed:
> >
> > http://archives.postgresql.org/pgsql-hackers/2003-10/msg01212.php
> >
> > So either there are various degrees of ARM processors or something is broken.
> > Ideas?
>
> Yes, there are various degrees of those, but most of them should be
> FPU-less. So FPU-emulation details would be interesting.
>
> In case of Linux there are 3 variants:
>
> NWFPE: default
>
> FastFPE: only 32-bit mantissa, 4-8x faster than NWFPE
>
> gcc -msoft-float: no FP instructions, direct calls. This
> changes calling convention, so requires that all
> code is compiled with this.
>
> Jim, do you happen to use FastFPE?
>
> --
> marko
------- End of Original Message -------

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Kreen 2005-01-06 15:21:18 Re: CSV arm check failure
Previous Message Marko Kreen 2005-01-06 14:58:03 Re: CSV arm check failure