public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 00/14] Optimize integral-related type traits
@ 2024-01-10  9:22 Ken Matsui
  2024-01-10  9:22 ` [PATCH 01/14] c++: Implement __is_integral built-in trait Ken Matsui
                   ` (13 more replies)
  0 siblings, 14 replies; 30+ messages in thread
From: Ken Matsui @ 2024-01-10  9:22 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++, Ken Matsui

This patch series implements __is_integral, __is_floating_point,
__is_arithmetic, __is_unsigned, __is_signed, and __is_scalar built-in
traits and optimizes std::is_integral, std::is_floating_point,
std::is_arithmetic, std::is_unsigned, std::is_signed, std::is_scalar,
std::is_fundamental, and std::is_compound compilation performance.
Here are the benchmark results:

std::is_integral: https://github.com/ken-matsui/gcc-bench/blob/main/is_integral.md#wed-jan-10-112014-am-pst-2024
Time: -28.5606%, Peak Mem: -25.0022%, Total Mem: -22.4503%

std::is_integral_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_integral_v.md#wed-jan-10-112014-am-pst-2024
Time: -44.9068%, Peak Mem: -37.046%, Total Mem: -36.3088%

std::is_floating_point: https://github.com/ken-matsui/gcc-bench/blob/main/is_floating_point.md#wed-jan-10-112014-am-pst-2024
Time: -22.1413%, Peak Mem: -24.9831%, Total Mem: -22.4503%

std::is_floating_point_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_floating_point_v.md#wed-jan-10-112014-am-pst-2024
Time: -44.9223%, Peak Mem: -37.0304%, Total Mem: -36.2869%

std::is_arithmetic: https://github.com/ken-matsui/gcc-bench/blob/main/is_arithmetic.md#wed-jan-10-112014-am-pst-2024
Time: -67.5805%, Peak Mem: -55.3318%, Total Mem: -58.5106%

std::is_arithmetic_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_arithmetic_v.md#wed-jan-10-112014-am-pst-2024
Time: -74.1939%, Peak Mem: -61.3623%, Total Mem: -64.8586%

std::is_fundamental: https://github.com/ken-matsui/gcc-bench/blob/main/is_fundamental.md#wed-jan-10-112014-am-pst-2024
Time: -62.5392%, Peak Mem: -49.5002%, Total Mem: -53.3734%

std::is_fundamental_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_fundamental_v.md#wed-jan-10-112014-am-pst-2024
Time: -56.9926%, Peak Mem: -49.3151%, Total Mem: -53.8913%

std::is_compound: https://github.com/ken-matsui/gcc-bench/blob/main/is_compound.md#wed-jan-10-112014-am-pst-2024
Time: -56.3176%, Peak Mem: -45.7971%, Total Mem: -49.4637%

std::is_compound_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_compound_v.md#wed-jan-10-112014-am-pst-2024
Time: -56.0783%, Peak Mem: -47.7484%, Total Mem: -52.5631%

std::is_unsigned: https://github.com/ken-matsui/gcc-bench/blob/main/is_unsigned.md#wed-jan-10-112014-am-pst-2024
Time: -75.9165%, Peak Mem: -65.632%, Total Mem: -68.8883%

std::is_unsigned_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_unsigned_v.md#wed-jan-10-112014-am-pst-2024
Time: -81.7237%, Peak Mem: -70.1175%, Total Mem: -73.4473%

std::is_signed: https://github.com/ken-matsui/gcc-bench/blob/main/is_signed.md#wed-jan-10-112014-am-pst-2024
Time: -72.8341%, Peak Mem: -61.9239%, Total Mem: -64.5455%

std::is_signed_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_signed_v.md#wed-jan-10-112014-am-pst-2024
Time: -79.9365%, Peak Mem: -66.9684%, Total Mem: -69.8372%

std::is_scalar: https://github.com/ken-matsui/gcc-bench/blob/main/is_scalar.md#wed-jan-10-112014-am-pst-2024
Time: -87.2356%, Peak Mem: -79.0888%, Total Mem: -82.2095%

std::is_scalar_v: https://github.com/ken-matsui/gcc-bench/blob/main/is_scalar_v.md#wed-jan-10-112014-am-pst-2024
Time: -89.5349%, Peak Mem: -83.2528%, Total Mem: -85.6074%

Ken Matsui (14):
  c++: Implement __is_integral built-in trait
  libstdc++: Optimize std::is_integral compilation performance
  c++: Implement __is_floating_point built-in trait
  libstdc++: Optimize std::is_floating_point compilation performance
  c++: Implement __is_arithmetic built-in trait
  libstdc++: Optimize std::is_arithmetic compilation performance
  libstdc++: Optimize std::is_fundamental compilation performance
  libstdc++: Optimize std::is_compound compilation performance
  c++: Implement __is_unsigned built-in trait
  libstdc++: Optimize std::is_unsigned compilation performance
  c++: Implement __is_signed built-in trait
  libstdc++: Optimize std::is_signed compilation performance
  c++: Implement __is_scalar built-in trait
  libstdc++: Optimize std::is_scalar compilation performance

 gcc/cp/constraint.cc                         |  18 ++++
 gcc/cp/cp-trait.def                          |   6 ++
 gcc/cp/semantics.cc                          |  65 +++++++++++-
 gcc/testsuite/g++.dg/ext/has-builtin-1.C     |  18 ++++
 gcc/testsuite/g++.dg/ext/is_arithmetic.C     |  31 ++++++
 gcc/testsuite/g++.dg/ext/is_floating_point.C |  43 ++++++++
 gcc/testsuite/g++.dg/ext/is_integral.C       |  49 +++++++++
 gcc/testsuite/g++.dg/ext/is_scalar.C         |  28 +++++
 gcc/testsuite/g++.dg/ext/is_signed.C         |  45 +++++++++
 gcc/testsuite/g++.dg/ext/is_unsigned.C       |  45 +++++++++
 libstdc++-v3/include/std/type_traits         | 101 ++++++++++++++++++-
 11 files changed, 441 insertions(+), 8 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/ext/is_arithmetic.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_floating_point.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_integral.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_scalar.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_signed.C
 create mode 100644 gcc/testsuite/g++.dg/ext/is_unsigned.C

-- 
2.43.0


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-01-17 11:28 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10  9:22 [PATCH 00/14] Optimize integral-related type traits Ken Matsui
2024-01-10  9:22 ` [PATCH 01/14] c++: Implement __is_integral built-in trait Ken Matsui
2024-01-17  0:30   ` Jason Merrill
2024-01-17  7:42     ` Jonathan Wakely
2024-01-17 11:28       ` Joseph Myers
2024-01-10  9:22 ` [PATCH 02/14] libstdc++: Optimize std::is_integral compilation performance Ken Matsui
2024-01-10 21:19   ` Jonathan Wakely
2024-01-10  9:22 ` [PATCH 03/14] c++: Implement __is_floating_point built-in trait Ken Matsui
2024-01-17  0:36   ` Jason Merrill
2024-01-10  9:22 ` [PATCH 04/14] libstdc++: Optimize std::is_floating_point compilation performance Ken Matsui
2024-01-10 21:20   ` Jonathan Wakely
2024-01-10  9:22 ` [PATCH 05/14] c++: Implement __is_arithmetic built-in trait Ken Matsui
2024-01-10  9:22 ` [PATCH 06/14] libstdc++: Optimize std::is_arithmetic compilation performance Ken Matsui
2024-01-10 21:20   ` Jonathan Wakely
2024-01-10  9:22 ` [PATCH 07/14] libstdc++: Optimize std::is_fundamental " Ken Matsui
2024-01-10  9:22 ` [PATCH 08/14] libstdc++: Optimize std::is_compound " Ken Matsui
2024-01-10 21:21   ` Jonathan Wakely
2024-01-11  3:02     ` Ken Matsui
2024-01-11  4:14       ` [committed] " Ken Matsui
2024-01-10  9:23 ` [PATCH 09/14] c++: Implement __is_unsigned built-in trait Ken Matsui
2024-01-17  0:41   ` Jason Merrill
2024-01-10  9:23 ` [PATCH 10/14] libstdc++: Optimize std::is_unsigned compilation performance Ken Matsui
2024-01-10 21:22   ` Jonathan Wakely
2024-01-10  9:23 ` [PATCH 11/14] c++: Implement __is_signed built-in trait Ken Matsui
2024-01-10  9:23 ` [PATCH 12/14] libstdc++: Optimize std::is_signed compilation performance Ken Matsui
2024-01-10 21:22   ` Jonathan Wakely
2024-01-10  9:23 ` [PATCH 13/14] c++: Implement __is_scalar built-in trait Ken Matsui
2024-01-10 19:59   ` Ken Matsui
2024-01-10  9:23 ` [PATCH 14/14] libstdc++: Optimize std::is_scalar compilation performance Ken Matsui
2024-01-10 21:22   ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).