From da89496337b97e6a2aaf1e81d55cf998f6db1070 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 31 Jan 2024 19:17:27 +0100 Subject: Use gcc __builtin_stdc_* builtins in stdbit.h if possible The following patch uses the GCC 14 __builtin_stdc_* builtins in stdbit.h for the type-generic macros, so that when compiled with GCC 14 or later, it supports not just 8/16/32/64-bit unsigned integers, but also 128-bit (if target supports them) and unsigned _BitInt (any supported precision). And so that the macros don't expand arguments multiple times and can be evaluated in constant expressions. The new testcase is gcc's gcc/testsuite/gcc.dg/builtin-stdc-bit-1.c adjusted to test stdbit.h and the type-generic macros in there instead of the builtins and adjusted to use glibc test framework rather than gcc style tests with __builtin_abort (). Signed-off-by: Jakub Jelinek Reviewed-by: Joseph Myers --- NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index ab9bf1b4c9..39a55f5767 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,10 @@ Version 2.40 Major new features: - [Add new features here] +* The header type-generic macros have been changed when using + GCC 14.1 or later to use __builtin_stdc_bit_ceil etc. built-in functions + in order to support unsigned __int128 and/or unsigned _BitInt(N) operands + with arbitrary precisions when supported by the target. Deprecated and removed features, and other changes affecting compatibility: -- cgit 1.4.1