From 05afabd5152b06295e16c65b5a249229a4ead996 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 9 May 2025 21:05:24 -0700 Subject: Bugs for BubbleSort Encoding picking up extra function padding if needing another round for X86 short jumps. GCM failed to late schedule around loop backedges. X86 Div was using AX/DX as *source* registers. X86 kills more flags. --- chapter22/docs/examples/BubbleSort.smp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'chapter22/docs/examples') diff --git a/chapter22/docs/examples/BubbleSort.smp b/chapter22/docs/examples/BubbleSort.smp index 70f45717..f6b30752 100644 --- a/chapter22/docs/examples/BubbleSort.smp +++ b/chapter22/docs/examples/BubbleSort.smp @@ -14,7 +14,7 @@ struct Scan { // Skip whitespace val skip = { Scan s -> - while( s.buf[s.x] <= 32 ) + while( s.buf[s.x] <= ' ' ) s.x++; }; @@ -53,7 +53,6 @@ val main = { -> // Parse "123, " until a something else while( s.x < s.buf# ) { int n = number(s); - i32 q=n; ns[num++] = n; if( !peek(s,',') ) break; @@ -63,24 +62,23 @@ val main = { -> // Print a list of numbers sys.io.p("[ "); - u8[] !buf = new u8[20]; + u8[] !junk = new u8[1]; for( int i=0; i0 ) - { q/=10; log++; } - i32 raw=log; - sys.libc._exit(raw); - // for( int j=0, a=x; j