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
+32
View File
@@ -0,0 +1,32 @@
# Simple test for addressing modes.
export
function w $sum(l %arr, w %num) {
@start
@loop
%n1 =w phi @start %num, @loop1 %n2
%s0 =w phi @start 0, @loop1 %s1
%n2 =w sub %n1, 1
%c =w cslew %n1, 0
jnz %c, @end, @loop1
@loop1
%idx0 =l extsw %n2
%idx1 =l mul 4, %idx0
%idx2 =l add %idx1, %arr
%w =w loadw %idx2
%s1 =w add %w, %s0
jmp @loop
@end
ret %s0
}
# >>> driver
# extern int sum(int *, int);
# int arr[] = { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 };
# #define N sizeof arr / sizeof arr[0]
# int main() {
# int i, s;
# for (s=i=0; i<N; i++) s+=arr[i];
# return !(sum(arr, N) == s);
# }
# <<<