working on rewriting compiler ir to fix reg alloc issues
[bigint-presentation-code.git] / src / bigint_presentation_code / toom_cook.py
index 9e3ec74e8842431bb0c3df895c8053e5b51bbd28..246f65454a861be15fbfb00954f9f9a37dac4899 100644 (file)
@@ -4,13 +4,16 @@ Toom-Cook multiplication algorithm generator for SVP64
 from abc import abstractmethod
 from enum import Enum
 from fractions import Fraction
-from typing import Any, Generic, Iterable, Mapping, Sequence, TypeVar, Union
+from typing import Any, Generic, Iterable, Mapping, TypeVar, Union
 
 from nmutil.plain_data import plain_data
 
-from bigint_presentation_code.compiler_ir import Fn, Op, OpBigIntAddSub, OpBigIntMulDiv, OpConcat, OpLI, OpSetCA, OpSetVLImm, OpSplit, SSAGPRRange
+from bigint_presentation_code.compiler_ir import (Fn, OpBigIntAddSub,
+                                                  OpBigIntMulDiv, OpConcat,
+                                                  OpLI, OpSetCA, OpSetVLImm,
+                                                  OpSplit, SSAGPRRange)
 from bigint_presentation_code.matrix import Matrix
-from bigint_presentation_code.util import Literal, OSet, final
+from bigint_presentation_code.type_util import Literal, final
 
 
 @final
@@ -158,8 +161,8 @@ class EvalOpPoly:
         return f"EvalOpPoly({self.coefficients})"
 
 
-_EvalOpLHS = TypeVar("_EvalOpLHS", int, "EvalOp")
-_EvalOpRHS = TypeVar("_EvalOpRHS", int, "EvalOp")
+_EvalOpLHS = TypeVar("_EvalOpLHS", int, "EvalOp[Any, Any]")
+_EvalOpRHS = TypeVar("_EvalOpRHS", int, "EvalOp[Any, Any]")
 
 
 @plain_data(frozen=True, unsafe_hash=True)
@@ -238,7 +241,7 @@ class EvalOpInput(EvalOp[int, Literal[0]]):
     __slots__ = ()
 
     def __init__(self, lhs, rhs=0):
-        # type: (...) -> None
+        # type: (int, int) -> None
         if lhs < 0:
             raise ValueError("Input part_index (lhs) must be >= 0")
         if rhs != 0: