diff options
author | pacien | 2018-04-30 21:52:30 +0200 |
---|---|---|
committer | pacien | 2018-04-30 21:52:30 +0200 |
commit | eaa7447f74392c0afab027ef6d67f5d247daabc7 (patch) | |
tree | 797b8a5511e558fa1183bf7846b5a0fcb1a5f9ed /src | |
parent | a9c97df3133684f4f7ba0674b486ae77c20ab3c1 (diff) | |
download | urm-eaa7447f74392c0afab027ef6d67f5d247daabc7.tar.gz |
Fix Mult conversion
Diffstat (limited to 'src')
-rw-r--r-- | src/eurm.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/eurm.ml b/src/eurm.ml index 2b5def9..b462775 100644 --- a/src/eurm.ml +++ b/src/eurm.ml | |||
@@ -67,10 +67,10 @@ let compile_stage1 eurmcmds state = | |||
67 | add_reg_label state 1 0 | 67 | add_reg_label state 1 0 |
68 | 68 | ||
69 | | Mult(r1, r2) -> | 69 | | Mult(r1, r2) -> |
70 | let ctr_reg = state.max_reg + 1 and res_reg = state.max_reg + 2 | 70 | let ctr_reg = state.max_reg + 1 and aux_reg = state.max_reg + 2 |
71 | and start_label = string_of_int (state.label_count + 1) and end_label = string_of_int (state.label_count + 2) | 71 | and start_label = string_of_int (state.label_count + 1) and end_label = string_of_int (state.label_count + 2) |
72 | in [ Zero(ctr_reg); Zero(res_reg); Label(start_label); EqPredicate(ctr_reg, r2, end_label); | 72 | in [ Zero(ctr_reg); Copy(aux_reg, r1); Label(start_label); EqPredicate(ctr_reg, r2, end_label); |
73 | Add(res_reg, r1); Inc(ctr_reg); Goto(start_label); Label(end_label) ], | 73 | Add(r1, aux_reg); Inc(ctr_reg); Goto(start_label); Label(end_label) ], |
74 | add_reg_label state 2 2 | 74 | add_reg_label state 2 2 |
75 | 75 | ||
76 | | ZeroPredicate(r, l) -> | 76 | | ZeroPredicate(r, l) -> |