Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
6df2ffc
Checkpoint dn_simdhash
kg Mar 27, 2024
2f41984
Checkpoint
kg Mar 27, 2024
059705b
Checkpoint
kg Mar 27, 2024
0017d53
Checkpoint
kg Mar 28, 2024
2cc6a91
Checkpoint
kg Mar 28, 2024
6cf488d
Checkpoint
kg Mar 28, 2024
368c076
Checkpoint
kg Mar 28, 2024
ebc7b97
Checkpoint
kg Mar 28, 2024
335b32e
Checkpoint
kg Mar 28, 2024
12487c8
Checkpoint
kg Mar 28, 2024
9bfc7b6
Add missing files
kg Mar 28, 2024
5b8fec5
Checkpoint
kg Mar 28, 2024
5408f27
Add missing header
kg Mar 28, 2024
8cbf1db
Cleanups and more comments
kg Mar 28, 2024
a3d8622
Checkpoint
kg Mar 28, 2024
53ef795
Fix insertion
kg Mar 28, 2024
0d57f12
Remove generic add and get, they complicate everything for no reason
kg Mar 28, 2024
4a194da
Build fix
kg Mar 28, 2024
e6e29ef
Build fixes
kg Mar 28, 2024
406614b
Cleanup
kg Mar 28, 2024
9c1ed15
When cascading, wrap around to the first bucket when we reach the end…
kg Mar 28, 2024
69cd351
Simplify declaring specializations
kg Mar 28, 2024
58045c1
Cleanup
kg Mar 28, 2024
f354798
Convert spaces to tabs
kg Mar 28, 2024
4fa00c8
Rearrange things so that find_first_matching_suffix gets inlined
kg Mar 28, 2024
48faef8
Basic removal implementation
kg Mar 28, 2024
ab63d5f
Expand tests
kg Mar 28, 2024
ee87e52
Build fixes
kg Mar 28, 2024
bcf8be0
Cleanup
kg Mar 28, 2024
f9db166
MSVC doesn't support warning preprocessor command so use pragma message
kg Mar 28, 2024
8c3efe5
Fix build
kg Mar 28, 2024
ece1efe
Fix build
kg Mar 28, 2024
65862c1
Fix linker problem by defining string comparison and hasher inline
kg Mar 28, 2024
0aaffc2
Match semantics of ghashtable better
kg Mar 28, 2024
24cf824
Checkpoint
kg Mar 28, 2024
5a1af2e
dn_allocator allocations aren't zeroed :)
kg Mar 28, 2024
ff3678a
Cleanup
kg Mar 28, 2024
66b8a19
Use dn_simdhash_string_ptr for namespace lookup cache
kg Mar 28, 2024
9f15f25
Fix build
kg Mar 28, 2024
5011da6
Allow hiding the default specializations of a simdhash so you can wra…
kg Mar 28, 2024
0eb125e
Cache the hashcode of keys in string_ptr since it makes natural cache…
kg Mar 28, 2024
fde9544
Rearrange things to fix C4505
kg Mar 28, 2024
4949c53
Prohibit declaring multiple specializations in one .c file since it w…
kg Mar 28, 2024
c5ce9b2
Maybe fix duplicate include
kg Mar 28, 2024
f99f2cc
Fix use of base foreach for string_ptr hashtable
kg Mar 28, 2024
c848322
Annotate fallthrough in murmurhash for clang
kg Mar 28, 2024
c1a8001
Manually unroll the murmurhash3 duff's device to satisfy clang
kg Mar 28, 2024
d4031a1
Oops
kg Mar 28, 2024
b00cd4a
Fix leaked dn_simdhash_t instance
kg Mar 28, 2024
24d4b84
Cleanup
kg Mar 28, 2024
df8d8f4
Fix truncation warning with 64-bit strlen
kg Mar 29, 2024
e13f48e
Workaround linux x64 linker problem
kg Mar 29, 2024
cb2eb95
Fix GCC build parse error
kg Mar 29, 2024
ef9a132
Cleanup & rearrange things; attempt to fix GCC build
kg Mar 29, 2024
5923050
Updates so test suite works again; verified on linux x64 gcc
kg Mar 29, 2024
099a953
Fix indentation
kg Mar 29, 2024
d6f2bb7
Cleanup
kg Mar 29, 2024
6504f19
Fix foreaches
kg Mar 29, 2024
a47fea2
Split architecture-specific stuff into its own header
kg Mar 29, 2024
8fb0a5a
Specializing foreach means key_is_pointer/value_is_pointer aren't needed
kg Mar 29, 2024
e86c5c4
Cleanup
kg Mar 29, 2024
7b2c15d
Simplify preprocessor token gluing
kg Mar 29, 2024
c22b3d7
Cleanup and improve comments
kg Mar 29, 2024
9708bfa
Align the address of the first bucket
kg Mar 29, 2024
e11fa7d
Comment out neon for now
kg Mar 29, 2024
5525995
Cleanup
kg Mar 29, 2024
3f84231
Alignment and arch-specific pointer size fixes
kg Mar 29, 2024
441079a
Fix ARM clang/gcc build
kg Mar 29, 2024
480432f
Maybe fix CI-specific build issue
kg Mar 29, 2024
ffbfd0f
MSVC docs were wrong :(
kg Mar 29, 2024
1ca0206
Cleanup
kg Mar 29, 2024
4685237
Silence MSVC warnings again
kg Mar 29, 2024
6548031
Rework string_ptr to avoid pre-computing string length, and use a str…
kg Mar 30, 2024
14155c8
Cleanup
kg Mar 30, 2024
dbad5d6
Add dn_simdhash_u32_ptr and use it in mono_image_init_name_cache
kg Mar 30, 2024
6ffe793
Add missing file
kg Mar 30, 2024
c3ea833
Fix type mismatch
kg Apr 1, 2024
4169252
No need to eagerly load the suffixes, and doing so makes scalar fallb…
kg Apr 2, 2024
338b23c
Optimize scalar fallback
kg Apr 2, 2024
f17bd49
Migrate all simdhash fixes and changes from simdhash-2 into simdhash …
kg Apr 3, 2024
d62c7c2
Enable ARM NEON support in simdhash since we have system headers now
kg Apr 4, 2024
31eb0ba
Update utils header from successor branch
kg Apr 8, 2024
4d0150f
Dedupe + improve 64-bit pointer hash
kg Apr 8, 2024
18806f3
Fix windows build
kg Apr 8, 2024
27ac09f
Address PR feedback
kg Apr 10, 2024
39747d0
Broken attempt at configurable assertions
kg Apr 11, 2024
c11823d
Migrate updates from simdhash-2 to simdhash-1
kg Apr 11, 2024
e08be1b
Refactor search vectors
kg Apr 11, 2024
391a5d8
Update assertions
kg Apr 11, 2024
0a1936e
Optimize out unaligned 16-byte copy in scalar wasm find_value
kg Apr 11, 2024
e388a1d
Workaround for weird msimd128 codegen
kg Apr 11, 2024
b4d07d7
Update comments
kg Apr 11, 2024
703a607
Simplify assertions
kg Apr 12, 2024
73c505d
Benchmark harness
kg Apr 12, 2024
97a3b25
Checkpoint
kg Apr 12, 2024
391fdeb
Checkpoint
kg Apr 12, 2024
ae69695
Better missing key measurement
kg Apr 12, 2024
f543c20
Fix sequential/random measurements being meaningfully different
kg Apr 12, 2024
07c398b
Adjustment based on benchmarking
kg Apr 12, 2024
44a7bd3
Add a baseline measurement
kg Apr 12, 2024
9572863
Basic ghashtable comparison measurements
kg Apr 12, 2024
bf03cca
Update makefile
kg Apr 12, 2024
57e6aa2
Check in missing changes; fix mono link error
kg Apr 12, 2024
9107045
Add missing license headers
kg Apr 12, 2024
3d066cc
Partially unroll scalar search for better wasm performance
kg Apr 12, 2024
06efeeb
Fully unroll
kg Apr 13, 2024
8d798f8
Cleanup whitespace / add comment
kg Apr 13, 2024
253d920
Only type-check simdhash instances in debug builds
kg Apr 13, 2024
d90828a
Update makefile switches
kg Apr 13, 2024
5f49036
Fix and add comments
kg Apr 15, 2024
1f2b89f
Make test support windows
kg Apr 15, 2024
5083f40
Make it possible to build benchmark suite using MSVC
kg Apr 15, 2024
af63c5c
Improve MSVC codegen
kg Apr 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify assertions
Optimize x64 codegen for bucket scans
  • Loading branch information
kg committed Apr 15, 2024
commit 703a607890a498c084ca8cf63a40963cf554c402
2 changes: 0 additions & 2 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@
<_MonoCMakeArgs Include="-DGC_SUSPEND=$(MonoThreadSuspend)" />
<_MonoCMakeArgs Include="-DMONO_LIB_NAME=$(MonoLibName)" />
<_MonoCMakeArgs Include="-DMONO_SHARED_LIB_NAME=$(MonoSharedLibName)" />

<_MonoCFLAGS Include="-DDN_SIMDHASH_USE_MONO_ASSERTION_MESSAGE=1" />
</ItemGroup>

<ItemGroup Condition="'$(HostOS)' == 'Linux' and '$(MonoEnableLLVM)' == 'true' and '$(TargetArchitecture)' != 'wasm' and '$(MonoUseLibCxx)' == 'true'">
Expand Down
13 changes: 6 additions & 7 deletions src/native/containers/dn-simdhash-specialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,13 @@ address_of_value (dn_simdhash_buffers_t buffers, uint32_t value_slot_index)
static DN_FORCEINLINE(int)
DN_SIMDHASH_SCAN_BUCKET_INTERNAL (DN_SIMDHASH_T_PTR hash, bucket_t *bucket, DN_SIMDHASH_KEY_T needle, dn_simdhash_search_vector search_vector)
{
#ifdef DN_SIMDHASH_USE_SCALAR_FALLBACK
// An eager load in scalar mode just does two 8-byte copies from the keys table to the stack.
// There's no point in doing it.
#define bucket_suffixes (bucket->suffixes)
#else
// Performing an up-front load of the vector here enables clang to use extract_lane_u
// to load the count on WASM instead of doing a separate load8_u operation from memory
#if defined(__wasm_simd128__)
// Perform an eager load of the vector on wasm
dn_simdhash_suffixes bucket_suffixes = bucket->suffixes;
#else
// Load through the pointer instead; if we eager load the vector on x64 clang,
// it does lane extraction via pshufd and stuff - the code is truly heinous
#define bucket_suffixes (bucket->suffixes)
#endif
uint8_t count = dn_simdhash_extract_lane(bucket_suffixes, DN_SIMDHASH_COUNT_SLOT),
overflow_count = dn_simdhash_extract_lane(bucket_suffixes, DN_SIMDHASH_CASCADED_SLOT);
Expand Down
16 changes: 0 additions & 16 deletions src/native/containers/dn-simdhash-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,9 @@ MurmurHash3_32_streaming (const uint8_t *key, uint32_t seed)

// end of reformulated murmur3-32


#if DN_SIMDHASH_USE_MONO_ASSERTION_MESSAGE

void
mono_assertion_message (const char *file, int line, const char *condition);

static inline void
dn_simdhash_assert_fail (const char *file, int line, const char *condition)
{
return mono_assertion_message(file, line, condition);
}

#else

void
dn_simdhash_assert_fail (const char *file, int line, const char *condition);

#endif

#define dn_simdhash_assert(expr) \
if (DN_UNLIKELY(!(expr))) { \
dn_simdhash_assert_fail(__FILE__, __LINE__, #expr); \
Expand Down