From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9617 invoked by alias); 3 Aug 2003 11:18:20 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 9601 invoked from network); 3 Aug 2003 11:18:17 -0000 Received: from unknown (HELO keid.tat.physik.uni-tuebingen.de) (134.2.170.10) by sources.redhat.com with SMTP; 3 Aug 2003 11:18:17 -0000 Received: by keid.tat.physik.uni-tuebingen.de (Postfix, from userid 30252) id 58D5A4EB34; Sun, 3 Aug 2003 13:18:16 +0200 (CEST) From: Erik Schnetter To: gcc@gcc.gnu.org Subject: Implementing real*16 in Fortran Date: Sun, 03 Aug 2003 12:57:00 -0000 User-Agent: KMail/1.5.2 MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200308031317.33934.schnetter@uni-tuebingen.de> X-SW-Source: 2003-08/txt/msg00065.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I want to implement real*16 in Fortran. For that I seem to need two=20 things: (1) For run time libraries, I need a corresponding C type. I think the=20 best thing would be to use long double for that, but it has to have a=20 sizeof of 16. On i386, the option -m128bit-long-double does just this.=20= =20 Is there a way to declare a type that does not need this option? I=20 tried typedef long double __attribute__((aligned(16)) real16; but this did not work; the size is still 12. (Such a mechanism would=20 also be very useful to interface between C and Fortran in general.) (2) In the front end, I have to declare such a type to the middle end.=20=20 The Fortran front end uses currently #define PUSH_TYPE(name, node) \ pushdecl (build_decl (TYPE_DECL, get_identifier (name), node)) gfc_real16_type_node =3D long_double_type_node; PUSH_TYPE ("real16", gfc_real16_type_node); but this does not make sure that the size is 16 bytes. The C front end=20 has the equivalent of gfc_real16_type_node =3D make_node (REAL_TYPE); TYPE_PRECISION (long_double_type_node) =3D 128; layout_type (gfc_real16_type_node); PUSH_TYPE ("real16", gfc_real16_type_node); but can it really be that easy? Where is the association between the=20 constant "128" and the corresponding long double assembler statements=20 made? i386.{c,h,md} still think that a long double has 96 bits. - -erik - --=20 Erik Schnetter Web: http://www.tat.physik.uni-tuebingen.de/~schnette/ My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/LO9Em3uiSwno3f0RAjTOAKCr9sKzXVgJU/s+NR2qUrVs9BAP7gCeP+Ct qnhnJiYso9O6jShvWEy+KQ4=3D =3Do/jM -----END PGP SIGNATURE-----