freebsd-dev/sys/conf
Mitchell Horne a89262079e Consistently provide ffs/fls using builtins
Use of compiler builtin ffs/ctz functions will result in optimized
instruction sequences when possible, and fall back to calling a function
provided by the compiler run-time library. We have slowly shifted our
platforms to take advantage of these builtins in 60645781d6 (arm64),
1c76d3a9fb (arm), 9e319462a0 (powerpc, partial).

Some platforms still rely on the libkern implementations of these
functions provided by libkern, namely riscv, powerpc (ffs*, flsll), and
i386 (ffsll and flsll). These routines are slow, as they perform a
linear search for the bit in question. Even on platforms lacking
dedicated bit-search instructions, such as riscv, the compiler library
will provide better-optimized routines, e.g. by using binary search.

Consolidate all definitions of these functions (whether currently using
builtins or not) to libkern.h. This should result in equivalent or
better performing routines in all cases.

One wart in all of this is the existing HAVE_INLINE_F*** macros, which
we use in a few places to conditionally avoid the slow libkern routines.
These aren't easily removed in one commit. For now, provide these
defines unconditionally, but marked for removal after subsequent
cleanup.

Removal of the now unused libkern routines will follow in the next
commit.

Reviewed by:	dougm, imp (previous version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40698
2023-07-06 14:46:41 -03:00
..
config.mk config.mk: All options in DEFAULTS are now defined in opt_global.h 2022-10-24 12:13:04 -06:00
dtb.build.mk dtb: Be much less verbose in the building of dtb 2022-10-29 10:13:54 -06:00
dtb.mk
files zfs: merge openzfs/zfs@feff9dfed 2023-06-10 19:31:17 +02:00
files.amd64 superio+ncthwm: Add hardware monitoring support 2023-07-01 11:19:53 -06:00
files.arm zfs: merge openzfs/zfs@431083f75 2023-04-03 16:49:30 +02:00
files.arm64 arm64: Enable the Hyper-V keyboard driver 2023-06-21 13:17:40 +01:00
files.i386 Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
files.powerpc Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
files.riscv Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
files.x86 ipmi: add Block Transfer interface support 2023-06-07 12:30:47 +03:00
kern.mk sys: Switch the kernel's C standard from C99 to GNU99. 2023-07-01 12:21:13 -07:00
kern.opts.mk kern.opts.mk: rationalize i386 EFI default with src.opts.mk 2023-05-12 11:04:00 -04:00
kern.post.mk kern.post.mk: fix PORTSDIR handling 2023-03-27 13:57:57 +02:00
kern.pre.mk arm64: add KASAN support 2023-03-23 16:34:33 -05:00
kmod_syms_prefix.awk
kmod_syms.awk
kmod.mk sys: Retire OPENZFS_CWARNFLAGS now that it is empty. 2023-03-22 12:35:30 -07:00
kmod.opts.mk
ldscript.amd64
ldscript.arm
ldscript.arm64
ldscript.i386
ldscript.kmod.amd64
ldscript.kmod.i386
ldscript.powerpc
ldscript.powerpc64
ldscript.powerpc64le
ldscript.powerpcspe
ldscript.riscv
Makefile.amd64 Clarify DTR_ENABLED make variable 2023-01-12 11:03:49 -04:00
Makefile.arm
Makefile.arm64 arm64: Use FULLKERNEL instead of .ALLSRC in .bin target 2023-04-18 11:41:57 -04:00
Makefile.i386
Makefile.powerpc
Makefile.riscv riscv: always include frame pointer 2023-01-12 11:04:24 -04:00
newvers.sh newvers: Use correct regexp 2023-04-21 10:24:25 -06:00
NOTES tslog: Optionally instrument pmap_zero_page 2023-06-04 10:16:31 -07:00
options tcp: With the right options in the kernel cc_cubic stays in slowstart always. 2023-06-28 11:18:47 -04:00
options.amd64 x86: Add MPTABLE_LINUX_BUG_COMPAT option 2022-10-17 23:02:22 -07:00
options.arm arm: Remove useless armv6/armv7 options 2022-10-20 10:48:31 -06:00
options.arm64 arm64: emulate swp/swpb instructions 2023-05-15 10:42:10 -05:00
options.i386 x86: Add MPTABLE_LINUX_BUG_COMPAT option 2022-10-17 23:02:22 -07:00
options.powerpc
options.riscv riscv: retire the FPE kernel option 2023-05-02 15:01:31 -03:00
std.nodebug
sysent.mk
systags.sh
vdso_amd64_ia32.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
vdso_amd64.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE retire cp(4) driver 2022-12-13 15:24:52 -05:00