From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7FF5C3858C54; Tue, 22 Nov 2022 13:06:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FF5C3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669122400; bh=1kqvPKZ5HJU2Goo3Fq5f4CtsXrsA7o4/wCEczMioUyc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UckYzg2929BENnvPUDz1Q5nLFH+0ZBHl0qYZRZq3eLzaMuPUf1J8gleHqvK+UG2zL Qt8CrwtaTidExSjnM/RiWAQ7508P4lPiiAekGWwEwoohBcHZ1qyVg+CiB6vFaIr+KY W19wZ2TzLcTzvkafeSFLrakhSioA2ewJDM+PhAu4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared Date: Tue, 22 Nov 2022 13:06:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: build 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: cc 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=3D107811 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- Oops. Does: 2022-11-22 Jakub Jelinek PR libstdc++/107811 * src/c++17/floating_from_chars.cc (__floating_from_chars_hex): Gua= rd fast_float uses with #if USE_LIB_FAST_FLOAT and for mantissa_bits a= nd exponent_bits provide a fallback. --- libstdc++-v3/src/c++17/floating_from_chars.cc.jj 2022-11-08 09:54:37.533397224 +0100 +++ libstdc++-v3/src/c++17/floating_from_chars.cc 2022-11-22 14:03:10.365474110 +0100 @@ -783,11 +783,16 @@ namespace using uint_t =3D conditional_t, uint32_t, conditional_t, uint64= _t, uint16_t>>; +#if USE_LIB_FAST_FLOAT constexpr int mantissa_bits =3D fast_float::binary_format::mantissa_explicit_bits(); constexpr int exponent_bits =3D is_same_v ? 11 : is_same_v ? 5 : 8; +#else + constexpr int mantissa_bits =3D is_same_v ? 23 : 52; + constexpr int exponent_bits =3D is_same_v ? 8 : 11; +#endif constexpr int exponent_bias =3D (1 << (exponent_bits - 1)) - 1; __glibcxx_requires_valid_range(first, last); @@ -945,8 +950,11 @@ namespace else if (mantissa_idx >=3D -4) { if constexpr (is_same_v +#if USE_LIB_FAST_FLOAT || is_same_v) + fast_float::floating_type_bfloat16_t> +#endif + ) { __glibcxx_assert(mantissa_idx =3D=3D -1); mantissa |=3D hexit >> 1; @@ -1130,6 +1138,7 @@ namespace } if constexpr (is_same_v || is_same_v) memcpy(&value, &result, sizeof(result)); +#if USE_LIB_FAST_FLOAT else if constexpr (is_same_v) { uint32_t res =3D uint32_t{result} << 16; @@ -1156,6 +1165,7 @@ namespace | ((uint32_t{result} & 0x8000) << 16)); memcpy(value.x, &res, sizeof(res)); } +#endif return {first, errc{}}; } fix that?=