Commit a89d6024 authored by Camil Staps's avatar Camil Staps 🙂

Merge branch 'fix-replace_r-and-update_r' into 'master'

Fix replace_r and update_r

See merge request !127
parents 7e73d6d7 1797871e
Pipeline #43612 passed with stages
in 12 minutes and 39 seconds
......@@ -2743,7 +2743,7 @@ all_instructions opts t = bootstrap $ collect_instructions opts $ map (\i -> i t
advance_ptr b n_a :.
unrolled_loop [1..32] (\i -> n_a <. lit_hword i) (\i ->
A @ (1-i) .= a @ (i-1) :.
a @ (i-1) .= A @ (i-2)) :.
a @ (i-1) .= A @ (0-i)) :.
new_local TWord (lit_word 0) \temp ->
unrolled_loop [0..31] (\i -> n_b <. lit_hword (i+1)) (\i ->
temp .= b @ i :.
......@@ -3186,15 +3186,12 @@ all_instructions opts t = bootstrap $ collect_instructions opts $ map (\i -> i t
advance_ptr Pc 3 :.
new_local (TPtr TWord) (to_word_ptr (A @ 0)) \elems ->
advance_ptr elems ((n_a+n_b) * to_ptr_offset (B @ 0) + lit_hword 3) :.
elems @ 0 .= A @ -1 :.
elems @ 1 .= A @ -2 :.
unrolled_loop [3..30] (\i -> n_a <. lit_hword i) (\i -> elems @ (i-1) .= A @ (0-i)) :.
for [0..4] (\i -> elems @ i .= A @ (-1-i)) :.
unrolled_loop [6..30] (\i -> n_a <. lit_hword i) (\i -> elems @ (i-1) .= A @ (0-i)) :.
A @ (lit_hword 0 - n_a) .= A @ 0 :.
shrink_a n_a :.
advance_ptr elems n_a :.
elems @ 0 .= B @ 1 :.
elems @ 1 .= B @ 2 :.
unrolled_loop [3..30] (\i -> n_b <. lit_hword i) (\i -> elems @ (i-1) .= B @ i) :.
unrolled_loop [1..30] (\i -> n_b <. lit_hword i) (\i -> elems @ (i-1) .= B @ i) :.
shrink_b (n_b + lit_hword 1)
, instr "xorI" (Just 0) $
B @ 1 .= xorI (B @ 0) (B @ 1) :.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment