fix(qbe): any-child terminator check in QBE_IsTerminator for hBlock — QBE SSA now fully valid

- QBE_IsTerminator(hBlock) checks ALL children, not just last
- Removed legacy c_backend.bux and nim_backend.bux from _selfhost/src/
- QBE self-hosting QBE phase: PASSES (SSA valid, assembled to .s)
- Remaining: linker errors from missing String_Eq/StringBuilder in runtime
This commit is contained in:
2026-06-02 13:56:12 +03:00
parent 6cb5528a4d
commit eb8179b6d0
142 changed files with 70706 additions and 1407 deletions
+33
View File
@@ -0,0 +1,33 @@
# find the 10,001st prime
# store it in a
export
function $test() {
@start
@loop
%n =w phi @start 5, @tloop %n, @yes %n1
%p =w phi @start 13, @tloop %p1, @yes %p1
%p1 =w add %p, 2
@tloop
%t =w phi @loop 3, @next %t1
%r =w rem %p, %t
jnz %r, @next, @loop
@next
%t1 =w add 2, %t
%tsq =w mul %t1, %t1
%c0 =w csgtw %tsq, %p
jnz %c0, @yes, @tloop
@yes
%n1 =w add 1, %n
%c1 =w ceqw 10001, %n1
jnz %c1, @end, @loop
@end
storew %p, $a
ret
}
# >>> driver
# extern void test(void);
# int a;
# int main() { test(); return !(a == 104743); }
# <<<