"""
This dialect contains a representation of the [RISC-V ISA](https://riscv.org/).

It currently models the 32-bit variant of the RISC-V instructions, but will be split
into `rv32` and `rv64` to distinguish between the two variants.
"""

from xdsl.ir import Dialect

# The imports with re-export are to preserve the API of the dialect, as it was when it
# was a single file. They will be deprecated and removed in the future.
from .abstract_ops import (
    AssemblyInstructionArg as AssemblyInstructionArg,
)
from .abstract_ops import (
    RdRsRsFloatOperationWithFastMath as RdRsRsFloatOperationWithFastMath,
)
from .abstract_ops import (
    RdRsRsOperation as RdRsRsOperation,
)
from .abstract_ops import (
    RISCVAsmOperation as RISCVAsmOperation,
)
from .abstract_ops import (
    RISCVCustomFormatOperation as RISCVCustomFormatOperation,
)
from .abstract_ops import (
    RISCVInstruction as RISCVInstruction,
)
from .abstract_ops import (
    RISCVRegallocOperation as RISCVRegallocOperation,
)
from .abstract_ops import (
    RsRsIntegerOperation as RsRsIntegerOperation,
)
from .abstract_ops import (
    print_assembly as print_assembly,
)
from .abstract_ops import (
    riscv_code as riscv_code,
)
from .attrs import (
    SI12 as SI12,
)
from .attrs import (
    UI5 as UI5,
)
from .attrs import FastMathFlagsAttr
from .attrs import (
    parse_immediate_value as parse_immediate_value,
)
from .attrs import (
    print_immediate_value as print_immediate_value,
)
from .attrs import (
    si12 as si12,
)
from .attrs import (
    ui5 as ui5,
)
from .ops import (
    AddiOp,
    AddOp,
    AddUwOp,
    AddwOp,
    AndiOp,
    AndnOp,
    AndOp,
    AssemblySectionOp,
    AuipcOp,
    BclrIOp,
    BclrOp,
    BeqOp,
    BextIOp,
    BextOp,
    BgeOp,
    BgeuOp,
    BinvIOp,
    BinvOp,
    BltOp,
    BltuOp,
    BneOp,
    BsetIOp,
    BsetOp,
    CommentOp,
    CsrrciOp,
    CsrrcOp,
    CsrrsiOp,
    CsrrsOp,
    CsrrwiOp,
    CsrrwOp,
    CustomAssemblyInstructionOp,
    CZeroEqzOp,
    CZeroNezOp,
    DirectiveOp,
    DivOp,
    DivuOp,
    DivuwOp,
    DivwOp,
    EbreakOp,
    EcallOp,
    FAddDOp,
    FAddSOp,
    FClassSOp,
    FCvtDWOp,
    FCvtDWuOp,
    FCvtSWOp,
    FCvtSWuOp,
    FCvtWSOp,
    FCvtWuSOp,
    FDivDOp,
    FDivSOp,
    FeqSOp,
    FLdOp,
    FleSOp,
    FltSOp,
    FLwOp,
    FMAddDOp,
    FMAddSOp,
    FMaxDOp,
    FMaxSOp,
    FMinDOp,
    FMinSOp,
    FMSubDOp,
    FMSubSOp,
    FMulDOp,
    FMulSOp,
    FMvDOp,
    # Floating point
    FMVOp,
    FMvWXOp,
    FMvXWOp,
    FNMAddSOp,
    FNMSubSOp,
    FSdOp,
    FSgnJNSOp,
    FSgnJSOp,
    FSgnJXSOp,
    FSqrtSOp,
    FSubDOp,
    FSubSOp,
    FSwOp,
    GetFloatRegisterOp,
    JalOp,
    JalrOp,
    JOp,
    LabelAttr,
    LabelOp,
    LbOp,
    LbuOp,
    LhOp,
    LhuOp,
    LuiOp,
    LwOp,
    MaxOp,
    MaxUOp,
    MinOp,
    MinUOp,
    MulhOp,
    MulhsuOp,
    MulhuOp,
    MulOp,
    MulwOp,
    MVOp,
    NopOp,
    OriOp,
    OrnOp,
    OrOp,
    ParallelMovOp,
    RemOp,
    RemuOp,
    RemuwOp,
    RemwOp,
    ReturnOp,
    RolOp,
    RolwOp,
    RoriOp,
    RoriwOp,
    RorOp,
    RorwOp,
    SbOp,
    SeqzOp,
    SextBOp,
    SextHOp,
    SextWOp,
    Sh1addOp,
    Sh1addUwOp,
    Sh2addOp,
    Sh2addUwOp,
    Sh3addOp,
    Sh3addUwOp,
    ShOp,
    SlliOp,
    SlliUwOp,
    SllOp,
    SllwOp,
    SltiOp,
    SltiuOp,
    SltOp,
    SltuOp,
    SnezOp,
    SraiOp,
    SraiwOp,
    SraOp,
    SrawOp,
    SrliOp,
    SrliwOp,
    SrlOp,
    SrlwOp,
    SubOp,
    SubwOp,
    SwOp,
    VFAddSOp,
    VFMulSOp,
    WfiOp,
    XnorOp,
    XoriOp,
    XorOp,
    ZextBOp,
    ZextHOp,
    ZextWOp,
)
from .registers import (
    FloatRegisterType,
    IntRegisterType,
)
from .registers import (
    Registers as Registers,
)
from .registers import (
    RISCVRegisterType as RISCVRegisterType,
)
from .registers import (
    is_non_zero as is_non_zero,
)

RISCV = Dialect(
    "riscv",
    [
        AddiOp,
        SltiOp,
        SltiuOp,
        AndiOp,
        OriOp,
        XoriOp,
        SlliOp,
        SrliOp,
        SraiOp,
        LuiOp,
        AuipcOp,
        MVOp,
        SeqzOp,
        SnezOp,
        ZextBOp,
        ZextWOp,
        SextWOp,
        AddOp,
        SltOp,
        SltuOp,
        AndOp,
        OrOp,
        XorOp,
        SllOp,
        SrlOp,
        SubOp,
        SraOp,
        NopOp,
        JalOp,
        JOp,
        JalrOp,
        ReturnOp,
        BeqOp,
        BneOp,
        BltOp,
        BgeOp,
        BltuOp,
        BgeuOp,
        LbOp,
        LbuOp,
        LhOp,
        LhuOp,
        LwOp,
        SbOp,
        ShOp,
        SwOp,
        CsrrwOp,
        CsrrsOp,
        CsrrcOp,
        CsrrwiOp,
        CsrrsiOp,
        CsrrciOp,
        MulOp,
        MulhOp,
        MulhsuOp,
        MulhuOp,
        DivOp,
        DivuOp,
        RemOp,
        RemuOp,
        RolOp,
        RorOp,
        RemuwOp,
        SrliwOp,
        SraiwOp,
        AddwOp,
        SubwOp,
        SllwOp,
        SrlwOp,
        SrawOp,
        RemwOp,
        MulwOp,
        DivwOp,
        DivuwOp,
        CZeroEqzOp,
        CZeroNezOp,
        BclrOp,
        BextOp,
        BinvOp,
        BsetOp,
        RolwOp,
        RorwOp,
        AddUwOp,
        Sh1addOp,
        Sh2addOp,
        Sh3addOp,
        Sh1addUwOp,
        Sh2addUwOp,
        Sh3addUwOp,
        SextBOp,
        SextHOp,
        ZextHOp,
        AndnOp,
        OrnOp,
        XnorOp,
        MaxOp,
        MaxUOp,
        MinOp,
        MinUOp,
        BclrIOp,
        BextIOp,
        BsetIOp,
        BinvIOp,
        RoriOp,
        RoriwOp,
        SlliUwOp,
        EcallOp,
        LabelOp,
        DirectiveOp,
        AssemblySectionOp,
        EbreakOp,
        WfiOp,
        CustomAssemblyInstructionOp,
        CommentOp,
        GetFloatRegisterOp,
        # Floating point
        FMVOp,
        FMAddSOp,
        FMSubSOp,
        FNMSubSOp,
        FNMAddSOp,
        FAddSOp,
        FSubSOp,
        FMulSOp,
        FDivSOp,
        FSqrtSOp,
        FSgnJSOp,
        FSgnJNSOp,
        FSgnJXSOp,
        FMinSOp,
        FMaxSOp,
        FCvtWSOp,
        FCvtWuSOp,
        FMvXWOp,
        FeqSOp,
        FltSOp,
        FleSOp,
        FClassSOp,
        FCvtSWOp,
        FCvtSWuOp,
        FMvWXOp,
        FLwOp,
        FSwOp,
        FMAddDOp,
        FMSubDOp,
        FAddDOp,
        FSubDOp,
        FMulDOp,
        FDivDOp,
        FMinDOp,
        FMaxDOp,
        FCvtDWOp,
        FCvtDWuOp,
        FLdOp,
        FSdOp,
        FMvDOp,
        VFAddSOp,
        VFMulSOp,
        ParallelMovOp,
    ],
    [
        IntRegisterType,
        FloatRegisterType,
        LabelAttr,
        FastMathFlagsAttr,
    ],
)
