nuttx/include
ligd 7fc03e0084 lib: generic optimization for constant divisor on 32-bit machines
64-by-32-bit divisions are prominent in the NuttX, even on 32-bit
machines.  Luckily, many of them use a constant divisor that allows
for a much faster multiplication by the divisor's reciprocal.

The compiler already performs this optimization when compiling a 32-by-32
division with a constant divisor. Unfortunately, on 32-bit machines, gcc
does not optimize 64-by-32 divisions in that case, except for constant
divisors that happen to be a power of 2.

Let's avoid the slow path whenever the divisor is constant by manually
computing the reciprocal ourselves and performing the multiplication
inline.  In most cases, this improves performance of 64-by-32 divisions
by about two orders of magnitude compared to the __div64_32() fallback,
especially on architectures lacking a native div instruction.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-12 18:14:39 +08:00
..
android
arpa
crypto nuttx/crypto: export Diffie-Hellman algorithm 2024-09-09 23:55:33 +08:00
cxx add rint and expm1 function to cmath from libm 2024-07-12 12:05:54 +08:00
net netlib/route: add length for add/del route-func to reduce caller stack usage 2024-08-26 01:54:10 +08:00
netinet Expose IPTOS_xxx to the application layer 2024-09-12 17:15:31 +08:00
netpacket can: Merge netpacket/can.h into nuttx/can.h 2024-08-26 05:05:31 -04:00
nuttx lib: generic optimization for constant divisor on 32-bit machines 2024-09-12 18:14:39 +08:00
ssp
sys usbdev: Add fastboot boardctl 2024-09-10 23:35:58 +08:00
.gitignore
aio.h
alloca.h
assert.h Restore ASSERT/VERIFY semantics 2024-09-09 15:25:04 +08:00
byteswap.h
ctype.h Add basic support for locales in order to C++ streams to build and work for simple cases (POSIX / C locale). 2024-04-29 17:34:10 +08:00
debug.h include/debug.h: fix _alert log level error 2024-08-24 11:20:59 +08:00
dirent.h
dlfcn.h dlfcn: Add stub for dladdr 2024-07-26 14:39:10 -03:00
dsp.h nuttx: resolve various 'FAR' and 'CODE' issues 2024-08-26 10:21:03 +08:00
dspb16.h libdsp: fix gcc14 error and clean up includes 2024-06-02 09:27:36 -03:00
elf32.h
elf64.h
elf.h coredump:support coredump aligned access registers 2024-08-12 02:02:25 +08:00
endian.h
err.h
errno.h
execinfo.h libc/execinfo: extract a common backtrace format function 2024-06-29 22:44:39 +08:00
fcntl.h drivers/pipes: add fcntl(F_SETPIPE_SZ/F_GETPIPE_SZ) support 2024-09-10 11:35:15 +08:00
fixedmath.h
fnmatch.h
ftw.h
getopt.h
glob.h
grp.h
hex2bin.h
iconv.h
ifaddrs.h
inttypes.h libs/libc/inttypes: add support for imaxdiv 2024-04-23 10:26:48 -03:00
iso646.h
langinfo.h
libgen.h
libintl.h
limits.h
locale.h
lzf.h
malloc.h
mqueue.h
netdb.h
nl_types.h
nxflat.h
obstack.h
poll.h
pthread.h pthread/realtime: export interfaces about pthread ceiling priority 2024-09-10 01:26:31 +08:00
pty.h
pwd.h
regex.h
resolv.h
sched.h sched.h: add SCHED_BATCH and SCHED_IDLE definition 2024-07-14 13:20:53 -03:00
search.h hcreate: add alloc/free func hook for user to deallocate memory 2024-08-22 20:25:30 +08:00
semaphore.h semaphore: export priority ceiling interfaces in semaphore 2024-09-10 01:26:31 +08:00
signal.h
spawn.h
stdbool.h nuttx/atomic.h:Fix missing type declarations at compile time 2024-08-22 01:44:29 +08:00
stddef.h
stdint.h
stdio.h
stdlib.h libc: add support for reallocarray 2024-04-17 11:36:39 -03:00
stdnoreturn.h
string.h
strings.h nuttx: resolve various 'FAR' and 'CODE' issues 2024-08-26 10:21:03 +08:00
syscall.h
syslog.h
termios.h
threads.h
time.h libc:Add macro restrictions to code that uses floating point numbers 2024-08-21 13:33:45 +08:00
unistd.h libc/sysconf: add _SC_GETPW_R_SIZE_MAX 2024-08-29 09:05:45 +08:00
utime.h
uuid.h nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
wchar.h include/wchar:Fix mbstate_t Redeclaration in MSVC 2024-08-22 01:44:29 +08:00
wctype.h