cpuex2019-1 / compiler

Other
0 stars 0 forks source link

定数レジスタの導入 #14

Open okuraofvegetable opened 4 years ago

okuraofvegetable commented 4 years ago
eq_cont.42456:
    ori $30, $0, 0
    bne $9, $30, eq_else.42457

みたいなパターンが見えたので

eq_cont.42456:
    bne $9, $0, eq_else.42457

となるようにする

okuraofvegetable commented 4 years ago

kamiがaddi hoge, $0, 1の数を数えてくれて、6500万回だった(実行数). 1レジスタを作る最適化をするかどうか迷う

okuraofvegetable commented 4 years ago

これはemitのIfEq(x,C(y),e1,e2)の処理が悪かったので修正した。

okuraofvegetable commented 4 years ago

浮動小数、整数ともに定数の出現頻度を何かしらの尺度で評価して、多いものから数個をレジスタに載せ続ける(どうせ割付で余るので)