aboutsummaryrefslogtreecommitdiffstats
path: root/riscV/PrintOp.ml
diff options
context:
space:
mode:
Diffstat (limited to 'riscV/PrintOp.ml')
-rw-r--r--riscV/PrintOp.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/riscV/PrintOp.ml b/riscV/PrintOp.ml
index aa609e15..a37f5c9c 100644
--- a/riscV/PrintOp.ml
+++ b/riscV/PrintOp.ml
@@ -35,6 +35,10 @@ let get_optR0_s c reg pp r1 r2 = function
| Some true -> fprintf pp "(X0 %s %a)" (comparison_name c) reg r1
| Some false -> fprintf pp "(%a %s X0)" reg r1 (comparison_name c)
+let get_optR0_s_int reg pp r1 n = function
+ | None -> fprintf pp "(%a, %ld)" reg r1 n
+ | Some _ -> fprintf pp "(X0, %ld)" n
+
let print_condition reg pp = function
| (Ccomp c, [r1;r2]) ->
fprintf pp "%a %ss %a" reg r1 (comparison_name c) reg r2
@@ -203,7 +207,8 @@ let print_operation reg pp = function
| OEsltiuw n, [r1] -> fprintf pp "OEsltiuw(%a,%ld)" reg r1 (camlint_of_coqint n)
| OExoriw n, [r1] -> fprintf pp "OExoriw(%a,%ld)" reg r1 (camlint_of_coqint n)
| OEluiw n, _ -> fprintf pp "OEluiw(%ld)" (camlint_of_coqint n)
- | OEaddiwr0 n, _ -> fprintf pp "OEaddiwr0(%ld,X0)" (camlint_of_coqint n)
+ | OEaddiw n, [r1] -> fprintf pp "OEaddiw(%a,%ld)" reg r1 (camlint_of_coqint n)
+ | OEaddiwr0 n, [] -> fprintf pp "OEaddiwr0(X0,%ld)" (camlint_of_coqint n)
| OEseql optR0, [r1;r2] -> fprintf pp "OEseql"; (get_optR0_s Ceq reg pp r1 r2 optR0)
| OEsnel optR0, [r1;r2] -> fprintf pp "OEsnel"; (get_optR0_s Cne reg pp r1 r2 optR0)
| OEsequl optR0, [r1;r2] -> fprintf pp "OEsequl"; (get_optR0_s Ceq reg pp r1 r2 optR0)
@@ -214,7 +219,8 @@ let print_operation reg pp = function
| OEsltiul n, [r1] -> fprintf pp "OEsltiul(%a,%ld)" reg r1 (camlint_of_coqint n)
| OExoril n, [r1] -> fprintf pp "OExoril(%a,%ld)" reg r1 (camlint_of_coqint n)
| OEluil n, _ -> fprintf pp "OEluil(%ld)" (camlint_of_coqint n)
- | OEaddilr0 n, _ -> fprintf pp "OEaddilr0(%ld,X0)" (camlint_of_coqint n)
+ | OEaddil n, [r1] -> fprintf pp "OEaddil(%a,%ld)" reg r1 (camlint_of_coqint n)
+ | OEaddilr0 n, [] -> fprintf pp "OEaddilr0(X0,%ld)" (camlint_of_coqint n)
| OEloadli n, _ -> fprintf pp "OEloadli(%ld)" (camlint_of_coqint n)
| OEmayundef isl, [r1;r2] -> fprintf pp "OEmayundef (%b,%a,%a)" isl reg r1 reg r2
| OEfeqd, [r1;r2] -> fprintf pp "OEfeqd(%a,%s,%a)" reg r1 (comparison_name Ceq) reg r2