This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC patch: Add libquadmath - and use it in gfortran (round two)
On Mon, Nov 08, 2010 at 06:20:41PM -0800, Jerry DeLisle wrote:
> I am currently bootstrapping the patches. I am curious what these tmp1
> and tmp2 are about? Also see them on the real128 versions as well.
>
> #if defined(GFC_REAL_16_IS_FLOAT128)
> void
> transfer_complex128 (st_parameter_dt *dtp, void *p, int kind)
> {
> static void *tmp1 = quadmath_strtopQ;
> static void *tmp2 = quadmath_dtoaq;
>
> transfer_complex (dtp, p, kind);
> }
>
>
> void
> transfer_complex_write128 (st_parameter_dt *dtp, void *p, int kind)
> {
> static void *tmp1 = quadmath_strtopQ;
> static void *tmp2 = quadmath_dtoaq;
>
> transfer_complex (dtp, p, kind);
> }
> #endif
>
>
> Jerry
Jerry,
With the corrections to libgfortran/transfer.c that I mentioned in...
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00830.html
the example...
program test_qp
implicit none
integer, parameter :: QP = 16
real(QP), parameter :: Z1 = 1,HALF_PI = asin(Z1),PI = HALF_PI+HALF_PI
real(QP) :: x = 0.124_QP
print *, x
print *, PI
print *, 16*atan(0.2_QP)-4*atan(Z1/239)
print *, sin(PI)
print *, cos(HALF_PI)
print *, asinh(PI)
print *, erfc(Z1)
print *, epsilon(x)
print *, precision(x)
print *, digits(x)
end program test_qp
compiles without error and the resulting binary on x86_64-apple-darwin10
produces the output...
0.12399999999999999999999999999999999
3.1415926535897932384626433832795028
3.1415926535897932384626433832795032
8.67181013012378102479704402604335225E-0035
4.33590506506189051239852201302167613E-0035
1.8622957433108482198883613251826206
0.15729920705028513065877936491739074
1.92592994438723585305597794258492732E-0034
33
113
Jack