diff options
| author | Michael Forney <mforney@mforney.org> | 2020-08-13 00:32:40 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-08-13 00:32:40 -0700 |
| commit | 18dcc504b518cfaeb9031a0acbd03655d9df2924 (patch) | |
| tree | 07fe57bc4354d1cf0e93ca8ce14fe7abccd6d717 | |
| parent | 637596d7f97107bcdb5e402c10f6b84cdd17d162 (diff) | |
qbe: Update to latest git
13 files changed, 5 insertions, 243 deletions
diff --git a/pkg/qbe/patch/0004-arm64-Handle-slots.patch b/pkg/qbe/patch/0001-arm64-Handle-slots.patch index 49f266e8..49f266e8 100644 --- a/pkg/qbe/patch/0004-arm64-Handle-slots.patch +++ b/pkg/qbe/patch/0001-arm64-Handle-slots.patch diff --git a/pkg/qbe/patch/0001-load-Error-out-when-there-are-too-many-phi-args.patch b/pkg/qbe/patch/0001-load-Error-out-when-there-are-too-many-phi-args.patch deleted file mode 100644 index 5c1d4c27..00000000 --- a/pkg/qbe/patch/0001-load-Error-out-when-there-are-too-many-phi-args.patch +++ /dev/null @@ -1,25 +0,0 @@ -From f7bd663aa19c84da21d5f6c15ca50daa9862ad9a Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Sun, 21 Apr 2019 12:55:53 -0700 -Subject: [PATCH] load: Error out when there are too many phi args - ---- - load.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/load.c b/load.c -index 8e2dd64..9894000 100644 ---- a/load.c -+++ b/load.c -@@ -330,6 +330,8 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) - p->to = r; - p->cls = sl.cls; - p->narg = b->npred; -+ if (b->npred >= NPred) -+ die("def, too many phi args (%u)", b->npred); - for (np=0; np<b->npred; ++np) { - bp = b->pred[np]; - if (!bp->s2 --- -2.21.0 - diff --git a/pkg/qbe/patch/0002-Use-dynamic-array-for-phi-arguments.patch b/pkg/qbe/patch/0002-Use-dynamic-array-for-phi-arguments.patch deleted file mode 100644 index 49270239..00000000 --- a/pkg/qbe/patch/0002-Use-dynamic-array-for-phi-arguments.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 3415d1f4dc68092819faf1744bfab556e338649b Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Sun, 21 Apr 2019 13:37:32 -0700 -Subject: [PATCH] Use dynamic array for phi arguments - ---- - all.h | 4 ++-- - amd64/sysv.c | 8 ++++++-- - arm64/abi.c | 8 ++++++-- - load.c | 4 ++-- - parse.c | 2 ++ - ssa.c | 6 ++++-- - 6 files changed, 22 insertions(+), 10 deletions(-) - -diff --git a/all.h b/all.h -index 59eefe1..fba93b1 100644 ---- a/all.h -+++ b/all.h -@@ -206,8 +206,8 @@ struct Ins { - - struct Phi { - Ref to; -- Ref arg[NPred]; -- Blk *blk[NPred]; -+ Ref *arg; -+ Blk **blk; - uint narg; - int cls; - Phi *link; -diff --git a/amd64/sysv.c b/amd64/sysv.c -index ea9b2d2..286300a 100644 ---- a/amd64/sysv.c -+++ b/amd64/sysv.c -@@ -590,9 +590,13 @@ selvaarg(Fn *fn, Blk *b, Ins *i) - *b0->phi = (Phi){ - .cls = Kl, .to = loc, - .narg = 2, -- .blk = {bstk, breg}, -- .arg = {lstk, lreg}, -+ .blk = vnew(2, sizeof b0->phi->blk[0], Pfn), -+ .arg = vnew(2, sizeof b0->phi->arg[0], Pfn), - }; -+ b0->phi->blk[0] = bstk; -+ b0->phi->blk[1] = breg; -+ b0->phi->arg[0] = lstk; -+ b0->phi->arg[1] = lreg; - r0 = newtmp("abi", Kl, fn); - r1 = newtmp("abi", Kw, fn); - b->jmp.type = Jjnz; -diff --git a/arm64/abi.c b/arm64/abi.c -index 8bc9c20..f5b605a 100644 ---- a/arm64/abi.c -+++ b/arm64/abi.c -@@ -583,9 +583,13 @@ selvaarg(Fn *fn, Blk *b, Ins *i) - *b0->phi = (Phi){ - .cls = Kl, .to = loc, - .narg = 2, -- .blk = {bstk, breg}, -- .arg = {lstk, lreg}, -+ .blk = vnew(2, sizeof b0->phi->blk[0], Pfn), -+ .arg = vnew(2, sizeof b0->phi->arg[0], Pfn), - }; -+ b0->phi->blk[0] = bstk; -+ b0->phi->blk[1] = breg; -+ b0->phi->arg[0] = lstk; -+ b0->phi->arg[1] = lreg; - r0 = newtmp("abi", Kl, fn); - r1 = newtmp("abi", Kw, fn); - b->jmp.type = Jjnz; -diff --git a/load.c b/load.c -index 9894000..ae9cfcf 100644 ---- a/load.c -+++ b/load.c -@@ -330,8 +330,8 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) - p->to = r; - p->cls = sl.cls; - p->narg = b->npred; -- if (b->npred >= NPred) -- die("def, too many phi args (%u)", b->npred); -+ p->arg = vnew(p->narg, sizeof p->arg[0], Pfn); -+ p->blk = vnew(p->narg, sizeof p->blk[0], Pfn); - for (np=0; np<b->npred; ++np) { - bp = b->pred[np]; - if (!bp->s2 -diff --git a/parse.c b/parse.c -index c4c1fe6..95bcf45 100644 ---- a/parse.c -+++ b/parse.c -@@ -673,7 +673,9 @@ Ins: - phi = alloc(sizeof *phi); - phi->to = r; - phi->cls = k; -+ phi->arg = vnew(i, sizeof arg[0], Pfn); - memcpy(phi->arg, arg, i * sizeof arg[0]); -+ phi->blk = vnew(i, sizeof blk[0], Pfn); - memcpy(phi->blk, blk, i * sizeof blk[0]); - phi->narg = i; - *plink = phi; -diff --git a/ssa.c b/ssa.c -index c098438..2de02d1 100644 ---- a/ssa.c -+++ b/ssa.c -@@ -181,6 +181,8 @@ phiins(Fn *fn) - p->cls = k; - p->to = TMP(t); - p->link = a->phi; -+ p->arg = vnew(0, sizeof p->arg[0], Pfn); -+ p->blk = vnew(0, sizeof p->blk[0], Pfn); - a->phi = p; - if (!bshas(defs, a->id)) - if (!bshas(u, a->id)) { -@@ -294,8 +296,8 @@ renblk(Blk *b, Name **stk, Fn *fn) - t = p->to.val; - if ((t=fn->tmp[t].visit)) { - m = p->narg++; -- if (m == NPred) -- die("renblk, too many phi args"); -+ vgrow(&p->arg, p->narg); -+ vgrow(&p->blk, p->narg); - p->arg[m] = getstk(t, b, stk); - p->blk[m] = b; - } --- -2.21.0 - diff --git a/pkg/qbe/patch/0006-arm64-Handle-slots-in-Ocopy-operands.patch b/pkg/qbe/patch/0002-arm64-Handle-slots-in-Ocopy-operands.patch index 060cd9da..060cd9da 100644 --- a/pkg/qbe/patch/0006-arm64-Handle-slots-in-Ocopy-operands.patch +++ b/pkg/qbe/patch/0002-arm64-Handle-slots-in-Ocopy-operands.patch diff --git a/pkg/qbe/patch/0003-Restore-NPred-to-its-previous-value.patch b/pkg/qbe/patch/0003-Restore-NPred-to-its-previous-value.patch deleted file mode 100644 index 6ceac053..00000000 --- a/pkg/qbe/patch/0003-Restore-NPred-to-its-previous-value.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6ea7a634070bb7a0312fcd6abd00b45cf7dd46f1 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Sun, 21 Apr 2019 13:43:27 -0700 -Subject: [PATCH] Restore NPred to its previous value - -This now only limits the number of arguments when parsing the input SSA, -which is usually a small fixed size (depending on the frontend). ---- - all.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/all.h b/all.h -index fba93b1..5f67e81 100644 ---- a/all.h -+++ b/all.h -@@ -32,7 +32,7 @@ typedef struct Target Target; - - enum { - NString = 64, -- NPred = 127, -+ NPred = 63, - NIns = 1 << 20, - NAlign = 3, - NField = 32, --- -2.21.0 - diff --git a/pkg/qbe/patch/0007-arm64-Prevent-stack-clobber-when-passing-structures-.patch b/pkg/qbe/patch/0003-arm64-Prevent-stack-clobber-when-passing-structures-.patch index da919376..da919376 100644 --- a/pkg/qbe/patch/0007-arm64-Prevent-stack-clobber-when-passing-structures-.patch +++ b/pkg/qbe/patch/0003-arm64-Prevent-stack-clobber-when-passing-structures-.patch diff --git a/pkg/qbe/patch/0009-amd64-Fix-floating-point-equality-check-with-NaN.patch b/pkg/qbe/patch/0004-amd64-Fix-floating-point-equality-check-with-NaN.patch index ee0bde60..ee0bde60 100644 --- a/pkg/qbe/patch/0009-amd64-Fix-floating-point-equality-check-with-NaN.patch +++ b/pkg/qbe/patch/0004-amd64-Fix-floating-point-equality-check-with-NaN.patch diff --git a/pkg/qbe/patch/0010-Increase-NString-to-96.patch b/pkg/qbe/patch/0005-Increase-NString-to-96.patch index 8b6a9af4..9759d2a7 100644 --- a/pkg/qbe/patch/0010-Increase-NString-to-96.patch +++ b/pkg/qbe/patch/0005-Increase-NString-to-96.patch @@ -1,4 +1,4 @@ -From b391a6bdf819585cd956107b2346cd939b48ce41 Mon Sep 17 00:00:00 2001 +From 948e221acc92d002662ffa609a252a3410a93001 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Fri, 31 May 2019 13:31:04 -0700 Subject: [PATCH] Increase NString to 96 @@ -8,7 +8,7 @@ Subject: [PATCH] Increase NString to 96 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all.h b/all.h -index 5f67e81..8819e85 100644 +index 7f843a9..805a346 100644 --- a/all.h +++ b/all.h @@ -31,7 +31,7 @@ typedef struct Dat Dat; @@ -17,9 +17,9 @@ index 5f67e81..8819e85 100644 enum { - NString = 64, + NString = 96, - NPred = 63, NIns = 1 << 20, NAlign = 3, + NField = 32, -- -2.22.0 +2.28.0 diff --git a/pkg/qbe/patch/0005-arm64-Make-sure-SP-stays-aligned-by-16.patch b/pkg/qbe/patch/0005-arm64-Make-sure-SP-stays-aligned-by-16.patch deleted file mode 100644 index 06bd2a10..00000000 --- a/pkg/qbe/patch/0005-arm64-Make-sure-SP-stays-aligned-by-16.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 036fef96ea7005996ea0f802d5629ddae3673da6 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Wed, 8 May 2019 19:05:57 -0700 -Subject: [PATCH] arm64: Make sure SP stays aligned by 16 - -According to the ARMv8 overview document - - However if SP is used as the base register then the value of the stack - pointer prior to adding any offset must be quadword (16 byte) aligned, - or else a stack alignment exception will be generated. - -This manifests as a bus error on my system. - -To resolve this, just save registers two at a time with stp. ---- - arm64/emit.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arm64/emit.c b/arm64/emit.c -index 9cc4a64..e7effef 100644 ---- a/arm64/emit.c -+++ b/arm64/emit.c -@@ -387,8 +387,8 @@ arm64_emitfn(Fn *fn, FILE *out) - if (e->fn->vararg) { - for (n=7; n>=0; n--) - fprintf(e->f, "\tstr\tq%d, [sp, -16]!\n", n); -- for (n=7; n>=0; n--) -- fprintf(e->f, "\tstr\tx%d, [sp, -8]!\n", n); -+ for (n=7; n>=0; n -= 2) -+ fprintf(e->f, "\tstp\tx%d, x%d, [sp, -16]!\n", n-1, n); - } - - if (e->frame + 16 <= 512) --- -2.21.0 - diff --git a/pkg/qbe/patch/0011-fold-Don-t-fold-invalid-addition-subtraction-rather-.patch b/pkg/qbe/patch/0006-fold-Don-t-fold-invalid-addition-subtraction-rather-.patch index bafa164e..bafa164e 100644 --- a/pkg/qbe/patch/0011-fold-Don-t-fold-invalid-addition-subtraction-rather-.patch +++ b/pkg/qbe/patch/0006-fold-Don-t-fold-invalid-addition-subtraction-rather-.patch diff --git a/pkg/qbe/patch/0008-rega-Fix-allocation-of-multiple-temporaries-to-the-s.patch b/pkg/qbe/patch/0008-rega-Fix-allocation-of-multiple-temporaries-to-the-s.patch deleted file mode 100644 index 2a01fc05..00000000 --- a/pkg/qbe/patch/0008-rega-Fix-allocation-of-multiple-temporaries-to-the-s.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 325cae726ecea5d332e8f4c68bc572069ff5e249 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Thu, 16 May 2019 15:21:26 -0700 -Subject: [PATCH] rega: Fix allocation of multiple temporaries to the same - register - ---- - rega.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/rega.c b/rega.c -index ba405e5..7547293 100644 ---- a/rega.c -+++ b/rega.c -@@ -605,6 +605,7 @@ rega(Fn *fn) - if (x > 0 && !bshas(m->b, x)) { - pmadd(TMP(x), TMP(r), tmp[t].cls); - m->r[j] = x; -+ bsset(m->b, x); - } - } - curi = &insb[NIns]; --- -2.21.0 - diff --git a/pkg/qbe/src b/pkg/qbe/src -Subproject 190263f1b628ba3171309147120fd3ba0e370b4 +Subproject 5e5e301e866e1eeb4523b9ecae6a2a327c019a0 diff --git a/pkg/qbe/ver b/pkg/qbe/ver index 34597185..6d168066 100644 --- a/pkg/qbe/ver +++ b/pkg/qbe/ver @@ -1 +1 @@ -190263f1b6 r0 +5e5e301e86 r0 |
