From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1CD6C385C335; Wed, 24 Aug 2022 16:56:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CD6C385C335 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661360210; bh=UbK2szagxcpihBOUDhHD7BFBhQIBS8CeYvap+7Tymb4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lZKZlCZOyXtBCjlxxrHaW1oXMNvj1Wnpw9DyhCKuFWemWajqmI4bcEPAFCuyvv3ot oPDAHxUitnxUaNV+oYlDYQaWK0NTVMUw/GFxSCNcENI54gyMIvQYZgH+/+w9fUbCWx JP6GvjAtd9iHn3XTqcr2AOenHHnE/AMK7oCE3LFI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106652] [C++23] P1467 - Extended floating-point types and standard names Date: Wed, 24 Aug 2022 16:56:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106652 --- Comment #3 from Jakub Jelinek --- Testcase for the already implemented features: // P1467R9 - Extended floating-point types and standard names. // { dg-do compile { target c++23 } } // { dg-options "" } namespace std { #ifdef __STDCPP_FLOAT16_T__ using float16_t =3D _Float16; #endif #ifdef __STDCPP_FLOAT32_T__ using float32_t =3D _Float32; #endif #ifdef __STDCPP_FLOAT64_T__ using float64_t =3D _Float64; #endif #ifdef __STDCPP_FLOAT128_T__ using float128_t =3D _Float128; #endif template struct integral_constant { static constexpr T value =3D v; }; typedef integral_constant false_type; typedef integral_constant true_type; template struct is_same : std::false_type {}; template struct is_same : std::true_type {}; } #ifdef __STRICT_ANSI__ #undef __SIZEOF_FLOAT128__ #endif using namespace std; static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); #ifdef __SIZEOF_FLOAT128__ static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); #endif #ifdef __STDCPP_FLOAT16_T__ static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); #endif #ifdef __STDCPP_FLOAT32_T__ static_assert (!is_same::value); static_assert (!is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (!is_same::value); static_assert (!is_same::value); static_assert (is_same::value); static_assert (is_same::value); #endif #ifdef __STDCPP_FLOAT64_T__ static_assert (!is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (!is_same::value); static_assert (!is_same::value); static_assert (is_same::value); static_assert (is_same::value); #endif #ifdef __STDCPP_FLOAT128_T__ static_assert (!is_same::value); static_assert (!is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (!is_same::value); static_assert (!is_same::value); static_assert (is_same::value); static_assert (is_same::value); #ifdef __SIZEOF_FLOAT128__ static_assert (!is_same::value); static_assert (!is_same::value); static_assert (!is_same::value); static_assert (!is_same::value); #endif #endif static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); static_assert (is_same::value); #if defined(__STDCPP_FLOAT16_T__) && defined(__STDCPP_FLOAT32_T__) static_assert (is_same::value); static_assert (is_same::value); #endif #if defined(__STDCPP_FLOAT16_T__) && defined(__STDCPP_FLOAT64_T__) static_assert (is_same::value); static_assert (is_same::value); #endif #if defined(__STDCPP_FLOAT16_T__) && defined(__STDCPP_FLOAT128_T__) static_assert (is_same::value); static_assert (is_same::value); #endif #if defined(__STDCPP_FLOAT32_T__) && defined(__STDCPP_FLOAT64_T__) static_assert (is_same::value); static_assert (is_same::value); #endif #if defined(__STDCPP_FLOAT32_T__) && defined(__STDCPP_FLOAT128_T__) static_assert (is_same::value); static_assert (is_same::value); #endif #if defined(__STDCPP_FLOAT64_T__) && defined(__STDCPP_FLOAT128_T__) static_assert (is_same::value); static_assert (is_same::value); #endif #ifdef __STDCPP_FLOAT32_T__ #if __FLT_MAX_EXP__ =3D=3D __FLT32_MAX_EXP__ && __FLT_MANT_DIG__ =3D=3D __FLT32_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #if __DBL_MAX_EXP__ > __FLT32_MAX_EXP__ && __DBL_MANT_DIG__ > __FLT32_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #if __LDBL_MAX_EXP__ > __FLT32_MAX_EXP__ && __LDBL_MANT_DIG__ > __FLT32_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #endif #ifdef __STDCPP_FLOAT64_T__ #if __FLT_MAX_EXP__ < __FLT64_MAX_EXP__ && __FLT_MANT_DIG__ < __FLT64_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #if __DBL_MAX_EXP__ =3D=3D __FLT64_MAX_EXP__ && __DBL_MANT_DIG__ =3D=3D __FLT64_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #if __LDBL_MAX_EXP__ > __FLT64_MAX_EXP__ && __LDBL_MANT_DIG__ > __FLT64_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #if __LDBL_MAX_EXP__ =3D=3D __FLT64_MAX_EXP__ && __LDBL_MANT_DIG__ =3D=3D __FLT64_MANT_DIG__ \ && __DBL_MAX_EXP__ =3D=3D __FLT64_MAX_EXP__ && __DBL_MANT_DIG__ =3D=3D __FLT64_MANT_DIG__ // An extended floating-point type with the same set of values as more than= one // cv-unqualified standard floating-point type has a rank equal to the rank= of // double. // Then long double will have higher rank than float64_t. static_assert (is_same::value); static_assert (is_same::value); #endif #endif #ifdef __STDCPP_FLOAT128_T__ #if __FLT_MAX_EXP__ < __FLT128_MAX_EXP__ && __FLT_MANT_DIG__ < __FLT128_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #if __DBL_MAX_EXP__ < __FLT128_MAX_EXP__ && __DBL_MANT_DIG__ < __FLT128_MANT_DIG__ static_assert (is_same::value); static_assert (is_same::value); #endif #if __LDBL_MAX_EXP__ <=3D __FLT128_MAX_EXP__ && __LDBL_MANT_DIG__ <=3D __FLT128_MANT_DIG__ \ && __LDBL_MANT_DIG__ !=3D 106 // IBM extended long double and IEEE quad= are unordered. static_assert (is_same::value); static_assert (is_same::value); #endif #ifdef __SIZEOF_FLOAT128__ static_assert (is_same::value); static_assert (is_same::value); #endif #endif For e.g. powerpc64le-linux, would be nice to repeat the testcase with -mlong-double-64 -mlong-double-128 -mabi=3Dibmlongdouble -mlong-double-128 -mabi=3Dieeelongdouble options. Also, we should have a mangling testcase, one generic and one for the __float128 target specific mangling etc. and then once [over.ics.rank] is implemented, something to test that.=