Since this is obviously CPU dependent code, I tested it on various platforms. There were failures only on two platforms (see 'FAIL' below); the tests passed on all other platforms.
* Linux/glibc x86_64: Ubuntu 22.04, Fedora 31, Debian 9.6 x86: Ubuntu 22.04, Debian 9.1 x86_64-x32: Ubuntu 22.04 alpha: Debian 5 arm: Arch arm64: CentOS 8 Stream hppa: Debian 12 ia64: RHEL 5 loongarch64: Debian 12 mips64 (big-endian): ABIs 32, 64 mips64 (little-endian): ABIs 32, n32, 64 powerpc64 (big-endian): ABIs 32, 64 powerpc64le: CentOS 7 riscv64: Fedora 28 s390x: ABIs 32, 64 on Debian 8 sparc64: ABIs 32, 64 on Debian 9 * Linux/glibc via QEMU user-mode - alpha - arm, armhf - arm64 - hppa - m68k: FAIL - mips32, mips64 - powerpc, powerpc64, powerpc64-elfv2 - riscv64 - s390x - sh4 - sparc64 * Linux/musl libc x86_64: Alpine 3.18 x86: Alpine 3.18 arm64: Alpine 3.13 powerpc64le: Alpine 3.13 s390x: Alpine 3.13 * macOS arm64: macOS 12.5 * FreeBSD x86_64: FreeBSD 11.0 x86: FreeBSD 11.0 arm: FreeBSD 12.2 arm64: FreeBSD 12.2 sparc64: FreeBSD 12.2 * NetBSD x86_64: NetBSD 8.0 x86: NetBSD 8.0 sparc: NetBSD 7.1 sparc64: ABIs 32, 64 on NetBSD 8.0 * OpenBSD x86_64: OpenBSD 7.2 * AIX powerpc64: ABIs 32, 64 on AIX 7.1, AIX 7.3.1 * Solaris x86_64: ABIs 32, 64 on Solaris 10..., Solaris 11.4 except ABI 64 with cc on Solaris 10: FAIL: test-totalorderl sparc64: ABIs 32, 64 on Solaris 10, Solaris 11.3 * Cygwin x86_64: Cygwin 2.9.0 x86: Cygwin 2.9.0 * Native Windows x86_64: mingw 5, MSVC 14 x86: mingw 5, MSVC 14 * Haiku x86_64: Haiku r1beta4 * Android arm: Android 11 (Termux) Bruno