Implementing cfg for risc

This commit is contained in:
elvis
2024-11-27 20:18:30 +01:00
parent 4e9f08347b
commit 99287d79c5
8 changed files with 554 additions and 37 deletions

53
lib/miniImp/CfgRISC.mli Normal file
View File

@ -0,0 +1,53 @@
module RISCSimpleStatements : sig
type register = {
index: int
}
type t =
| Nop
| BRegOp of brop * register * register * register
| BImmOp of biop * register * int * register
| URegOp of urop * register * register
| Load of register * register
| LoadI of register * int
| Store of register * register
and brop =
| Add
| Sub
| Mult
| Div
| Mod
| Pow
| And
| Or
| Eq
| Less
| LessEq
| More
| MoreEq
and biop =
| AddI
| SubI
| MultI
| DivI
| ModI
| PowI
| AndI
| OrI
| EqI
| LessI
| LessEqI
| MoreI
| MoreEqI
and urop =
| Not
| Copy
| Rand
val pp : out_channel -> t -> unit
val pplist : out_channel -> t list -> unit
end
module RISCCfg : Cfg.C with type elt = RISCSimpleStatements.t
val convert : CfgImp.SSCfg.t -> RISCCfg.t