commit: 18dcc504b518cfaeb9031a0acbd03655d9df2924
parent 637596d7f97107bcdb5e402c10f6b84cdd17d162
Author: Michael Forney <mforney@mforney.org>
Date: Thu, 13 Aug 2020 00:32:40 -0700
qbe: Update to latest git
Diffstat:
13 files changed, 26 insertions(+), 264 deletions(-)
diff --git 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
@@ -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
@@ -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
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
@@ -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
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
diff --git a/pkg/qbe/patch/0005-Increase-NString-to-96.patch b/pkg/qbe/patch/0005-Increase-NString-to-96.patch
@@ -0,0 +1,25 @@
+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
+
+---
+ all.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/all.h b/all.h
+index 7f843a9..805a346 100644
+--- a/all.h
++++ b/all.h
+@@ -31,7 +31,7 @@ typedef struct Dat Dat;
+ typedef struct Target Target;
+
+ enum {
+- NString = 64,
++ NString = 96,
+ NIns = 1 << 20,
+ NAlign = 3,
+ NField = 32,
+--
+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
@@ -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
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
@@ -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/patch/0010-Increase-NString-to-96.patch b/pkg/qbe/patch/0010-Increase-NString-to-96.patch
@@ -1,25 +0,0 @@
-From b391a6bdf819585cd956107b2346cd939b48ce41 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
-
----
- all.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/all.h b/all.h
-index 5f67e81..8819e85 100644
---- a/all.h
-+++ b/all.h
-@@ -31,7 +31,7 @@ typedef struct Dat Dat;
- typedef struct Target Target;
-
- enum {
-- NString = 64,
-+ NString = 96,
- NPred = 63,
- NIns = 1 << 20,
- NAlign = 3,
---
-2.22.0
-
diff --git a/pkg/qbe/ver b/pkg/qbe/ver
@@ -1 +1 @@
-190263f1b6 r0
+5e5e301e86 r0