
# Autogenerated by mlir-tblgen; don't manually edit.

from enum import IntEnum, auto, IntFlag
from ._ods_common import _cext as _ods_cext
from ..ir import register_attribute_builder
_ods_ir = _ods_cext.ir

class BVCmpPredicate(IntEnum):
    """smt bit-vector comparison predicate"""

    slt = 0
    sle = 1
    sgt = 2
    sge = 3
    ult = 4
    ule = 5
    ugt = 6
    uge = 7

    def __str__(self):
        if self is BVCmpPredicate.slt:
            return "slt"
        if self is BVCmpPredicate.sle:
            return "sle"
        if self is BVCmpPredicate.sgt:
            return "sgt"
        if self is BVCmpPredicate.sge:
            return "sge"
        if self is BVCmpPredicate.ult:
            return "ult"
        if self is BVCmpPredicate.ule:
            return "ule"
        if self is BVCmpPredicate.ugt:
            return "ugt"
        if self is BVCmpPredicate.uge:
            return "uge"
        raise ValueError("Unknown BVCmpPredicate enum entry.")



@register_attribute_builder("BVCmpPredicate", allow_existing=True)
def _bvcmppredicate(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(64, context=context), int(x))

class IntPredicate(IntEnum):
    """smt comparison predicate for integers"""

    lt = 0
    le = 1
    gt = 2
    ge = 3

    def __str__(self):
        if self is IntPredicate.lt:
            return "lt"
        if self is IntPredicate.le:
            return "le"
        if self is IntPredicate.gt:
            return "gt"
        if self is IntPredicate.ge:
            return "ge"
        raise ValueError("Unknown IntPredicate enum entry.")



@register_attribute_builder("IntPredicate", allow_existing=True)
def _intpredicate(x, context):
    return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(64, context=context), int(x))

