nuttx/include/nuttx
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
..
1wire nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
analog nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
audio nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
binfmt coredump: support coredump save to block device when crash 2023-12-10 07:02:03 -08:00
can can: CAN code optimization 2024-08-23 20:18:17 +08:00
clk clk:fix some issues when use rpmsg clk 2023-09-22 08:47:23 +08:00
contactless
crypto Added NXP SE05x support (secure element) 2023-09-09 15:54:08 +08:00
dma dma: support source/destination address auto step 2023-09-27 00:47:02 +08:00
drivers drivers/mtd/bch: fix size_t overflow when offset > 4GB 2024-09-09 01:23:02 +08:00
eeprom Add MTD for AT25 eeprom 2024-01-04 09:25:52 -08:00
efuse
fs input/ff: support force feedback driver framework 2024-09-10 15:21:42 +08:00
himem xtensa/esp32s3: Add SPIRAM high memory support 2023-11-29 06:33:51 -08:00
hwspinlock hwspinlock: Fix typo error(spin_lock_restore to spin_unlock_irqrestore) 2023-07-25 13:03:31 +02:00
i2c nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
input drivers/input: add dummy force feedback driver 2024-09-10 15:21:42 +08:00
ioexpander greenhills: fix the ioexpander/gpio.h build warning 2024-08-24 20:43:53 +08:00
lcd nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
leds nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
lib lib: generic optimization for constant divisor on 32-bit machines 2024-09-12 18:14:39 +08:00
math math/mpi: add mpi driver in math 2023-10-17 13:43:43 +08:00
mbox
mm mm: add mm_largest api to get the current largest available memory block 2024-08-25 23:09:28 +08:00
modem nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
motor drivers/foc: add support for drv8301 power-stage driver 2023-11-18 17:07:20 -08:00
mtd drivers/mtd/bch: fix size_t overflow when offset > 4GB 2024-09-09 01:23:02 +08:00
net Expose IPTOS_xxx to the application layer 2024-09-12 17:15:31 +08:00
note drivers: add API for drivers early initialization 2024-07-09 16:05:59 +08:00
nx nuttx: resolve various 'FAR' and 'CODE' issues 2024-08-26 10:21:03 +08:00
pci pci/pci_ivshmem: add pci ivshmem driver support 2024-09-10 14:34:31 +08:00
power toolchain/ghs: ioexpander_dev_s "declaration is not visible outside of function" warning 2024-08-27 01:39:37 +08:00
rc
regmap drivers/regmap: add exit function interface. 2024-08-27 21:43:58 +08:00
reset nuttx/atomic.h:replace ALL stdatomic.h with nuttx/stdatomic.h in nuttx/ 2024-08-22 01:44:29 +08:00
rf
rmt drivers/rmt: Implement an upper-half RMT character driver 2023-12-24 16:38:06 -08:00
rpmsg include/rpmsg/rpmsg.h: remove temp define RPMSGIOC_START, RPMSGIOC_STOP, RPMSGIOC_RESET 2024-02-21 12:42:07 +08:00
rptun rptun/rptun_ivshmem: add rptun ivshmem support 2024-09-10 14:34:31 +08:00
segger c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
sensors include/sensors: import public pre-processor definitions types and to uorb.h 2024-09-09 22:40:30 +08:00
serial nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
spi drivers/spi: Add support for FPGA iCE40 bitstream loading. 2024-04-12 10:19:58 -03:00
syslog syslog: add syslog channel filtering function 2023-07-13 01:04:07 +08:00
timers clock: Replace all ts and tick conversion functions 2024-09-12 18:14:39 +08:00
usb usbdev: extend the usb req len to size_t 2024-08-30 01:32:02 +08:00
usrsock
video driver/fb:remove overlay from fb_notify_vsync 2024-08-21 02:57:08 +08:00
virtio drivers/virtio-net: Support VIRTIO_F_ANY_LAYOUT 2024-08-16 21:15:31 +08:00
wireless nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
.gitignore
addrenv.h mm/arch: userspace device mapping support 2024-04-26 12:11:35 +08:00
allsyms.h libc/symtab: Don't include symtab.h in the header files 2023-07-10 23:03:17 +03:00
arch.h sched: add nxsched_get_next_expired() support 2024-09-10 23:32:30 +08:00
ascii.h
atexit.h
atomic.h atomic:support ATOMIC_VAR_INIT in others platform 2024-08-22 01:44:29 +08:00
bits.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
board.h drivers/usbdev: support config pid/vid by soft interface 2024-04-21 23:24:40 +08:00
cache.h armv7/8 cache: add up_get_xcache_size() support 2023-07-15 15:11:07 +08:00
can.h can: Merge netpacket/can.h into nuttx/can.h 2024-08-26 05:05:31 -04:00
cancelpt.h task/pthread_cancelpt: Move cancel point handling to libc, data to TLS 2023-11-15 08:52:04 -08:00
clock.h clock.h: use roundup to handle clock_time2ticks() 2024-09-12 18:14:39 +08:00
compiler.h toolchain/ghs: Fix unknown attribute warnings 2024-08-27 01:39:37 +08:00
coredump.h coredump:coredump_set_memory_region to set memory region 2024-08-12 02:02:25 +08:00
crc8.h
crc16.h
crc32.h
crc64.h
elf.h riscv/arch_elf.c: Handle PCREL_HI20/LO12_I/S relocations correctly 2023-12-12 17:32:36 -08:00
environ.h
envpath.h
ethtool.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
event.h sched/nxevent: add support of kernel event group 2024-08-23 17:00:35 +08:00
fdcheck.h fdcheck: update fdcheck impl 2024-04-11 10:45:44 +08:00
fdt.h nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
gdbstub.h gdbstub:support gdbstub_debugpoint_add/remove smp call 2024-06-24 23:51:43 +08:00
hashtable.h
idr.h idr:New idr_find interface 2024-08-19 11:05:40 -03:00
init.h init: add OSINIT_TASK_READY 2024-09-06 11:25:34 +08:00
instrument.h libc: add instrument api support 2023-12-11 02:06:51 -08:00
ipcc.h
irq.h sched:add parameters to restore_critical_section 2024-09-10 23:14:09 +08:00
kmalloc.h mm: include malloc.h in mm/mm.h 2023-06-11 19:37:04 +03:00
kthread.h
lin.h socketlin : add lin.h and lin bus-type 2024-09-06 17:49:29 +08:00
lirc.h
list.h sched/wdog: Change sq to list 2024-09-10 23:32:30 +08:00
memoryregion.h coredump: support coredump save to block device when crash 2023-12-10 07:02:03 -08:00
mmcsd.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
module.h
mqueue.h greenhills: fix the macro undefined warning 2024-08-24 20:43:53 +08:00
mutex.h nxmutex: export priority ceiling interfaces with nxsem 2024-09-10 01:26:31 +08:00
notifier.h notifier: add BLOCKING_INIT_NOTIFIER_HEAD support 2023-09-19 09:32:17 +08:00
nuttx.h sched: move etc romfs mount from nsh to sched/init 2024-01-09 21:29:46 -03:00
page.h paging: Rename existing CONFIG_PAGING to CONFIG_LEGACY_PAGING 2024-03-05 09:45:49 +08:00
panic_notifier.h assert: add more information to panic notifier 2023-08-03 03:17:22 -07:00
pgalloc.h
progmem.h
pthread.h sched/tls: remove PTHREAD_CLEANUP from Kconfig 2023-06-14 12:00:48 +08:00
queue.h libs/libc/queue: inline queue list to improve performance 2024-09-08 18:13:33 +08:00
random.h
reboot_notifier.h
rwsem.h shced:sem: replace mutex with spinlock 2024-03-19 18:06:12 +08:00
sched_note.h note: delete sched_note_flatten 2023-11-12 23:52:10 -08:00
sched.h smp: enable smp_call in all smp arch 2024-09-06 07:11:38 +09:00
scsi.h
sdio_slave.h Add the module of SDIO Slave 2023-08-22 20:28:24 +08:00
sdio.h nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
semaphore.h semaphore: export priority ceiling interfaces in semaphore 2024-09-10 01:26:31 +08:00
signal.h style: fix multiple style issues and remove unused 2023-09-16 14:17:47 +08:00
spawn.h sched/taskfiles: skip unnecessary file open/close operations to improve performance 2023-11-16 07:30:36 -08:00
spinlock.h spinlock: spin_initialize should add memory barrier 2024-09-05 21:28:52 +08:00
streams.h libc/stream: add file out stream 2023-12-25 16:54:16 -03:00
symtab.h libc/symtab: Move SYMTAB_XXX from unistd/Kconfig to symtab/Kconfig 2023-07-10 13:09:47 -03:00
tee.h Remove @ and % tag from all comments 2023-12-11 17:00:10 -03:00
tls.h sched/tls: drop ta_argv and g_idleargv 2024-06-23 22:24:19 +08:00
trace.h
uorb.h include/sensors: import public pre-processor definitions types and to uorb.h 2024-09-09 22:40:30 +08:00
userspace.h
vt100.h
wdog.h wdog: add API wd_cancel_irq() support 2024-09-10 23:32:30 +08:00
wqueue.h wqueue: add interface work_queue_priority_wq and work_queue_priority 2024-08-30 21:40:55 +08:00
zoneinfo.h