summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-05-26 21:07:26 -0700
committerRuss Cox <rsc@golang.org>2009-05-26 21:07:26 -0700
commitfdab225ba6f24dfb303b64a28830098a2cec0d77 (patch)
treeb814feaafac63e3db19da094ee5a0f3ba9d85992 /src/runtime
parentdf199034a7421a501fd63c9c0fa3eed9a10c8d75 (diff)
downloadgolang-fdab225ba6f24dfb303b64a28830098a2cec0d77.tar.gz
8g: 64-bit arithmetic and assorted bug fixes;
can run 64-bit sieve and powser. interfaces are limping along. next hurdle is floating point. R=ken OCL=29418 CL=29423
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/386/closure.c7
-rwxr-xr-xsrc/runtime/386/vlrt.c24
-rw-r--r--src/runtime/Makefile3
3 files changed, 32 insertions, 2 deletions
diff --git a/src/runtime/386/closure.c b/src/runtime/386/closure.c
index 8b7f8d291..6ccbe3b8b 100644
--- a/src/runtime/386/closure.c
+++ b/src/runtime/386/closure.c
@@ -27,7 +27,7 @@ sys·closure(int32 siz, byte *fn, byte *arg0)
// compute size of new fn.
// must match code laid out below.
- n = 6+5+2; // SUBL MOVL MOVL
+ n = 6+5+2+1; // SUBL MOVL MOVL CLD
if(siz <= 4*4)
n += 1*siz/4; // MOVSL MOVSL...
else
@@ -60,13 +60,16 @@ sys·closure(int32 siz, byte *fn, byte *arg0)
*p++ = 0x89;
*p++ = 0xe7;
+ // CLD
+ *p++ = 0xfc;
+
if(siz <= 4*4) {
for(i=0; i<siz; i+=4) {
// MOVSL
*p++ = 0xa5;
}
} else {
- // MOVL $(siz/8), CX [32-bit immediate siz/4]
+ // MOVL $(siz/4), CX [32-bit immediate siz/4]
*p++ = 0xc7;
*p++ = 0xc1;
*(uint32*)p = siz/4;
diff --git a/src/runtime/386/vlrt.c b/src/runtime/386/vlrt.c
index 9f205b92c..e7726127e 100755
--- a/src/runtime/386/vlrt.c
+++ b/src/runtime/386/vlrt.c
@@ -270,6 +270,12 @@ _divvu(Vlong *q, Vlong n, Vlong d)
}
void
+sys·uint64div(Vlong n, Vlong d, Vlong q)
+{
+ _divvu(&q, n, d);
+}
+
+void
_modvu(Vlong *r, Vlong n, Vlong d)
{
@@ -281,6 +287,12 @@ _modvu(Vlong *r, Vlong n, Vlong d)
dodiv(n, d, 0, r);
}
+void
+sys·uint64mod(Vlong n, Vlong d, Vlong q)
+{
+ _modvu(&q, n, d);
+}
+
static void
vneg(Vlong *v)
{
@@ -315,6 +327,12 @@ _divv(Vlong *q, Vlong n, Vlong d)
}
void
+sys·int64div(Vlong n, Vlong d, Vlong q)
+{
+ _divv(&q, n, d);
+}
+
+void
_modv(Vlong *r, Vlong n, Vlong d)
{
long nneg, dneg;
@@ -336,6 +354,12 @@ _modv(Vlong *r, Vlong n, Vlong d)
}
void
+sys·int64mod(Vlong n, Vlong d, Vlong q)
+{
+ _modv(&q, n, d);
+}
+
+void
_rshav(Vlong *r, Vlong a, int b)
{
long t;
diff --git a/src/runtime/Makefile b/src/runtime/Makefile
index a0e03fa16..ad236491f 100644
--- a/src/runtime/Makefile
+++ b/src/runtime/Makefile
@@ -114,3 +114,6 @@ cgo2c: cgo2c.c
runtime.acid: runtime.h proc.c
$(CC) -a proc.c >runtime.acid
+chan.acid: runtime.h chan.c
+ $(CC) -a chan.c >chan.acid
+