summaryrefslogtreecommitdiff
path: root/utils/qc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/qc')
-rw-r--r--utils/qc/gc.h25
-rw-r--r--utils/qc/list.c2
-rw-r--r--utils/qc/peep.c11
-rw-r--r--utils/qc/swt.c21
-rw-r--r--utils/qc/txt.c4
5 files changed, 27 insertions, 36 deletions
diff --git a/utils/qc/gc.h b/utils/qc/gc.h
index f82e2e1c..64a88a16 100644
--- a/utils/qc/gc.h
+++ b/utils/qc/gc.h
@@ -27,10 +27,12 @@ typedef struct Rgn Rgn;
struct Adr
{
- long offset;
- double dval;
- char sval[NSNAME];
-
+/* union */
+/* { */
+ long offset;
+ double dval;
+ char sval[NSNAME];
+/* }; */
Sym* sym;
char type;
char reg;
@@ -55,7 +57,7 @@ struct Prog
struct Case
{
Case* link;
- long val;
+ vlong val;
long label;
char def;
char isv;
@@ -64,7 +66,7 @@ struct Case
struct C1
{
- long val;
+ vlong val;
long label;
};
@@ -107,9 +109,11 @@ struct Reg
long regu;
long loop; /* could be shorter */
- Reg* log5;
- int active;
-
+/* union */
+/* { */
+ Reg* log5;
+ long active;
+/* }; */
Reg* p1;
Reg* p2;
Reg* p2link;
@@ -267,7 +271,7 @@ void gpseudo(int, Sym*, Node*);
/*
* swt.c
*/
-int swcmp(const void*, const void*);
+int swcmp(void*, void*);
void doswit(Node*);
void swit1(C1*, int, long, Node*);
void swit2(C1*, int, long, Node*, Node*);
@@ -279,7 +283,6 @@ int mulcon(Node*, Node*);
Multab* mulcon0(Node*, long);
int mulcon1(Node*, long, Node*);
void nullwarn(Node*, Node*);
-void sextern(Sym*, Node*, long, long);
void gextern(Sym*, Node*, long, long);
void outcode(void);
void ieeedtod(Ieee*, double);
diff --git a/utils/qc/list.c b/utils/qc/list.c
index f0f98a13..cf573e33 100644
--- a/utils/qc/list.c
+++ b/utils/qc/list.c
@@ -70,7 +70,7 @@ Aconv(Fmt *fp)
int a;
a = va_arg(fp->args, int);
- s = "???";
+ s = "?";
if(a >= AXXX && a <= ALAST)
s = anames[a];
return fmtstrcpy(fp, s);
diff --git a/utils/qc/peep.c b/utils/qc/peep.c
index 89fc431a..6a1e64f8 100644
--- a/utils/qc/peep.c
+++ b/utils/qc/peep.c
@@ -425,8 +425,6 @@ subprop(Reg *r0)
case AREMU:
case ARLWNM:
case ARLWNMCC:
- case ARLWMI:
- case ARLWMICC:
case AFADD:
case AFADDS:
@@ -624,7 +622,6 @@ copyu(Prog *p, Adr *v, Adr *s)
print(" (?)");
return 2;
-
case ANOP: /* read, write */
case AMOVW:
case AMOVH:
@@ -669,6 +666,12 @@ copyu(Prog *p, Adr *v, Adr *s)
return 1;
return 0;
+ case ARLWMI: /* read read rar */
+ case ARLWMICC:
+ if(copyas(&p->to, v))
+ return 2;
+ /* fall through */
+
case AADD: /* read read write */
case AADDC:
case AADDE:
@@ -696,8 +699,6 @@ copyu(Prog *p, Adr *v, Adr *s)
case ADIVWU:
case AREM:
case AREMU:
- case ARLWMI:
- case ARLWMICC:
case ARLWNM:
case ARLWNMCC:
diff --git a/utils/qc/swt.c b/utils/qc/swt.c
index f0edacc8..53105643 100644
--- a/utils/qc/swt.c
+++ b/utils/qc/swt.c
@@ -240,23 +240,6 @@ loop:
}
void
-sextern(Sym *s, Node *a, long o, long w)
-{
- long e, lw;
-
- for(e=0; e<w; e+=NSNAME) {
- lw = NSNAME;
- if(w-e < lw)
- lw = w-e;
- gpseudo(ADATA, s, nodconst(0));
- p->from.offset += o+e;
- p->reg = lw;
- p->to.type = D_SCONST;
- memmove(p->to.sval, a->cstring+e, lw);
- }
-}
-
-void
gextern(Sym *s, Node *a, long o, long w)
{
if(a->op == OCONST && typev[a->type->etype]) {
@@ -657,8 +640,8 @@ maxround(long max, long v)
w = SZ_LONG;
if((debug['8'] || hasdoubled) && !debug['4'])
w = SZ_DOUBLE;
- v += w-1;
+ v = round(v, w);
if(v > max)
- max = round(v, w);
+ return v;
return max;
}
diff --git a/utils/qc/txt.c b/utils/qc/txt.c
index 1c6f4d7f..d85b66e9 100644
--- a/utils/qc/txt.c
+++ b/utils/qc/txt.c
@@ -15,6 +15,7 @@ ginit(void)
thestring = "power";
exregoffset = REGEXT;
exfregoffset = FREGEXT;
+ newvlongcode = 1;
listinit();
nstring = 0;
mnstring = 0;
@@ -27,6 +28,8 @@ ginit(void)
lastp = P;
tfield = types[TLONG];
+ typeswitch = typechlv;
+
zprog.link = P;
zprog.as = AGOK;
zprog.reg = NREG;
@@ -1534,6 +1537,7 @@ gopcode64(int o, Node *f1, Node *f2, Node *t)
}
}
+int
samaddr(Node *f, Node *t)
{