[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#70898: switching to <stdbit.h> for Emacs bit ops
From: |
Paul Eggert |
Subject: |
bug#70898: switching to <stdbit.h> for Emacs bit ops |
Date: |
Sun, 12 May 2024 15:09:17 -0700 |
User-agent: |
Mozilla Thunderbird |
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
Description: Text Data
0002-Simplify-32-bit-Android-bit-fiddling.patch
Description: Text Data
- bug#70898: switching to <stdbit.h> for Emacs bit ops,
Paul Eggert <=