summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--Inferno/arm/include/lib9.h2
-rw-r--r--Inferno/arm/include/u.h4
-rw-r--r--include/version.h2
-rw-r--r--libinterp/comp-arm.c38
-rw-r--r--libkern/frexp-arm.c4
-rw-r--r--libkern/frexp-thumb.c4
-rw-r--r--libkern/nan-arm.c18
-rw-r--r--libkern/vlop-arm.s12
-rw-r--r--libkern/vlop-thumb.s12
-rw-r--r--libkern/vlrt-arm.c9
-rw-r--r--os/ks32/fpi.h2
-rw-r--r--os/manga/fpi.h2
-rw-r--r--os/pxa/fpi.h2
-rw-r--r--os/sa1110/fpi.h2
-rw-r--r--utils/5c/cgen.c4
-rw-r--r--utils/5c/swt.c4
-rw-r--r--utils/5l/obj.c2
18 files changed, 60 insertions, 66 deletions
diff --git a/CHANGES b/CHANGES
index 2410e9c3..90c9452d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+20090627
+ push changes described for arm in 20090330 (but not previously pushed)
+ begin change of inferno-os.googlecode.com from svn to mercurial
200090612
added support for Linux-power (ericvh; and further simplified)
20090605
diff --git a/Inferno/arm/include/lib9.h b/Inferno/arm/include/lib9.h
index aa72ded4..15a0c6ea 100644
--- a/Inferno/arm/include/lib9.h
+++ b/Inferno/arm/include/lib9.h
@@ -5,4 +5,4 @@
* Extensions for Inferno to basic libc.h
*/
-#undef __LITTLE_ENDIAN /* math/dtoa.c; longs in ARM doubles are big-endian */
+#define __LITTLE_ENDIAN /* math/dtoa.c; longs in ARM doubles are big-endian */
diff --git a/Inferno/arm/include/u.h b/Inferno/arm/include/u.h
index 2ab381d2..e3d6e897 100644
--- a/Inferno/arm/include/u.h
+++ b/Inferno/arm/include/u.h
@@ -44,9 +44,9 @@ typedef unsigned long uintptr;
union FPdbleword
{
double x;
- struct { /* big endian (on 7500) */
- ulong hi;
+ struct { /* little endian (on VFP and now in software) */
ulong lo;
+ ulong hi;
};
};
diff --git a/include/version.h b/include/version.h
index cfc16254..6c97b040 100644
--- a/include/version.h
+++ b/include/version.h
@@ -1 +1 @@
-#define VERSION "Fourth Edition (20090624)"
+#define VERSION "Fourth Edition (20090627)"
diff --git a/libinterp/comp-arm.c b/libinterp/comp-arm.c
index a793c2c1..57ab31d4 100644
--- a/libinterp/comp-arm.c
+++ b/libinterp/comp-arm.c
@@ -7,7 +7,6 @@
* to do:
* eliminate litpool?
* eliminate long constants in comi/comd
- * bounds checks
* enable and check inline FP code (not much point with fpemu)
*/
@@ -115,6 +114,9 @@ enum
Stf,
Ldh,
+ Blo = 0, /* offset of low order word in big */
+ Bhi = 4, /* offset of high order word in big */
+
NCON = (0xFFC-8)/4,
SRCOP = (1<<0),
@@ -869,8 +871,8 @@ cbral(Inst *i, int jmsw, int jlsw, int mode)
schedcheck(i);
opwld(i, Lea, RA1);
mid(i, Lea, RA3);
- mem(Ldw, 0, RA1, RA2);
- mem(Ldw, 0, RA3, RA0);
+ mem(Ldw, Bhi, RA1, RA2);
+ mem(Ldw, Bhi, RA3, RA0);
CMP(AL, RA2, 0, 0, RA0);
label = nil;
dst = i->d.ins-mod->prog;
@@ -888,8 +890,8 @@ cbral(Inst *i, int jmsw, int jlsw, int mode)
BRA(NE, 0);
break;
}
- mem(Ldw, 4, RA3, RA0);
- mem(Ldw, 4, RA1, RA2);
+ mem(Ldw, Blo, RA3, RA0);
+ mem(Ldw, Blo, RA1, RA2);
CMP(AL, RA2, 0, 0, RA0);
BRADIS(jlsw, dst);
if(label != nil)
@@ -1039,16 +1041,16 @@ larith(Inst *i, int op, int opc)
{
opwld(i, Lea, RA0);
mid(i, Lea, RA3);
- mem(Ldw, 4, RA0, RA1); // ls (big endian `big' even in little endian mode)
- mem(Ldw, 4, RA3, RA2);
+ mem(Ldw, Blo, RA0, RA1); // ls
+ mem(Ldw, Blo, RA3, RA2);
DP(AL, op, RA2, RA2, 0, RA1) | SBIT; // ls: RA2 = RA2 op RA1
- mem(Ldw, 0, RA0, RA1);
- mem(Ldw, 0, RA3, RA0);
+ mem(Ldw, Bhi, RA0, RA1);
+ mem(Ldw, Bhi, RA3, RA0);
DP(AL, opc, RA0, RA0, 0, RA1); // ms: RA0 = RA0 opc RA1
if((i->add&ARM) != AXNON)
opwst(i, Lea, RA3);
- mem(Stw, 0, RA3, RA0);
- mem(Stw, 4, RA3, RA2);
+ mem(Stw, Blo, RA3, RA2);
+ mem(Stw, Bhi, RA3, RA0);
}
static void
@@ -1635,12 +1637,12 @@ comp(Inst *i)
opwld(i, Ldw, RA1);
opwst(i, Lea, RA2);
DP(AL, Mov, 0, RA0, (0<<3)|(2<<1), RA1); // ASR 32
- STW(AL, RA2, RA0, 0);
- STW(AL, RA2, RA1, 4);
+ STW(AL, RA2, RA1, Blo);
+ STW(AL, RA2, RA0, Bhi);
break;
case ICVTLW:
opwld(i, Lea, RA0);
- mem(Ldw, 4, RA0, RA0);
+ mem(Ldw, Blo, RA0, RA0);
opwst(i, Stw, RA0);
break;
case IBEQL:
@@ -1718,9 +1720,11 @@ comp(Inst *i)
//if(pass){print("%D\n", i); das(s, code-s);}
break;
case ISHLL:
+ /* should do better */
punt(i, SRCOP|DSTOP|THREOP, optab[i->op]);
break;
case ISHRL:
+ /* should do better */
punt(i, SRCOP|DSTOP|THREOP, optab[i->op]);
break;
case IRAISE:
@@ -2114,12 +2118,6 @@ typecom(Type *t)
t, t->size, t->initialize, t->destroy, n);
}
-extern ulong timer_start(void);
-extern ulong timer_ticks(ulong);
-extern ulong tmr2ms(ulong);
-extern ulong tmr2us(ulong);
-extern void timer_delay();
-
static void
patchex(Module *m, ulong *p)
{
diff --git a/libkern/frexp-arm.c b/libkern/frexp-arm.c
index 0acf6ec1..8973a14d 100644
--- a/libkern/frexp-arm.c
+++ b/libkern/frexp-arm.c
@@ -7,10 +7,10 @@
typedef union
{
double d;
- struct /* this is BIGENDIAN */
+ struct
{
- long ms;
long ls;
+ long ms;
};
} Cheat;
diff --git a/libkern/frexp-thumb.c b/libkern/frexp-thumb.c
index 0acf6ec1..8973a14d 100644
--- a/libkern/frexp-thumb.c
+++ b/libkern/frexp-thumb.c
@@ -7,10 +7,10 @@
typedef union
{
double d;
- struct /* this is BIGENDIAN */
+ struct
{
- long ms;
long ls;
+ long ms;
};
} Cheat;
diff --git a/libkern/nan-arm.c b/libkern/nan-arm.c
index f1cfa0b0..2152925a 100644
--- a/libkern/nan-arm.c
+++ b/libkern/nan-arm.c
@@ -13,8 +13,8 @@ NaN(void)
long x[2];
} a;
- a.x[0] = NANEXP;
- a.x[1] = 1;
+ a.x[1] = NANEXP;
+ a.x[0] = 1;
return a.d;
}
@@ -28,7 +28,7 @@ isNaN(double d)
} a;
a.d = d;
- if((a.x[0] & NANMASK) != NANEXP)
+ if((a.x[1] & NANMASK) != NANEXP)
return 0;
return !isInf(d, 0);
}
@@ -42,10 +42,10 @@ Inf(int sign)
long x[2];
} a;
- a.x[0] = NANEXP;
- a.x[1] = 0;
+ a.x[1] = NANEXP;
+ a.x[0] = 0;
if(sign < 0)
- a.x[0] |= NANSIGN;
+ a.x[1] |= NANSIGN;
return a.d;
}
@@ -59,11 +59,11 @@ isInf(double d, int sign)
} a;
a.d = d;
- if(a.x[1] != 0)
+ if(a.x[0] != 0)
return 0;
- if(a.x[0] == NANEXP)
+ if(a.x[1] == NANEXP)
return sign >= 0;
- if(a.x[0] == (NANEXP|NANSIGN))
+ if(a.x[1] == (NANEXP|NANSIGN))
return sign <= 0;
return 0;
}
diff --git a/libkern/vlop-arm.s b/libkern/vlop-arm.s
index d972ac1b..ffe30d11 100644
--- a/libkern/vlop-arm.s
+++ b/libkern/vlop-arm.s
@@ -6,17 +6,17 @@ arg=0
/* replaced use of R10 by R11 because the former can be the data segment base register */
TEXT _mulv(SB), $0
- MOVW 8(FP), R9 /* l0 */
- MOVW 4(FP), R11 /* h0 */
- MOVW 16(FP), R4 /* l1 */
- MOVW 12(FP), R5 /* h1 */
+ MOVW 4(FP), R9 /* l0 */
+ MOVW 8(FP), R11 /* h0 */
+ MOVW 12(FP), R4 /* l1 */
+ MOVW 16(FP), R5 /* h1 */
UMULL(4, 9, 7, 6, 0)
MUL(11, 4, 8, 0)
ADD R8, R7
MUL(9, 5, 8, 0)
ADD R8, R7
- MOVW R6, 4(R(arg))
- MOVW R7, 0(R(arg))
+ MOVW R6, 0(R(arg))
+ MOVW R7, 4(R(arg))
RET
/* multiply, add, and right-shift, yielding a 32-bit result, while
diff --git a/libkern/vlop-thumb.s b/libkern/vlop-thumb.s
index d972ac1b..ffe30d11 100644
--- a/libkern/vlop-thumb.s
+++ b/libkern/vlop-thumb.s
@@ -6,17 +6,17 @@ arg=0
/* replaced use of R10 by R11 because the former can be the data segment base register */
TEXT _mulv(SB), $0
- MOVW 8(FP), R9 /* l0 */
- MOVW 4(FP), R11 /* h0 */
- MOVW 16(FP), R4 /* l1 */
- MOVW 12(FP), R5 /* h1 */
+ MOVW 4(FP), R9 /* l0 */
+ MOVW 8(FP), R11 /* h0 */
+ MOVW 12(FP), R4 /* l1 */
+ MOVW 16(FP), R5 /* h1 */
UMULL(4, 9, 7, 6, 0)
MUL(11, 4, 8, 0)
ADD R8, R7
MUL(9, 5, 8, 0)
ADD R8, R7
- MOVW R6, 4(R(arg))
- MOVW R7, 0(R(arg))
+ MOVW R6, 0(R(arg))
+ MOVW R7, 4(R(arg))
RET
/* multiply, add, and right-shift, yielding a 32-bit result, while
diff --git a/libkern/vlrt-arm.c b/libkern/vlrt-arm.c
index 58cf5591..e4ef727a 100644
--- a/libkern/vlrt-arm.c
+++ b/libkern/vlrt-arm.c
@@ -13,15 +13,8 @@ struct Vlong
{
struct
{
- ulong hi;
ulong lo;
- };
- struct
- {
- ushort hims;
- ushort hils;
- ushort loms;
- ushort lols;
+ ulong hi;
};
};
};
diff --git a/os/ks32/fpi.h b/os/ks32/fpi.h
index dfb9b1df..abaa7c12 100644
--- a/os/ks32/fpi.h
+++ b/os/ks32/fpi.h
@@ -1,8 +1,8 @@
typedef long Word;
typedef unsigned long Single;
typedef struct {
- unsigned long h;
unsigned long l;
+ unsigned long h;
} Double;
enum {
diff --git a/os/manga/fpi.h b/os/manga/fpi.h
index dfb9b1df..abaa7c12 100644
--- a/os/manga/fpi.h
+++ b/os/manga/fpi.h
@@ -1,8 +1,8 @@
typedef long Word;
typedef unsigned long Single;
typedef struct {
- unsigned long h;
unsigned long l;
+ unsigned long h;
} Double;
enum {
diff --git a/os/pxa/fpi.h b/os/pxa/fpi.h
index dfb9b1df..abaa7c12 100644
--- a/os/pxa/fpi.h
+++ b/os/pxa/fpi.h
@@ -1,8 +1,8 @@
typedef long Word;
typedef unsigned long Single;
typedef struct {
- unsigned long h;
unsigned long l;
+ unsigned long h;
} Double;
enum {
diff --git a/os/sa1110/fpi.h b/os/sa1110/fpi.h
index dfb9b1df..abaa7c12 100644
--- a/os/sa1110/fpi.h
+++ b/os/sa1110/fpi.h
@@ -1,8 +1,8 @@
typedef long Word;
typedef unsigned long Single;
typedef struct {
- unsigned long h;
unsigned long l;
+ unsigned long h;
} Double;
enum {
diff --git a/utils/5c/cgen.c b/utils/5c/cgen.c
index 65db14c4..01bdb7e2 100644
--- a/utils/5c/cgen.c
+++ b/utils/5c/cgen.c
@@ -873,12 +873,12 @@ sugen(Node *n, Node *nn, long w)
reglcgen(&nod1, nn, Z);
nn->type = t;
- if(1 || align(0, types[TCHAR], Aarg1)) /* isbigendian */
+ if(align(0, types[TCHAR], Aarg1)) /* isbigendian */
gopcode(OAS, nod32const(n->vconst>>32), Z, &nod1);
else
gopcode(OAS, nod32const(n->vconst), Z, &nod1);
nod1.xoffset += SZ_LONG;
- if(1 || align(0, types[TCHAR], Aarg1)) /* isbigendian */
+ if(align(0, types[TCHAR], Aarg1)) /* isbigendian */
gopcode(OAS, nod32const(n->vconst), Z, &nod1);
else
gopcode(OAS, nod32const(n->vconst>>32), Z, &nod1);
diff --git a/utils/5c/swt.c b/utils/5c/swt.c
index 4c2b33ec..5ee0e39f 100644
--- a/utils/5c/swt.c
+++ b/utils/5c/swt.c
@@ -382,13 +382,13 @@ gextern(Sym *s, Node *a, long o, long w)
{
if(a->op == OCONST && typev[a->type->etype]) {
- if(1 || align(0, types[TCHAR], Aarg1)) /* isbigendian */
+ if(align(0, types[TCHAR], Aarg1)) /* isbigendian */
gpseudo(ADATA, s, nod32const(a->vconst>>32));
else
gpseudo(ADATA, s, nod32const(a->vconst));
p->from.offset += o;
p->reg = 4;
- if(1 || align(0, types[TCHAR], Aarg1)) /* isbigendian */
+ if(align(0, types[TCHAR], Aarg1)) /* isbigendian */
gpseudo(ADATA, s, nod32const(a->vconst));
else
gpseudo(ADATA, s, nod32const(a->vconst>>32));
diff --git a/utils/5l/obj.c b/utils/5l/obj.c
index af9380dc..2eadf877 100644
--- a/utils/5l/obj.c
+++ b/utils/5l/obj.c
@@ -1387,7 +1387,7 @@ nuxiinit(void)
inuxi1[i] = c;
inuxi4[i] = c;
fnuxi4[i] = c;
- if(debug['d']){
+ if(!debug['d']){
fnuxi8[i] = c;
fnuxi8[i+4] = c+4;
}