|
@@ -202,6 +202,7 @@ type opcode =
|
|
| ORefOffset of reg * reg * reg
|
|
| ORefOffset of reg * reg * reg
|
|
| ONop of string
|
|
| ONop of string
|
|
| OPrefetch of reg * field index * int
|
|
| OPrefetch of reg * field index * int
|
|
|
|
+ | OAsm of int * int * reg
|
|
|
|
|
|
type fundecl = {
|
|
type fundecl = {
|
|
fpath : string * string;
|
|
fpath : string * string;
|
|
@@ -574,6 +575,18 @@ let ostr fstr o =
|
|
| ORefOffset (r,r2,off) -> Printf.sprintf "refoffset %d, %d, %d" r r2 off
|
|
| ORefOffset (r,r2,off) -> Printf.sprintf "refoffset %d, %d, %d" r r2 off
|
|
| ONop s -> if s = "" then "nop" else "nop " ^ s
|
|
| ONop s -> if s = "" then "nop" else "nop " ^ s
|
|
| OPrefetch (r,f,mode) -> Printf.sprintf "prefetch %d[%d] %d" r f mode
|
|
| OPrefetch (r,f,mode) -> Printf.sprintf "prefetch %d[%d] %d" r f mode
|
|
|
|
+ | OAsm (mode, value, reg) ->
|
|
|
|
+ match mode with
|
|
|
|
+ | 0 when reg = 0 ->
|
|
|
|
+ Printf.sprintf "asm %.2X" value
|
|
|
|
+ | 1 when reg = 0 ->
|
|
|
|
+ Printf.sprintf "asm scratch R%d" value
|
|
|
|
+ | 2 ->
|
|
|
|
+ Printf.sprintf "asm R%d := %d" value (reg - 1)
|
|
|
|
+ | 3 ->
|
|
|
|
+ Printf.sprintf "asm %d := R%d" (reg - 1) value
|
|
|
|
+ | _ ->
|
|
|
|
+ Printf.sprintf "asm[%d] %d%s" mode value (if reg = 0 then "" else ", " ^ string_of_int (reg-1))
|
|
|
|
|
|
let fundecl_name f = if snd f.fpath = "" then "fun$" ^ (string_of_int f.findex) else (fst f.fpath) ^ "." ^ (snd f.fpath)
|
|
let fundecl_name f = if snd f.fpath = "" then "fun$" ^ (string_of_int f.findex) else (fst f.fpath) ^ "." ^ (snd f.fpath)
|
|
|
|
|