Fix SSE instructions
This commit is contained in:
parent
7eb3f67feb
commit
a19b68185e
@ -96,8 +96,8 @@ namespace Standart.Hash.xxHash
|
|||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private static unsafe uint128 XXH_mult64to128_bmi2(ulong lhs, ulong rhs)
|
private static unsafe uint128 XXH_mult64to128_bmi2(ulong lhs, ulong rhs)
|
||||||
{
|
{
|
||||||
ulong product_high;
|
ulong product_low;
|
||||||
ulong product_low = Bmi2.X64.MultiplyNoFlags(lhs, rhs, &product_high);
|
ulong product_high = Bmi2.X64.MultiplyNoFlags(lhs, rhs, &product_low);
|
||||||
uint128 r128;
|
uint128 r128;
|
||||||
r128.low64 = product_low;
|
r128.low64 = product_low;
|
||||||
r128.high64 = product_high;
|
r128.high64 = product_high;
|
||||||
|
|||||||
@ -503,17 +503,17 @@ namespace Standart.Hash.xxHash
|
|||||||
{
|
{
|
||||||
const int m128i_size = 16;
|
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])
|
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;
|
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);
|
var dst16 = Sse2.Add(src16, seed);
|
||||||
Sse2.Store((long*) customSecret, dst16);
|
Sse2.Store((long*) customSecret + uint64_offset, dst16);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user