From 3b00a5376036bb3f50a1a1f97d136305a2d03a57 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 28 May 2026 19:34:07 -0700 Subject: change the parameter order for memcopy and memmove that was surprisingly involved, but it feels like the right thing to do Change-Id: Ia2f38c7278f4237cebd0435d27131fe32dbc3718 Force-Push: yes --- flow-control.e | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'flow-control.e') diff --git a/flow-control.e b/flow-control.e index ba6a5b6..bee5038 100644 --- a/flow-control.e +++ b/flow-control.e @@ -25,8 +25,8 @@ ~ (start pointer, length --) : if - 2dup swap dup 5 8 * + 3unroll swap - ~ (start pointer, length, adjusted start pointer, start pointer, length) + 2dup swap dup 5 8 * + 3roll + ~ (start pointer, length, start pointer, adjusted start pointer, length) memmove ~ (start pointer, length) @@ -47,7 +47,7 @@ ~ (start pointer, length --) : unless - 2dup swap dup 5 8 * + 3unroll swap + 2dup swap dup 5 8 * + 3roll ~ (start pointer, length, start pointer, adjusted start pointer, length) memmove ~ (start pointer, length) @@ -71,9 +71,9 @@ ~ Those spaces will take five words, and two words, respectively. So the ~ false-block gets moved by seven words, and the true-block gets moved by ~ five words. - 2dup swap dup 7 8 * + swap 3roll memmove - 4 roll dup 5 unroll 4 roll dup 5 unroll - swap dup 5 8 * + swap 3roll memmove + 2dup swap dup 7 8 * + 3roll memmove + ~ (true start, true length, false start, false length) + 3 pick dup 5 8 * + 4 pick memmove ~ (true start, true length, false start, false length) ~ Now we write out the initial test-and-branch. @@ -110,7 +110,7 @@ ~ (test start, test length, body start, body length --) : while ~ The conditional branch needs five words. - 2dup swap dup 5 8 * + swap 3roll memmove + 2dup swap dup 5 8 * + 3roll memmove here @ 5 unroll swap dup 3unroll here ! ~ (old here, test start, test length, body start, body length) ' lit entry-to-execution-token , 0 , -- cgit 1.4.1