summaryrefslogtreecommitdiff
path: root/sys/src/cmd/5c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-07-30 19:11:16 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-07-30 19:11:16 +0200
commit4f33c88a51587681b7be1ae57cfbc43b627c6bc4 (patch)
tree25560404dc80007e5dc268811242c9071f6a1017 /sys/src/cmd/5c
parentfcc5e75d07e5bc6cb3ddac6d9a437e7ec62d0d95 (diff)
import updated compilers from sources
Diffstat (limited to 'sys/src/cmd/5c')
-rw-r--r--sys/src/cmd/5c/5.out.h16
-rw-r--r--sys/src/cmd/5c/enam.c6
-rw-r--r--sys/src/cmd/5c/gc.h6
-rw-r--r--sys/src/cmd/5c/mkfile3
-rw-r--r--sys/src/cmd/5c/peep.c4
-rw-r--r--sys/src/cmd/5c/reg.c2
-rw-r--r--sys/src/cmd/5c/swt.c14
7 files changed, 37 insertions, 14 deletions
diff --git a/sys/src/cmd/5c/5.out.h b/sys/src/cmd/5c/5.out.h
index dad2c336f..a618f8f10 100644
--- a/sys/src/cmd/5c/5.out.h
+++ b/sys/src/cmd/5c/5.out.h
@@ -25,6 +25,7 @@
#define NFREG 8
#define FREGRET 0
#define FREGEXT 7
+#define FREGTMP 15
/* compiler allocates register variables F0 up */
/* compiler allocates external registers F7 down */
@@ -92,6 +93,8 @@ enum as
AMULD,
ADIVF,
ADIVD,
+// ASQRTF,
+// ASQRTD,
ASRL,
ASRA,
@@ -143,6 +146,16 @@ enum as
ASIGNAME,
+ /* moved here to preserve values of older identifiers */
+ ASQRTF,
+ ASQRTD,
+
+ ALDREX,
+ ASTREX,
+
+ ALDREXD,
+ ASTREXD,
+
ALAST,
};
@@ -173,7 +186,8 @@ enum as
#define D_SHIFT (D_NONE+19)
#define D_FPCR (D_NONE+20)
-#define D_REGREG (D_NONE+21)
+#define D_REGREG (D_NONE+21)
+#define D_ADDR (D_NONE+22)
/* name */
#define D_EXTERN (D_NONE+3)
diff --git a/sys/src/cmd/5c/enam.c b/sys/src/cmd/5c/enam.c
index 989b2760e..e5ea0b847 100644
--- a/sys/src/cmd/5c/enam.c
+++ b/sys/src/cmd/5c/enam.c
@@ -94,5 +94,11 @@ char* anames[] =
"BXRET",
"DWORD",
"SIGNAME",
+ "SQRTF",
+ "SQRTD",
+ "LDREX",
+ "STREX",
+ "LDREXD",
+ "STREXD",
"LAST",
};
diff --git a/sys/src/cmd/5c/gc.h b/sys/src/cmd/5c/gc.h
index fa93cd0ae..e62955617 100644
--- a/sys/src/cmd/5c/gc.h
+++ b/sys/src/cmd/5c/gc.h
@@ -3,7 +3,7 @@
/*
* 5c/arm
- * Arm 7500
+ * Arm
*/
#define SZ_CHAR 1
#define SZ_SHORT 2
@@ -59,7 +59,7 @@ struct Prog
struct Case
{
Case* link;
- long val;
+ vlong val;
long label;
char def;
char isv;
@@ -68,7 +68,7 @@ struct Case
struct C1
{
- long val;
+ vlong val;
long label;
};
diff --git a/sys/src/cmd/5c/mkfile b/sys/src/cmd/5c/mkfile
index 2ec7e687c..256e532a6 100644
--- a/sys/src/cmd/5c/mkfile
+++ b/sys/src/cmd/5c/mkfile
@@ -36,3 +36,6 @@ t:V: $O.out
$O.out -S t
$LD -o t.out t.$O
t.out
+
+enam.c: 5.out.h
+ rc mkenam
diff --git a/sys/src/cmd/5c/peep.c b/sys/src/cmd/5c/peep.c
index d4da649f7..c7b4c2a30 100644
--- a/sys/src/cmd/5c/peep.c
+++ b/sys/src/cmd/5c/peep.c
@@ -1069,7 +1069,7 @@ copyu(Prog *p, Adr *v, Adr *s)
if(v->type == D_REG) {
if(v->reg <= REGEXT && v->reg > exregoffset)
return 2;
- if(v->reg == REGARG)
+ if(v->reg == (uchar)REGARG)
return 2;
}
if(v->type == D_FREG)
@@ -1087,7 +1087,7 @@ copyu(Prog *p, Adr *v, Adr *s)
case ATEXT: /* funny */
if(v->type == D_REG)
- if(v->reg == REGARG)
+ if(v->reg == (uchar)REGARG)
return 3;
return 0;
}
diff --git a/sys/src/cmd/5c/reg.c b/sys/src/cmd/5c/reg.c
index 43c78712e..a27b7148a 100644
--- a/sys/src/cmd/5c/reg.c
+++ b/sys/src/cmd/5c/reg.c
@@ -1125,7 +1125,7 @@ RtoB(int r)
int
BtoR(long b)
{
- b &= 0x01fcL;
+ b &= 0x01fcL; // excluded R9 and R10 for m and g
if(b == 0)
return 0;
return bitno(b);
diff --git a/sys/src/cmd/5c/swt.c b/sys/src/cmd/5c/swt.c
index ccc63ee79..185d97237 100644
--- a/sys/src/cmd/5c/swt.c
+++ b/sys/src/cmd/5c/swt.c
@@ -26,7 +26,7 @@ swit2(C1 *q, int nc, long def, Node *n, Node *tn)
if(nc < 5) {
for(i=0; i<nc; i++) {
if(debug['W'])
- print("case = %.8lux\n", q->val);
+ print("case = %.8llux\n", q->val);
gopcode(OEQ, nodconst(q->val), n, Z);
patch(p, q->label);
q++;
@@ -39,7 +39,7 @@ swit2(C1 *q, int nc, long def, Node *n, Node *tn)
i = nc / 2;
r = q+i;
if(debug['W'])
- print("case > %.8lux\n", r->val);
+ print("case > %.8llux\n", r->val);
gopcode(OGT, nodconst(r->val), n, Z);
sp = p;
gopcode(OEQ, nodconst(r->val), n, Z); /* just gen the B.EQ */
@@ -47,7 +47,7 @@ swit2(C1 *q, int nc, long def, Node *n, Node *tn)
swit2(q, i, def, n, tn);
if(debug['W'])
- print("case < %.8lux\n", r->val);
+ print("case < %.8llux\n", r->val);
patch(sp, pc);
swit2(r+1, nc-i-1, def, n, tn);
return;
@@ -60,7 +60,7 @@ direct:
patch(p, def);
for(i=0; i<nc; i++) {
if(debug['W'])
- print("case = %.8lux\n", q->val);
+ print("case = %.8llux\n", q->val);
while(q->val != v) {
nextpc();
p->as = ABCASE;
@@ -579,7 +579,7 @@ align(long i, Type *t, int op)
w = packflg;
break;
- case Ael1: /* initial allign of struct element */
+ case Ael1: /* initial align of struct element */
for(v=t; v->etype==TARRAY; v=v->link)
;
w = ewidth[v->etype];
@@ -600,7 +600,7 @@ align(long i, Type *t, int op)
}
break;
- case Aarg1: /* initial allign of parameter */
+ case Aarg1: /* initial align of parameter */
w = ewidth[t->etype];
if(w <= 0 || w >= SZ_LONG) {
w = SZ_LONG;
@@ -614,7 +614,7 @@ align(long i, Type *t, int op)
w = SZ_LONG;
break;
- case Aaut3: /* total allign of automatic */
+ case Aaut3: /* total align of automatic */
o = align(o, t, Ael2);
o = align(o, t, Ael1);
w = SZ_LONG; /* because of a pun in cc/dcl.c:contig() */