aboutsummaryrefslogtreecommitdiff
path: root/reg.ml
diff options
context:
space:
mode:
Diffstat (limited to 'reg.ml')
-rw-r--r--reg.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/reg.ml b/reg.ml
index 133ef21..d065838 100644
--- a/reg.ml
+++ b/reg.ml
@@ -8,7 +8,7 @@ open Common
8let reg_idx (Reg(idx, _)) = idx 8let reg_idx (Reg(idx, _)) = idx
9let reg_val (Reg(_, value)) = value 9let reg_val (Reg(_, value)) = value
10let reg_compar l r = (reg_val l) - (reg_val r) 10let reg_compar l r = (reg_val l) - (reg_val r)
11let reg_string (Reg (index, value)) = (string_of_int index) ^ ": " ^ (string_of_int value) 11let reg_string (Reg (index, value)) = "(" ^ (string_of_int index) ^ "," ^ (string_of_int value) ^ ")"
12 12
13let regs_get reglist index = 13let regs_get reglist index =
14 List.find (fun (Reg(idx, _)) -> idx = index) reglist |> reg_val 14 List.find (fun (Reg(idx, _)) -> idx = index) reglist |> reg_val
@@ -16,5 +16,5 @@ let regs_get reglist index =
16let regs_set reglist index value = 16let regs_set reglist index value =
17 Reg(index, value) :: List.filter (fun (Reg(idx, _)) -> idx != index) reglist 17 Reg(index, value) :: List.filter (fun (Reg(idx, _)) -> idx != index) reglist
18 18
19let regs_string reglist = List.map (reg_string) reglist |> String.concat ", " 19let regs_string reglist = List.map (reg_string) reglist |> String.concat ","
20 20