]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Define __memcpyable<float*, _Float32*> as true
authorJonathan Wakely <jwakely@redhat.com>
Thu, 24 Oct 2024 10:06:42 +0000 (11:06 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 30 Oct 2024 12:17:10 +0000 (12:17 +0000)
commit30563d8978a39c402a425e958b5b51936ee76cff
treece65f34ee082fa8e72742fd7ee317f46c89658c2
parentbc0eeccf27a084461a2d5661e23468350acb43da
libstdc++: Define __memcpyable<float*, _Float32*> as true

This allows optimizing copying ranges of floating-point types when they
have the same size and representation, e.g. between _Float32 and float
when we know that float uses the same IEEE binary32 format as _Float32.

On some targets double and long double both use IEEE binary64 format so
we could enable memcpy between those types, but we don't have existing
macros to check for that case.

libstdc++-v3/ChangeLog:

* include/bits/cpp_type_traits.h (__memcpyable): Add
specializations for compatible floating-point types.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
libstdc++-v3/include/bits/cpp_type_traits.h