Skip to content

Commit

Permalink
dialects: Switch math to properties. (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal authored Dec 18, 2023
1 parent 4d12962 commit 71ea828
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions xdsl/dialects/experimental/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Operand,
irdl_op_definition,
operand_def,
opt_attr_def,
opt_prop_def,
result_def,
)

Expand All @@ -27,7 +27,7 @@ class AbsFOp(IRDLOperation):
"""

name = "math.absf"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -88,7 +88,7 @@ class Atan2Op(IRDLOperation):
"""

name = "math.atan2"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
lhs: Operand = operand_def(AnyFloat)
rhs: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)
Expand Down Expand Up @@ -124,7 +124,7 @@ class AtanOp(IRDLOperation):
"""

name = "math.atan"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -155,7 +155,7 @@ class CbrtOp(IRDLOperation):
"""

name = "math.cbrt"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -187,7 +187,7 @@ class CeilOp(IRDLOperation):
"""

name = "math.ceil"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -220,7 +220,7 @@ class CopySignOp(IRDLOperation):
"""

name = "math.copysign"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
lhs: Operand = operand_def(AnyFloat)
rhs: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)
Expand Down Expand Up @@ -257,7 +257,7 @@ class CosOp(IRDLOperation):
"""

name = "math.cos"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -352,7 +352,7 @@ class ErfOp(IRDLOperation):
"""

name = "math.erf"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -384,7 +384,7 @@ class Exp2Op(IRDLOperation):
"""

name = "math.exp2"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -418,7 +418,7 @@ class ExpM1Op(IRDLOperation):
"""

name = "math.expm1"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -450,7 +450,7 @@ class ExpOp(IRDLOperation):
"""

name = "math.exp"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -490,7 +490,7 @@ class FPowIOp(IRDLOperation):
"""

name = "math.fpowi"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
lhs: Operand = operand_def(AnyFloat)
rhs: Operand = operand_def(IntegerType)
result: OpResult = result_def(AnyFloat)
Expand Down Expand Up @@ -527,7 +527,7 @@ class FloorOp(IRDLOperation):
"""

name = "math.floor"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -564,7 +564,7 @@ class FmaOp(IRDLOperation):
"""

name = "math.fma"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
a: Operand = operand_def(AnyFloat)
b: Operand = operand_def(AnyFloat)
c: Operand = operand_def(AnyFloat)
Expand Down Expand Up @@ -626,7 +626,7 @@ class Log10Op(IRDLOperation):
"""

name = "math.log10"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -657,7 +657,7 @@ class Log1pOp(IRDLOperation):
"""

name = "math.log1p"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -686,7 +686,7 @@ class Log2Op(IRDLOperation):
"""

name = "math.log2"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -715,7 +715,7 @@ class LogOp(IRDLOperation):
"""

name = "math.log"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -747,7 +747,7 @@ class PowFOp(IRDLOperation):
"""

name = "math.powf"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
lhs: Operand = operand_def(AnyFloat)
rhs: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)
Expand Down Expand Up @@ -787,7 +787,7 @@ class RoundEvenOp(IRDLOperation):
"""

name = "math.roundeven"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -822,7 +822,7 @@ class RoundOp(IRDLOperation):
"""

name = "math.round"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -850,7 +850,7 @@ class RsqrtOp(IRDLOperation):
"""

name = "math.rsqrt"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -882,7 +882,7 @@ class SinOp(IRDLOperation):
"""

name = "math.sin"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -910,7 +910,7 @@ class SqrtOp(IRDLOperation):
"""

name = "math.sqrt"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -939,7 +939,7 @@ class TanOp(IRDLOperation):
"""

name = "math.tan"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -968,7 +968,7 @@ class TanhOp(IRDLOperation):
"""

name = "math.tanh"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down Expand Up @@ -1002,7 +1002,7 @@ class TruncOp(IRDLOperation):
"""

name = "math.trunc"
fastmath: FastMathFlagsAttr | None = opt_attr_def(FastMathFlagsAttr)
fastmath: FastMathFlagsAttr | None = opt_prop_def(FastMathFlagsAttr)
operand: Operand = operand_def(AnyFloat)
result: OpResult = result_def(AnyFloat)

Expand Down

0 comments on commit 71ea828

Please sign in to comment.