Closed okuraofvegetable closed 4 years ago
1引数1返り値のアセンブリ命令に対して
let rec sqrt x =
ASM sqrt x
in ...
と書けるようにMinCaml文法を拡張することでインライン化できるようにする
気づいてなかったがこれでprint_charもインライン化できる
この方針は一旦やめてregAllocにライブラリ関数と使用レジスタを登録して退避を回避しておく方針にしようかと思う(インライン化できないがジャンプは妥協...)
Asm構文を実装した。 新たにAsmを追加する際はtyping.ml,kNormal(asm_res_type),elim.ml(副作用判定),virtual.ml,regAlloc.ml,emit.ml,elim_asm.ml(副作用判定)をいじる必要あり。
一時レジスタしか用いていないsqrt,ftoi,itof,floorを呼び出す際もレジスタの値の退避が起こるので、インライン化してこれをなくす。