aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorSchrodinger ZHU Yifan <yifanzhu@rochester.edu>2023-11-28 21:02:25 -0500
committerGitHub <noreply@github.com>2023-11-28 21:02:25 -0500
commit81e3e7e5d455f85e070a27763c578df493716ae9 (patch)
tree87eb787a2b2faa4fa574dad1f1382861c6828fd3 /clang/lib/CodeGen/CodeGenModule.cpp
parentf7247d50414df36d6aa47a0aa225fda9f6708d91 (diff)
downloadllvm-81e3e7e5d455f85e070a27763c578df493716ae9.zip
llvm-81e3e7e5d455f85e070a27763c578df493716ae9.tar.gz
llvm-81e3e7e5d455f85e070a27763c578df493716ae9.tar.bz2
[libc] [search] implement hcreate(_r)/hsearch(_r)/hdestroy(_r) (#73469)
This patch implements `hcreate(_r)/hsearch(_r)/hdestroy(_r)` as specified in https://man7.org/linux/man-pages/man3/hsearch.3.html. Notice that `neon/asimd` extension is not yet added in this patch. - The implementation is largely simplified from rust's [`hashbrown`](https://github.com/rust-lang/hashbrown/blob/master/src/raw/mod.rs) as we only consider fix-sized insertion-only hashtables. Technical details are provided in code comments. - This patch also contains a portable string hash function, which is derived from [`aHash`](https://github.com/tkaitchuck/aHash)'s fallback routine. Not using any SIMD acceleration, it has a good enough quality (passing all SMHasher tests) and is not too bad in speed. - Some general functionalities are added, such as `memory_size`, `offset_to`(alignment), `next_power_of_two`, `is_power_of_two`. `ctz/clz` are extended to support shorter integers.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions