-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MeowU64From only returns the first 64 bytes of the hash #74
Comments
Are you compiling your code as 32-bit code? It seems there is a bug for 32-bit case - somebody forgot to put meow_hash/meow_hash_x64_aesni.h Line 143 in 5962cb7
|
I compiled via "x64_x86", which I think is 32 bit? I'll try compiling and running it natively, but my compiler seems to be having some trouble right now. |
I compiled and ran it for x64. It works fine when compiled as such. Thank you! |
So actually this problem may be a bit more troublesome, actually. We probably shouldn't have supported 32-bit mode, but I think Jeff wanted it so we did. Nobody is really testing it though :/ Anyway, the problem is that many SIMD instruction sets we want to support cannot do vector extract with a GPR index. So providing a function that takes an index to extract is bad, since in the 32-bit mode, we just compile that as an array access. That would lead someone to think that they could pass a variable here, whereas actually, for any extraction instruction, it has to be a constant. And then when they went to compile in 64-bit mode, they would suddenly get an error. So probably what needs to happen here is we need to move to something like:
The only other alternative I can think of is simply not supporting it, and if you want to extract values, you have to do it yourself. - Casey |
When trying to get the result of a computed hash using MeowU64From, only the first 64 bytes are returned, regardless of the value of the second function argument.
Here's a simple c/c++ program I wrote to demonstrate the issue:
When run, it produces this output:
The U32 parts can be accessed fine, but trying to access the hash as a pair of U64 parts does not work, as it instead only returns the first 64 bytes.
Compiler: Microsoft Visual Studio Community 2019 16.4.5 using Visual C++ 2019
CPU: Intel Core i5-9300H CPU
OS: 64 bit Windows 10
The text was updated successfully, but these errors were encountered: