glibc/sysdeps/unix/sysv/linux
Joseph Myers 75ad83f564 Implement C23 pown
C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the pown functions, which are like pow but with an
integer exponent.  That exponent has type long long int in C23; it was
intmax_t in TS 18661-4, and as with other interfaces changed after
their initial appearance in the TS, I don't think we need to support
the original version of the interface.  The test inputs are based on
the subset of test inputs for pow that use integer exponents that fit
in long long.

As the first such template implementation that saves and restores the
rounding mode internally (to avoid possible issues with directed
rounding and intermediate overflows or underflows in the wrong
rounding mode), support also needed to be added for using
SET_RESTORE_ROUND* in such template function implementations.  This
required math-type-macros-float128.h to include <fenv_private.h>, so
it can tell whether SET_RESTORE_ROUNDF128 is defined.  In turn, the
include order with <fenv_private.h> included before <math_private.h>
broke loongarch builds, showing up that
sysdeps/loongarch/math_private.h is really a fenv_private.h file
(maybe implemented internally before the consistent split of those
headers in 2018?) and needed to be renamed to fenv_private.h to avoid
errors with duplicate macro definitions if <math_private.h> is
included after <fenv_private.h>.

The underlying implementation uses __ieee754_pow functions (called
more than once in some cases, where the exponent does not fit in the
floating type).  I expect a custom implementation for a given format,
that only handles integer exponents but handles larger exponents
directly, could be faster and more accurate in some cases.

I encourage searching for worst cases for ulps error for these
implementations (necessarily non-exhaustively, given the size of the
input space).

Tested for x86_64 and x86, and with build-many-glibcs.py.
2025-03-27 10:44:44 +00:00
..
aarch64 Implement C23 pown 2025-03-27 10:44:44 +00:00
alpha Implement C23 pown 2025-03-27 10:44:44 +00:00
arc Implement C23 pown 2025-03-27 10:44:44 +00:00
arm Implement C23 pown 2025-03-27 10:44:44 +00:00
bits Linux: Remove attribute access from sched_getattr (bug 32781) 2025-03-12 10:23:47 +01:00
csky Implement C23 pown 2025-03-27 10:44:44 +00:00
hppa Implement C23 pown 2025-03-27 10:44:44 +00:00
i386 Implement C23 pown 2025-03-27 10:44:44 +00:00
include
loongarch Implement C23 pown 2025-03-27 10:44:44 +00:00
m68k Implement C23 pown 2025-03-27 10:44:44 +00:00
microblaze Implement C23 pown 2025-03-27 10:44:44 +00:00
mips Implement C23 pown 2025-03-27 10:44:44 +00:00
net
netash
netatalk
netax25
neteconet
netinet
netipx
netiucv
netpacket
netrom
netrose
nfs
or1k Implement C23 pown 2025-03-27 10:44:44 +00:00
powerpc Implement C23 pown 2025-03-27 10:44:44 +00:00
riscv Implement C23 pown 2025-03-27 10:44:44 +00:00
s390 Implement C23 pown 2025-03-27 10:44:44 +00:00
scsi
sh Implement C23 pown 2025-03-27 10:44:44 +00:00
sparc Implement C23 pown 2025-03-27 10:44:44 +00:00
sys linux: Fix integer overflow warnings when including <sys/mount.h> [BZ #32708] 2025-03-25 23:55:08 -04:00
wordsize-64
x86
x86_64 Implement C23 pown 2025-03-27 10:44:44 +00:00
Implies
Makefile Linux: Add new test misc/tst-sched_setattr-thread 2025-03-12 10:23:59 +01:00
Versions
_G_config.h
____longjmp_chk.c
_exit.c
a.out.h
accept.c
accept4.c
access.c
adjtime.c
adjtimex.c
aio_misc.h
aio_sigqueue.c
alphasort64.c
arch-fd_to_filename.h
arch-fork.h
bind.c
brk.c
brk_call.h
check_native.c
check_pf.c
chmod.c
chown.c
clock.c
clock_adjtime.c
clock_getcpuclockid.c
clock_getres.c
clock_gettime.c
clock_nanosleep.c
clock_settime.c
clone-internal.c
clone-pidfd-support.c
clone3.c
clone3.h
close.c
close_nocancel.c
closedir.c
closefrom_fallback.c
cmsg_nxthdr.c
cnd_timedwait.c
configure Revert "configure: default to --prefix=/usr on GNU/Linux" 2025-01-08 16:55:05 -05:00
configure.ac Revert "configure: default to --prefix=/usr on GNU/Linux" 2025-01-08 16:55:05 -05:00
connect.c
convert_scm_timestamps.c
copy_file_range.c
creat.c
creat64.c
default-sched.h
device-nrs.h
dirfd.c
dirstream.h
dl-affinity.h
dl-diagnostics-kernel.c
dl-early_allocate.c
dl-execstack.c
dl-execve.h
dl-extra_tls.h Add Linux 'extra TLS' 2025-01-10 20:19:40 +00:00
dl-fxstatat64.c
dl-getcwd.c
dl-openat64.c
dl-opendir.c
dl-origin.c elf: Canonicalize $ORIGIN in an explicit ld.so invocation [BZ 25263] 2025-03-13 16:50:16 -03:00
dl-osinfo.h
dl-parse_auxv.h nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
dl-rseq-symbols.S nptl: add rtld_hidden_proto to __rseq_size and __rseq_offset 2025-01-10 20:19:53 +00:00
dl-sbrk.c
dl-sysdep.c linux: Prefix AT_HWCAP with 0x on LD_SHOW_AUXV 2025-03-05 11:22:09 -03:00
dl-sysdep.h
dl-vdso-setup.c
dl-vdso-setup.h
dl-vdso.h
dl-write.c
dl-writev.h
dup2.c
epoll_create.c
epoll_pwait.c
epoll_pwait2.c
epoll_wait.c
errlist-compat-data.h
errlist-compat.h
errqueue.h
eventfd_read.c
eventfd_write.c
execveat.c
faccessat.c
fallocate.c
fallocate64.c
fanotify_mark.c
fatal-prepare.h
fchmodat.c
fcntl.c
fcntl64.c
fcntl_nocancel.c
fdatasync.c
fdopendir.c
features-time64.h
fexecve.c
filter-nr-syscalls.awk
fixup-asm-unistd.h
fpathconf.c
fstat.c
fstat64.c
fstatat.c
fstatat64.c
fstatfs.c
fstatfs64.c
fstatvfs.c
fstatvfs64.c
fsync.c
ftime.c
ftruncate.c
ftruncate64.c
futimens.c
futimes.c
futimesat.c
fxstat.c
fxstat64.c
fxstatat.c
fxstatat64.c
gai_sigqueue.c
gen-syscall-h.awk
gentempfd.c
getclktck.c
getcpu.c
getcwd.c
getdents.c
getdents64.c
getdirentries.c
getdirentries64.c
getdtsz.c
getentropy.c
gethostid.c
getipv4sourcefilter.c
getitimer.c
getloadavg.c
getlogin.c
getlogin_r.c
getpagesize.c
getpeername.c
getpriority.c
getpt.c
getrandom-internal.h
getrandom.c Linux: Fixes for getrandom fork handling 2025-01-16 19:58:09 +01:00
getrlimit.c
getrlimit64.c
getrusage.c
getsockname.c
getsockopt.c
getsourcefilter.c
getsourcefilter.h
getsysstats.c
gettimeofday.c
glibcsyscalls.py
glob-lstat-compat.c
glob.c
glob64-lstat-compat.c
glob64-time64.c
glob64.c
globfree.c
globfree64-time64.c
globfree64.c
grantpt.c
if_index.c
ifaddrs.c
ifreq.c
inotify_init.c
internal-ioctl.h
internal-signals.h
internal-sigset.h
internal-stat.h
internal_statvfs.c
internal_statvfs.h
ioctl.c
ipc_ops.h
ipc_priv.h
kernel-features.h
kernel-posix-cpu-timers.h
kernel-posix-timers.h
kernel_sigaction.h
kernel_stat.h
kernel_termios.h
kstat_cp.h
lchown.c
ldsodefs.h
libc-vdso.h
libc_fatal.c
libc_sigaction.c
librt-compat.c
link.c
linux_fsinfo.h sysdeps: linux: Add BTRFS_SUPER_MAGIC to pathconf 2025-03-05 15:28:31 -03:00
listen.c
local-setxid.h
lseek.c
lseek64.c
lstat.c
lstat64.c
lutimes.c
lxstat.c
lxstat64.c
machine-sp.h
malloc-hugepages.c
malloc-sysdep.h
mkdir.c
mknodat.c
mlock2.c
mmap.c
mmap64.c
mmap_call.h
mmap_internal.h
mq_close.c
mq_getattr.c
mq_notify.c
mq_open.c
mq_receive.c
mq_send.c
mq_setattr.c
mq_timedreceive.c
mq_timedsend.c
mq_unlink.c
mremap-failure.h
mremap.c
msgctl.c
msgget.c
msgrcv.c
msgsnd.c
msync.c
mtx_timedlock.c
nanosleep.c
netlink_assert_response.c
netlinkaccess.h
not-cancel.h not-cancel.h: Support testing fortify build with Clang 2025-01-03 04:56:48 +08:00
not-errno.h
nscd_setup_thread.c
ntp_gettime.c
ntp_gettimex.c
olddirent.h
oldglob.c
open.c
open64.c
open64_nocancel.c
open_by_handle_at.c
open_nocancel.c
openat.c
openat64.c
openat64_nocancel.c
openat_nocancel.c
opendir.c
pathconf.c sysdeps: linux: Add BTRFS_SUPER_MAGIC to pathconf 2025-03-05 15:28:31 -03:00
pathconf.h
paths.h
pause.c
personality.c
pidfd_getpid.c
pidfd_spawn.c
pidfd_spawnp.c
pipe.c
pkey_get.c
pkey_mprotect.c
pkey_set.c
poll.c
posix_fadvise.c
posix_fadvise64.c
posix_fallocate.c
posix_fallocate64.c
posix_madvise.c
ppoll.c
ppoll_chk.c
pread.c
pread64.c
pread64_nocancel.c
preadv.c
preadv2.c
preadv64.c
preadv64v2.c
prlimit.c
prlimit64.c
process_vm_readv.c
process_vm_writev.c
procutils.c
procutils.h
prof-freq.c
profil-counter.h
profil.c
pselect.c
pselect32.c
ptrace.c
ptsname.c
pwrite.c
pwrite64.c
pwritev.c
pwritev2.c
pwritev64.c
pwritev64v2.c
read.c
read_nocancel.c
readahead.c
readdir.c
readdir64.c
readdir64_r.c
readdir_r.c
readlink.c
readonly-area-fallback.c debug: Improve '%n' fortify detection (BZ 30932) 2025-03-21 15:46:48 -03:00
readv.c
reboot.c
recv.c
recvfrom.c
recvmmsg.c
recvmsg.c
remove.c
rename.c
renameat.c
renameat2.c
rewinddir.c
rmdir.c
rseq-internal.h nptl: clear the whole rseq area before registration 2025-02-21 22:21:25 +00:00
sa_len.c
safe-fatal.h
scandir64.c
sched_getaffinity.c
sched_getattr.c
sched_getcpu.c nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
sched_rr_gi.c
sched_setaffinity.c
sched_setattr.c
seekdir.c
select.c
semctl.c
semget.c
semop.c
semtimedop.c
send.c
sendfile.c
sendfile64.c
sendmmsg.c
sendmsg.c
sendto.c
set-freeres-os.h
setegid.c
seteuid.c
setgid.c
setgroups.c
sethostid.c
setipv4sourcefilter.c
setitimer.c
setregid.c
setresgid.c
setresuid.c
setreuid.c
setrlimit.c
setrlimit64.c
setsockopt.c
setsourcefilter.c
settimeofday.c
settimezone.c
setuid.c
setvmaname.c ld.so: Decorate BSS mappings 2025-01-30 10:16:37 -03:00
setvmaname.h ld.so: Decorate BSS mappings 2025-01-30 10:16:37 -03:00
shlib-versions
shmat.c
shmctl.c
shmdt.c
shmget.c
shutdown.c
siglist-compat.h
signalfd.c
sigpending.c
sigprocmask.c
sigqueue.c
sigreturn.c
sigset-cvt-mask.h
sigsetops.h
sigstack.c
sigsuspend.c
sigtimedwait.c
sigwait.c
sigwaitinfo.c
single-thread.h
sizes.h
socket-constants-time64.h
socket.c
socketcall.h
socketpair.c
spawn_int_def.h
spawnattr_getcgroup_np.c
spawnattr_setcgroup_np.c
spawni.c
speed.c
splice.c
startup.h
stat.c
stat64.c
stat_t64_cp.c
stat_t64_cp.h
statfs.c
statfs64.c
statvfs.c
statvfs64.c
statx.c
statx_cp.c
statx_cp.h
struct_kernel_msqid64_ds.h
struct_kernel_semid64_ds.h
struct_kernel_shmid64_ds.h
struct_stat_time64.h
symlink.c
sync_file_range.c
syscall-names.list Update syscall lists for Linux 6.13 2025-03-12 12:51:54 +00:00
syscall.c
syscall_cancel.c
syscalls.list
sysconf-pthread_stack_min.h
sysconf-sigstksz.h
sysconf.c
sysctl.c
sysdep-cancel.h
sysdep-vdso.h
sysdep.h
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsendbrk.c
tcsetattr.c
tcsetpgrp.c
tee.c
telldir.c
termio.h
test-errno-linux.c
thrd_priv.h
thrd_sleep.c
time-clockid.h
time.c
timer_create.c
timer_delete.c
timer_getoverr.c
timer_gettime.c
timer_routines.c
timer_settime.c
timer_t_was_int_compat.h
timerfd_gettime.c
timerfd_settime.c
times.c
timespec_get.c
timespec_getres.c
tls-internal.c
tls-internal.h
truncate.c
truncate64.c
tst-adjtimex-time64.c
tst-adjtimex.c
tst-affinity-pid.c
tst-affinity-static.c
tst-affinity.c
tst-align-clone-internal.c
tst-align-clone.c
tst-clock_adjtime-time64.c
tst-clock_adjtime.c
tst-clock_gettime-clobber.c
tst-clone.c
tst-clone2-internal.c
tst-clone2.c
tst-clone3-internal.c
tst-clone3.c
tst-epoll-ioctls.c
tst-epoll-time64.c
tst-epoll.c
tst-fallocate-common.c
tst-fallocate.c
tst-fallocate64.c
tst-fanotify.c
tst-fdopendir-o_path.c
tst-getauxval.c
tst-getcwd-smallbuff.c
tst-getdents64.c
tst-getpid1-internal.c
tst-getpid1.c
tst-gettid-kill.c
tst-gettid.c
tst-gettimeofday-clobber.c
tst-glibcsyscalls.py
tst-linux-mremap1.c
tst-memfd_create.c
tst-misalign-clone.c
tst-mlock2.c
tst-mman-consts.py Update kernel version to 6.13 in header constant tests 2025-03-24 15:51:23 +00:00
tst-mount-compile.py
tst-mount-consts.py Update kernel version to 6.13 in header constant tests 2025-03-24 15:51:23 +00:00
tst-mount.c
tst-nolink-libc.c elf: Second ld.so relocation only if libc.so has been loaded 2025-01-07 09:19:01 +01:00
tst-ntp_adjtime-time64.c
tst-ntp_adjtime.c
tst-ntp_gettime-time64.c
tst-ntp_gettime.c
tst-ntp_gettimex-time64.c
tst-ntp_gettimex.c
tst-o_path-locks.c
tst-ofdlocks-compat.c
tst-ofdlocks.c
tst-personality.c
tst-pidfd-consts.py
tst-pidfd.c
tst-pidfd_getpid.c
tst-pkey.c
tst-posix_spawn-setsid-pidfd.c
tst-ppoll-time64.c
tst-ppoll.c
tst-prctl-time64.c
tst-prctl.c
tst-process_madvise.c
tst-process_mrelease.c
tst-quota.c
tst-readdir64-compat.c
tst-rlimit-infinity.c
tst-rseq-disable-static.c nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
tst-rseq-disable.c nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
tst-rseq-nptl-static.c nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
tst-rseq-nptl.c
tst-rseq-static.c nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
tst-rseq-tls-range-4096-static.c Linux: Add tests that check that TLS and rseq area are separate 2025-01-16 20:02:42 +01:00
tst-rseq-tls-range-4096.c Linux: Add tests that check that TLS and rseq area are separate 2025-01-16 20:02:42 +01:00
tst-rseq-tls-range-mod.c Linux: Add tests that check that TLS and rseq area are separate 2025-01-16 20:02:42 +01:00
tst-rseq-tls-range-static.c Linux: Add tests that check that TLS and rseq area are separate 2025-01-16 20:02:42 +01:00
tst-rseq-tls-range.c Linux: Add tests that check that TLS and rseq area are separate 2025-01-16 20:02:42 +01:00
tst-rseq.c nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
tst-rseq.h nptl: Move the rseq area to the 'extra TLS' block 2025-01-10 20:20:27 +00:00
tst-sched-affinity-inheritance.c affinity-inheritance: Overallocate CPU sets 2025-01-14 09:23:36 -05:00
tst-sched-consts.py Update kernel version to 6.13 in header constant tests 2025-03-24 15:51:23 +00:00
tst-sched_setattr-thread.c Linux: Add new test misc/tst-sched_setattr-thread 2025-03-12 10:23:59 +01:00
tst-sched_setattr.c Linux: Do not check unused bytes after sched_getattr in tst-sched_setattr 2025-01-20 15:20:57 +01:00
tst-scm_rights-time64.c
tst-scm_rights.c
tst-sem_getvalue-affinity.c
tst-sigcontext-get_pc.c
tst-signal-numbers.py
tst-sigtimedwait-time64.c
tst-sigtimedwait.c
tst-skeleton-affinity.c nptl: extend test coverage for sched_yield 2025-03-07 17:50:44 -05:00
tst-skeleton-thread-affinity.c nptl: extend test coverage for sched_yield 2025-03-07 17:50:44 -05:00
tst-socket-consts.py
tst-socket-timestamp-compat-time64.c
tst-socket-timestamp-compat.c
tst-socket-timestamp-time64.c
tst-socket-timestamp.c
tst-spawn-cgroup.c
tst-spawn-chdir-pidfd.c
tst-spawn-pidfd.c
tst-spawn-pidfd.h
tst-spawn2-pidfd.c
tst-spawn3-pidfd.c
tst-spawn4-pidfd.c
tst-spawn5-pidfd.c
tst-spawn6-pidfd.c
tst-spawn7-pidfd.c
tst-sync_file_range.c
tst-syscall-list.sh
tst-syscall-restart.c
tst-sysconf-iov_max-uapi.c
tst-sysconf-iov_max.c
tst-sysvmsg-linux.c
tst-sysvsem-linux.c
tst-sysvshm-linux.c
tst-tgkill.c
tst-time-clobber.c
tst-timerfd-time64.c
tst-timerfd.c
tst-ttyname-common.c
tst-ttyname-direct.c
tst-ttyname-namespace.c
ttyname.c
ttyname.h
ttyname_r.c
tv32-compat.h
ualarm.c
umount.c
umount2.c
unlink.c
unlockpt.c
update-syscall-lists.py
updwtmp.c
ustat.c
utime.c
utimensat.c
utimes.c
utmp_file.c
versionsort64.c
vfork.c
vmsplice.c
wait3.c
wait4.c
waitid.c
write.c
write_nocancel.c
writev.c
xmknod.c
xmknodat.c
xstat.c
xstat64.c
xstatconv.c
xstatconv.h
xstatover.h
xstatver.h