GNU bug report logs -
#70898
switching to <stdbit.h> for Emacs bit ops
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Sun, 12 May 2024 22:10:01 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Emacs currently uses the Gnulib headers count-trailing-zeros.h and
count-one-bits.h to do some low-level bit operations efficiently. C23
has standardized this in a new header <stdbit.h> and I've recently added
support for a Gnulib <stdbit.h> substitute, taking implementation ideas
from count-trailing-zeros.h, count-one-bits.h and elsewhere. So I'm
planning to switch Emacs to the C23 standard way of doing things, using
the Gnulib substitute on non-C23 platforms.
The first attached patch does this. I plan to test this somewhat more
before installing, but thought I'd give people a heads-up.
The second attached patch is a minor cleanup to the 32-bit Android code,
a cleanup made possible by the first attached patch. This cleanup patch
is optional of course. By the way, I'm surprised to see the code in
sfmt.c implementing 64-bit arithmetic from pairs of 32-bit words, as I
thought even ancient 32-bit Android has 64-bit 'unsigned long long', but
that's a matter for the Android experts I suppose.
[0001-Prefer-stdbit.h-to-count-one-bits.h-etc.patch (text/x-patch, attachment)]
[0002-Simplify-32-bit-Android-bit-fiddling.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 2 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.