diff --git a/PerfectNumbers.Core/UInt128Extensions.cs b/PerfectNumbers.Core/UInt128Extensions.cs index 870a87e..7f62518 100644 --- a/PerfectNumbers.Core/UInt128Extensions.cs +++ b/PerfectNumbers.Core/UInt128Extensions.cs @@ -67,6 +67,7 @@ public static class UInt128Extensions [MethodImpl(MethodImplOptions.AggressiveInlining)] public static UInt128 Pow2MontgomeryModWindowed(this UInt128 exponent, UInt128 modulus) { + // TODO: Prototype a UInt128-native Pow2MontgomeryModWindowed path that matches the GPU implementation once a faster modular multiplication helper is available, so we can revisit removing the GPU struct dependency without regressing benchmarks. if (modulus == UInt128.One) { return UInt128.Zero; @@ -139,10 +140,7 @@ public static class UInt128Extensions } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static bool ShouldUseSingleBit(UInt128 exponent) - { - return (exponent >> 64) == UInt128.Zero && (ulong)exponent <= Pow2WindowFallbackThreshold; - } + private static bool ShouldUseSingleBit(UInt128 exponent) => (exponent >> 64) == UInt128.Zero && (ulong)exponent <= Pow2WindowFallbackThreshold; [MethodImpl(MethodImplOptions.AggressiveInlining)] private static int GetWindowSize(int bitLength) diff --git a/todo.txt b/todo.txt index 9586c58..4acde84 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,2 @@ -- Prototype a UInt128-native Pow2MontgomeryModWindowed path that matches the GPU implementation once a faster modular multiplication helper is available, so we can revisit removing the GPU struct dependency without regressing benchmarks. - Mirror the complete CPU heuristic cycle algorithm on the GPU path so both implementations stay aligned. - Extend the GPU numeric type probe to cover proposed custom types such as GpuUInt256 and GpuUInt512 once their definitions are available so we can plan the wide-order heuristics on the device.