Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion src/Nethermind.Int256.Test/UnaryOps.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Numerics;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

namespace Nethermind.Int256.Test
{
Expand All @@ -13,11 +13,17 @@ public static class UnaryOps
2,
3,
short.MaxValue,
ushort.MaxValue - 1,
ushort.MaxValue,
ushort.MaxValue + 1,
int.MaxValue,
uint.MaxValue - 1,
uint.MaxValue,
uint.MaxValue + 1ul,
long.MaxValue,
ulong.MaxValue - 1,
ulong.MaxValue,
BigInteger.Parse("080000000000000008000000000000001", System.Globalization.NumberStyles.HexNumber),
TestNumbers.TwoTo64,
TestNumbers.TwoTo128,
TestNumbers.TwoTo192,
Expand Down
4 changes: 3 additions & 1 deletion src/Nethermind.Int256/UInt256.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,8 @@ private static void SubtractWithBorrow(ulong a, ulong b, ref ulong borrow, out u
[SkipLocalsInit]
public static void Multiply(in UInt256 x, in UInt256 y, out UInt256 res)
{
const bool Axv512Disabled = true;

// If both inputs fit in 64 bits, use a simple multiplication routine.
if ((x.u1 | x.u2 | x.u3 | y.u1 | y.u2 | y.u3) == 0)
{
Expand All @@ -1064,7 +1066,7 @@ public static void Multiply(in UInt256 x, in UInt256 y, out UInt256 res)
return;
}
// Fallback if the required AVX‑512 intrinsics are not supported.
if (!Avx512F.IsSupported || !Avx512DQ.IsSupported)
if (Axv512Disabled || !Avx512F.IsSupported || !Avx512DQ.IsSupported)
{
ref ulong rx = ref Unsafe.As<UInt256, ulong>(ref Unsafe.AsRef(in x));
ref ulong ry = ref Unsafe.As<UInt256, ulong>(ref Unsafe.AsRef(in y));
Expand Down
Loading