mirror_zfs/module/zcommon
Shengqi Chen 0ae4460c61 zcommon: add specialized versions of cityhash4
Specializing cityhash4 on 32-bit architectures can reduce the size
of stack frames as well as instruction count. This is a tiny but
useful optimization, since some callers invoke it frequently.

When specializing into 1/2/3/4-arg versions, the stack usage
(in bytes) on some 32-bit arches are listed as follows:

- x86: 32, 32, 32, 40
- arm-v7a: 20, 20, 28, 36
- riscv: 0, 0, 0, 16
- power: 16, 16, 16, 32
- mipsel: 8, 8, 8, 24

And each actual argument (even if passing 0) contributes evenly
to the number of multiplication instructions generated:

- x86: 9, 12, 15 ,18
- arm-v7a: 6, 8, 10, 12
- riscv / power: 12, 18, 20, 24
- mipsel: 9, 12, 15, 19

On 64-bit architectures, the tendencies are similar. But both stack
sizes and instruction counts are significantly smaller thus negligible.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
Closes #16131
Closes #16483
2024-09-19 15:18:59 -07:00
..
cityhash.c zcommon: add specialized versions of cityhash4 2024-09-19 15:18:59 -07:00
zfeature_common.c ddt: add FDT feature and support for legacy and new on-disk formats 2024-08-16 11:58:59 -07:00
zfs_comutil.c nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
zfs_deleg.c nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
zfs_fletcher_aarch64_neon.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_avx512.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_intel.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_sse.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_superscalar4.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher_superscalar.c Drop lying to the compiler in the fletcher4 code 2023-03-24 10:29:19 -07:00
zfs_fletcher.c Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-10 08:47:21 -07:00
zfs_namecheck.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zfs_prop.c Adding Direct IO Support 2024-09-14 13:47:59 -07:00
zfs_valstr.c Adding Direct IO Support 2024-09-14 13:47:59 -07:00
zpool_prop.c ddt: add support for prefetching tables into the ARC 2024-07-26 09:16:18 -07:00
zprop_common.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00