[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: floating point types seems to need VSX support ?



<snip>
So regardless if I use gcc 6.4.0 or gcc 7.2.0 or even the Oracle cc we
always see the correct data in memory and the correct output.  However
on PowerPC 64-bit with gcc 7.2.0 there seems to be an entirely other
data representation at work internally and a need for -mfloat128 ? That
won't work unless the hardware has VSX support.  Then again I don't know
but I do know that the output is wrong if the in memory data is correct.

Am I missing something here to make the exact same functionality on
ppc64 ?  Personally I am confused about what floating point support
there is in the hardware and gcc combination.  Any input from anyone
would be great and would really love to see what a Power7 system does.

So the comment mentions pi = 3.14159265358979323846264338327950280e+00L
while you use pi_ld        = 3.1415926535897932384626433832795028841971L;
so that's different and might explain the slight difference in hex value.

No it does not. The constant I provide is well past the precision of the
128 bit IEEE-754 floating point format. In fact it is more correct than
the constant used in the glibc sources which also supercedes the 128-bit
precision of the data type. Also you will see that the output and the in
memory data on another RISC big-endian system works perfectly.

The objective is to force the compiler to render the conversion from the
provided "pi_ld" constant string. Which it does correctly.

And given you have to pass the -m argument, makes you wonder of
the math library functions are compiled with the same option or some
other option with different results.  After all I believe the default
128bit floating point used to be the ibm extended format, not IEEE.

Yes, therein may lay the issue here.

It looks like it might still be the case.  Apparently there are options
-mabi=ieeelongdouble and -mabi=ibmlongdouble with the ibm one being
the default.  That probably means the libraries are compiled that way
too and seems to be a powerpc specific weirdness which could be why
other architectures have no such crazyness.

The problem seems to lay with the compiler and it does ( it may ) have a
hard requirement for the Power7 architecture as a minimum because this
is where we see the first vector scalar hardware.  At the moment the gcc
compiler enforces a requirement on that feature and thus it won't work
in a portable way on earlier hardware. It does, however, work perfectly
on the Sparc architecture.

I am looking into this closely and will have some results in a day or
so.

Dennis Clarke


Reply to: