Rename GPU mul-mod helper
This commit is contained in:
1 parent
4b13bc6497
commit
04d4d18f37
6 files changed
+24
-65
No files matched your search
@@ -900,23 +900,6 @@ public struct GpuUInt128 : IComparable<GpuUInt128>, IEquatable<GpuUInt128>
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly ulong MulMod(ulong value, ulong modulus)
|
||||
{
|
||||
ulong a = Low % modulus;
|
||||
ulong b = value % modulus;
|
||||
|
||||
if (a == 0UL || b == 0UL)
|
||||
{
|
||||
return 0UL;
|
||||
}
|
||||
|
||||
ulong ulongRange = ulong.MaxValue / a;
|
||||
return b <= ulongRange
|
||||
? (a * b) % modulus
|
||||
: MulMod64(a, b, modulus);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly ulong MulModSimplified(ulong value, ulong modulus)
|
||||
{
|
||||
ulong modulusLocal = modulus;
|
||||
ulong a = Low % modulusLocal;
|
||||
|
||||
Reference in new issue
Block a user