Lib.RiscV module

MIF08, CAP, CodeGeneration, RiscV API Functions to define instructions.

Lib.RiscV.call(function: Function) Instru3A[source]

Function call.

Lib.RiscV.jump(label: Label) AbsoluteJump[source]

Unconditional jump to label.

Lib.RiscV.conditional_jump(label: Label, op1: RegisterLike, cond: Condition, op2: RegisterLike)[source]

Add a conditional jump to the code. This is a wrapper around bge, bgt, beq, … c is a Condition, like Condition(‘bgt’), Condition(MiniCParser.EQ), …

Lib.RiscV.add(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]
Lib.RiscV.mul(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]
Lib.RiscV.div(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]
Lib.RiscV.rem(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]

REMainder, aka modulo (%).

Lib.RiscV.sub(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]
Lib.RiscV.land(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]

And instruction (cannot be called and due to Python and).

Lib.RiscV.lor(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]

Or instruction (cannot be called or due to Python or).

Lib.RiscV.xor(dr: RegisterLike, sr1: RegisterLike, sr2orimm7: RegisterLike | Immediate) Instru3A[source]
Lib.RiscV.li(dr: RegisterLike, imm7: Immediate) Instru3A[source]
Lib.RiscV.mv(dr: Operand, sr: Operand) Instru3A[source]
Lib.RiscV.ld(dr: Operand, mem: Operand) Instru3A[source]
Lib.RiscV.sd(sr: Operand, mem: Operand) Instru3A[source]