Low-level comparison op for floats.
| 1598 | |
| 1599 | @final |
| 1600 | class FloatComparisonOp(RegisterOp): |
| 1601 | """Low-level comparison op for floats.""" |
| 1602 | |
| 1603 | error_kind = ERR_NEVER |
| 1604 | |
| 1605 | EQ: Final = 200 |
| 1606 | NEQ: Final = 201 |
| 1607 | LT: Final = 202 |
| 1608 | GT: Final = 203 |
| 1609 | LE: Final = 204 |
| 1610 | GE: Final = 205 |
| 1611 | |
| 1612 | op_str: Final = {EQ: "==", NEQ: "!=", LT: "<", GT: ">", LE: "<=", GE: ">="} |
| 1613 | |
| 1614 | def __init__(self, lhs: Value, rhs: Value, op: int, line: int = -1) -> None: |
| 1615 | super().__init__(line) |
| 1616 | self.type = bit_rprimitive |
| 1617 | self.lhs = lhs |
| 1618 | self.rhs = rhs |
| 1619 | self.op = op |
| 1620 | |
| 1621 | def sources(self) -> list[Value]: |
| 1622 | return [self.lhs, self.rhs] |
| 1623 | |
| 1624 | def set_sources(self, new: list[Value]) -> None: |
| 1625 | self.lhs, self.rhs = new |
| 1626 | |
| 1627 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 1628 | return visitor.visit_float_comparison_op(self) |
| 1629 | |
| 1630 | |
| 1631 | # We can't have this in the FloatOp class body, because of |
no outgoing calls
no test coverage detected
searching dependent graphs…