Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Apr 7, 2024
1 parent 0a66015 commit cf0ff35
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/arm64/emit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ and g' oc = function (* 各命令のアセンブリ生成 (caml2html: emit_gprim
| NonTail(x), Mr(y) when x = y -> ()
| NonTail(x), Mr(y) -> Printf.fprintf oc "\tmov %s, %s\n" (reg x) (reg y)
| NonTail(x), Neg(y) -> Printf.fprintf oc "\tneg\t%s, %s\n" (reg x) (reg y)
| NonTail(x), CallDir(Id.L "min_caml_mul", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_mul\n"
| NonTail(x), CallDir(Id.L "min_caml_div", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_div\n"
| NonTail(x), CallDir(Id.L "min_caml_rem", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_rem\n"
| NonTail(x), Add(y, V(z)) -> Printf.fprintf oc "\tadd\t%s, %s, %s\n" (reg x) (reg y) (reg z)
| NonTail(x), Add(y, C(z)) -> Printf.fprintf oc "\tadd %s, %s, %d\n" (reg x) (reg y) z
| NonTail(x), Sub(y, V(z)) -> Printf.fprintf oc "\tsub\t%s, %s, %s\n" (reg x) (reg y) (reg z)
Expand Down Expand Up @@ -194,9 +191,9 @@ and g' oc = function (* 各命令のアセンブリ生成 (caml2html: emit_gprim
Printf.fprintf oc "\tbr %s\n" (reg reg_sw)
(* Printf.fprintf oc "\tlwz\t%s, 0(%s)\n" (reg reg_sw) (reg reg_cl);
Printf.fprintf oc "\tmtctr\t%s\n\tbctr\n" (reg reg_sw); *)
| Tail, CallDir(Id.L "min_caml_mul", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_mul\n"
| Tail, CallDir(Id.L "min_caml_div", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_div\n"
| Tail, CallDir(Id.L "min_caml_rem", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_rem\n"
| _, CallDir(Id.L "min_caml_mul", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_mul\n"
| _, CallDir(Id.L "min_caml_div", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_div\n"
| _, CallDir(Id.L "min_caml_rem", ys, zs) -> g'_args oc [] ys zs; Printf.fprintf oc "\tb min_caml_rem\n"
| Tail, CallDir(Id.L(x), ys, zs) -> (* 末尾呼び出し *)
g'_args oc [] ys zs;
Printf.fprintf oc "\tb\t%s\n" x
Expand Down

0 comments on commit cf0ff35

Please sign in to comment.