From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 927663858D35; Wed, 22 Dec 2021 11:51:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 927663858D35 Received: by mail-wr1-x430.google.com with SMTP id a9so4347600wrr.8; Wed, 22 Dec 2021 03:51:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=iY/MGo0KeSjXrv5yNQxR7NY6YPaJh383irZ4RQWs2BU=; b=5ymtvEe/psS3h9dK//0A7g3l2UYBUf4D6Rdg9NQyfe12b10uEnMyFvPUCAz3IXF91W gt3QAGd5xzgNVa/kD9e52vbg0tDqB2SDORUSQMlkInUDAHhCpxD8xOz8putQRKz0xdYk maJ7WeTy87dN6PuCpxx4eyJR7XMMso8sC6ir71rJCyDis+g7S0td6Kl9SLoOQlsdaHof 8/NzRDgTMJmHV3zm/KxTxanAfulbvVZbheA/JWxDzdMynSiIKf7TrNmBFg1gdV/DMFqa F6HzKoRaimMaTcQXcAdpT5xSsxKJtA69TNNjBYxCroTaZbpg8Qa8woS6K+pncnvpZGpz u8ZA== X-Gm-Message-State: AOAM532P6p5DvsoEYyJS0QhBPmWMbJIMCUkF5g5cUZlreJbhPfDhFMuc Y2N/MSbKRYsV83yFBH4USCc= X-Google-Smtp-Source: ABdhPJzhrMNNEB7T72cOJ4yjkTv8bMSRiV7r7Azw9iKVVMQQiMKWKjYkS3rk3NFVZIhinpJGZSmiXQ== X-Received: by 2002:adf:e94c:: with SMTP id m12mr1882191wrn.239.1640173868733; Wed, 22 Dec 2021 03:51:08 -0800 (PST) Received: from smtpclient.apple ([2a01:e34:ec28:8cb0:494d:653b:6b7d:f557]) by smtp.gmail.com with ESMTPSA id r62sm1541416wmr.35.2021.12.22.03.51.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Dec 2021 03:51:08 -0800 (PST) From: FX Message-Id: <64185D58-38AA-4EED-8FE0-DA767BCDCD6A@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_9B037186-A5BE-4B63-87EF-291DC39705ED" Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Subject: Re: [patch, Fortran] Make REAL(KIND=16) detection more robust Date: Wed, 22 Dec 2021 12:51:07 +0100 In-Reply-To: <7ae32415-ff34-360c-cad5-2782632cd7d7@netcologne.de> Cc: gcc-patches@gcc.gnu.org, Iain Sandoe , fortran@gcc.gnu.org To: Thomas Koenig References: <8CA66B79-11B1-40B2-B361-F8835EF4DF1B@gmail.com> <2bd8fb54-462c-228a-b002-35f7cf4d080d@netcologne.de> <7ae32415-ff34-360c-cad5-2782632cd7d7@netcologne.de> X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Dec 2021 11:51:11 -0000 --Apple-Mail=_9B037186-A5BE-4B63-87EF-291DC39705ED Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Thanks Thomas, pushed as 228173565eafbe34e44c1600c32e32a323eb5aab --Apple-Mail=_9B037186-A5BE-4B63-87EF-291DC39705ED Content-Disposition: attachment; filename=228173565eafbe34e44c1600c32e32a323eb5aab.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="228173565eafbe34e44c1600c32e32a323eb5aab.patch" Content-Transfer-Encoding: quoted-printable commit=20228173565eafbe34e44c1600c32e32a323eb5aab=0AAuthor:=20= Francois-Xavier=20Coudert=20=0ADate:=20=20=20= 2021-12-22=2012:46:07=20+0100=0A=0A=20=20=20=20Fortran:=20allow=20= __float128=20on=20targets=20where=20long=20double=20is=20not=20= REAL(KIND=3D10)=0A=20=20=20=20=0A=20=20=20=20The=20logic=20for=20= detection=20of=20REAL(KIND=3D16)=20in=20kinds-override.h=20made=0A=20=20=20= =20assumptions:=0A=20=20=20=20=0A=20=20=20=20=20=20=20=20--=20if=20= real(kind=3D10)=20exists,=20i.e.=20if=20HAVE_GFC_REAL_10=20is=20defined,=0A= =20=20=20=20=20=20=20=20=20=20=20then=20it=20is=20necessarily=20the=20= "long=20double"=20type=0A=20=20=20=20=20=20=20=20--=20if=20real(kind=3D16)= =20exists,=20then:=0A=20=20=20=20=20=20=20=20=20=20=20*=20if=20= HAVE_GFC_REAL_10,=20real(kind=3D16)=20is=20"__float128"=0A=20=20=20=20=20= =20=20=20=20=20=20*=20otherwise,=20real(kind=3D16)=20is=20"long=20= double"=0A=20=20=20=20=0A=20=20=20=20This=20may=20not=20always=20be=20= true.=20Take=20the=20aarch64-apple-darwin=20port,=0A=20=20=20=20it=20has=20= double=20=3D=3D=20long=20double=20=3D=3D=20binary64,=20and=20__float128=20= =3D=3D=20binary128.=0A=20=20=20=20=0A=20=20=20=20We=20already=20have=20= more=20fine-grained=20logic=20in=20the=20mk-kinds-h.sh=20script,=0A=20=20= =20=20where=20we=20actually=20check=20the=20Fortran=20kind=20= corresponding=20to=20C=E2=80=99s=20long=0A=20=20=20=20double.=20So=20= let's=20use=20it,=20and=20emit=20the=20GFC_REAL_16_IS_FLOAT128=20/=0A=20=20= =20=20GFC_REAL_16_IS_LONG_DOUBLE=20macros=20there.=0A=20=20=20=20=0A=20=20= =20=20libgfortran/ChangeLog:=0A=20=20=20=20=0A=20=20=20=20=20=20=20=20=20= =20=20=20*=20kinds-override.h:=20Move=20GFC_REAL_16_IS_*=20macros...=0A=20= =20=20=20=20=20=20=20=20=20=20=20*=20mk-kinds-h.sh:=20...=20here.=0A=0A= diff=20--git=20a/libgfortran/kinds-override.h=20= b/libgfortran/kinds-override.h=0Aindex=20c9e874a3f38..5f7840b0c89=20= 100644=0A---=20a/libgfortran/kinds-override.h=0A+++=20= b/libgfortran/kinds-override.h=0A@@=20-23,24=20+23,9=20@@=20see=20the=20= files=20COPYING3=20and=20COPYING.RUNTIME=20respectively.=20=20If=20not,=20= see=0A=20.=20=20*/=0A=20=0A=20=0A-/*=20= What=20are=20the=20C=20types=20corresponding=20to=20the=20real(kind=3D10)=20= and=0A-=20=20=20real(kind=3D16)=20types?=20We=20currently=20rely=20on=20= the=20following=20assumptions:=0A-=20=20=20=20=20--=20if=20real(kind=3D10)= =20exists,=20i.e.=20if=20HAVE_GFC_REAL_10=20is=20defined,=0A-=20=20=20=20= =20=20=20=20then=20it=20is=20necessarily=20the=20"long=20double"=20type=0A= -=20=20=20=20=20--=20if=20real(kind=3D16)=20exists,=20then:=0A-=20=20=20=20= =20=20=20=20=20*=20if=20HAVE_GFC_REAL_10,=20real(kind=3D16)=20is=20= "__float128"=0A-=09=20*=20otherwise,=20real(kind=3D16)=20is=20"long=20= double"=0A-=20=20=20To=20allow=20to=20change=20this=20in=20the=20future,=20= we=20create=20the=0A-=20=20=20GFC_REAL_16_IS_FLOAT128=20macro=20that=20= is=20used=20throughout=20libgfortran.=20=20*/=0A-=0A-#if=20= defined(HAVE_GFC_REAL_16)=0A-#=20if=20defined(HAVE_GFC_REAL_10)=0A-#=20=20= define=20GFC_REAL_16_IS_FLOAT128=0A-#=20=20if=20!defined(HAVE_FLOAT128)=0A= -#=20=20=20error=20"Where=20has=20__float128=20gone?"=0A-#=20=20endif=0A= -#=20else=0A-#=20=20define=20GFC_REAL_16_IS_LONG_DOUBLE=0A-#=20endif=0A= +/*=20Ensure=20that=20TFmode=20is=20available=20under.=20=20*/=0A+=0A= +#if=20defined(GFC_REAL_16_IS_FLOAT128)=20&&=20!defined(HAVE_FLOAT128)=0A= +#=20error=20"Where=20has=20__float128=20gone?"=0A=20#endif=0A=20=0Adiff=20= --git=20a/libgfortran/mk-kinds-h.sh=20b/libgfortran/mk-kinds-h.sh=0A= index=20249619061c6..572878ce891=20100755=0A---=20= a/libgfortran/mk-kinds-h.sh=0A+++=20b/libgfortran/mk-kinds-h.sh=0A@@=20= -64,15=20+64,19=20@@=20for=20k=20in=20$possible_real_kinds;=20do=0A=20=20= =20=20=20case=20$k=20in=0A=20=20=20=20=20=20=204)=20ctype=3D"float"=20;=20= cplxtype=3D"complex=20float"=20;=20suffix=3D"f"=20;;=0A=20=20=20=20=20=20= =208)=20ctype=3D"double"=20;=20cplxtype=3D"complex=20double"=20;=20= suffix=3D""=20;;=0A+=20=20=20=20=20=20#=20If=20we=20have=20a=20= REAL(KIND=3D10),=20it=20is=20always=20long=20double=0A=20=20=20=20=20=20=20= 10)=20ctype=3D"long=20double"=20;=20cplxtype=3D"complex=20long=20double"=20= ;=20suffix=3D"l"=20;;=0A-=20=20=20=20=20=2016)=20if=20[=20= $long_double_kind=20-eq=2010=20];=20then=0A+=20=20=20=20=20=20#=20If=20= we=20have=20a=20REAL(KIND=3D16),=20it=20is=20either=20long=20double=20or=20= __float128=0A+=20=20=20=20=20=2016)=20if=20[=20$long_double_kind=20-ne=20= 16=20];=20then=0A=20=09=20=20=20=20ctype=3D"__float128"=0A=20=09=20=20=20= =20cplxtype=3D"_Complex=20float=20__attribute__((mode(TC)))"=0A=20=09=20=20= =20=20suffix=3D"q"=0A+=09=20=20=20=20echo=20"#define=20= GFC_REAL_16_IS_FLOAT128"=0A=20=09=20=20else=0A=20=09=20=20=20=20= ctype=3D"long=20double"=0A=20=09=20=20=20=20cplxtype=3D"complex=20long=20= double"=0A=20=09=20=20=20=20suffix=3D"l"=0A+=09=20=20=20=20echo=20= "#define=20GFC_REAL_16_IS_LONG_DOUBLE"=0A=20=09=20=20fi=20;;=0A=20=20=20=20= =20=20=20*)=20echo=20"$0:=20Unknown=20type"=20>&2=20;=20exit=201=20;;=0A=20= =20=20=20=20esac=0A= --Apple-Mail=_9B037186-A5BE-4B63-87EF-291DC39705ED--