マンデルブロを出力するAArch64コードを出力
ターミナルに収まるようにコードを修正
code:diff
diff --git a/shootout/mandelbrot.ml b/shootout/mandelbrot.ml
index 2f656be..54ef342 100644
--- a/shootout/mandelbrot.ml
+++ b/shootout/mandelbrot.ml
@@ -2,12 +2,12 @@
(*NOMINCAML let dbl f = 2. *. f in *)
(*NOMINCAML for y = 0 to 399 do *)
(*MINCAML*) let rec yloop y =
-(*MINCAML*) if y >= 400 then () else
+(*MINCAML*) if y >= 40 then () else
(*NOMINCAML for x = 0 to 399 do *)
(*MINCAML*) let rec xloop x y =
-(*MINCAML*) if x >= 400 then () else
- let cr = dbl (float_of_int x) /. 400.0 -. 1.5 in
- let ci = dbl (float_of_int y) /. 400.0 -. 1.0 in
+(*MINCAML*) if x >= 80 then () else
+ let cr = dbl (float_of_int x) /. 80.0 -. 1.5 in
+ let ci = dbl (float_of_int y) /. 40.0 -. 1.0 in
let rec iloop i zr zi zr2 zi2 cr ci =
if i = 0 then print_int 1 else
let tr = zr2 -. zi2 +. cr in
ビルド
code:sh
make clean && ./to_aarch64 && make min-caml && ./min-caml shootout/mandelbrot && gcc shootout/mandelbrot.s samples/stub.c libmincaml.S -o shootout/mandelbrot && shootout/mandelbrot
出力されたマンデルブロ集合
https://gyazo.com/bc87b9135dd6f535657b4926f311d3d2