Fix SSE instructions

This commit is contained in:
Oleksandr Melnyk 2022-06-05 19:18:00 +03:00
parent 7eb3f67feb
commit a19b68185e
2 changed files with 6 additions and 6 deletions

View File

@ -96,8 +96,8 @@ namespace Standart.Hash.xxHash
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static unsafe uint128 XXH_mult64to128_bmi2(ulong lhs, ulong rhs)
{
ulong product_high;
ulong product_low = Bmi2.X64.MultiplyNoFlags(lhs, rhs, &product_high);
ulong product_low;
ulong product_high = Bmi2.X64.MultiplyNoFlags(lhs, rhs, &product_low);
uint128 r128;
r128.low64 = product_low;
r128.high64 = product_high;

View File

@ -503,17 +503,17 @@ namespace Standart.Hash.xxHash
{
const int m128i_size = 16;
var seed = Vector128.Create((long) seed64, (long) (0U - seed64));
var seed = Vector128.Create((long)seed64, (long)(0U - seed64));
fixed (byte* secret = &XXH3_SECRET[0])
{
for (int i = 0; i < XXH_SECRET_DEFAULT_SIZE / m128i_size; ++i)
for (int i = 0; i < XXH_SECRET_DEFAULT_SIZE / m128i_size; i++)
{
int uint64_offset = i * 2;
var src16 = Sse2.LoadVector128((long*) secret + uint64_offset);
var src16 = Sse2.LoadVector128(((long*) secret) + uint64_offset);
var dst16 = Sse2.Add(src16, seed);
Sse2.Store((long*) customSecret, dst16);
Sse2.Store((long*) customSecret + uint64_offset, dst16);
}
}