Commit ae605268 authored by Ken Thompson's avatar Ken Thompson

arm floating point simulation

R=rsc
CC=golang-dev
https://golang.org/cl/3565041
parent aa9c213e
...@@ -29,6 +29,11 @@ softfloat(void) ...@@ -29,6 +29,11 @@ softfloat(void)
p->cond->mark |= LABEL; p->cond->mark |= LABEL;
for(p = cursym->text; p != P; p = p->link) { for(p = cursym->text; p != P; p = p->link) {
switch(p->as) { switch(p->as) {
case AMOVW:
if(p->to.type == D_FREG || p->from.type == D_FREG)
goto soft;
goto notsoft;
case AMOVWD: case AMOVWD:
case AMOVWF: case AMOVWF:
case AMOVDW: case AMOVDW:
...@@ -37,6 +42,7 @@ softfloat(void) ...@@ -37,6 +42,7 @@ softfloat(void)
case AMOVDF: case AMOVDF:
case AMOVF: case AMOVF:
case AMOVD: case AMOVD:
case ACMPF: case ACMPF:
case ACMPD: case ACMPD:
case AADDF: case AADDF:
...@@ -47,13 +53,19 @@ softfloat(void) ...@@ -47,13 +53,19 @@ softfloat(void)
case AMULD: case AMULD:
case ADIVF: case ADIVF:
case ADIVD: case ADIVD:
goto soft;
default:
goto notsoft;
soft:
if (psfloat == P) if (psfloat == P)
diag("floats used with _sfloat not defined"); diag("floats used with _sfloat not defined");
if (!wasfloat || (p->mark&LABEL)) { if (!wasfloat || (p->mark&LABEL)) {
next = prg(); next = prg();
*next = *p; *next = *p;
// BL _sfloat(SB) // BL _sfloat(SB)
*p = zprg; *p = zprg;
p->link = next; p->link = next;
p->as = ABL; p->as = ABL;
...@@ -65,7 +77,8 @@ softfloat(void) ...@@ -65,7 +77,8 @@ softfloat(void)
wasfloat = 1; wasfloat = 1;
} }
break; break;
default:
notsoft:
wasfloat = 0; wasfloat = 0;
} }
} }
......
This diff is collapsed.
...@@ -230,7 +230,9 @@ struct M ...@@ -230,7 +230,9 @@ struct M
uint32 machport; // Return address for Mach IPC (OS X) uint32 machport; // Return address for Mach IPC (OS X)
MCache *mcache; MCache *mcache;
G* lockedg; G* lockedg;
uint64 freg[8]; // Floating point register storage used by ARM software fp routines uint32 freglo[16]; // D[i] lsb and F[i]
uint32 freghi[16]; // D[i] msb and F[i+16]
uint32 fflag; // floating point compare flags
#ifdef __WINDOWS__ #ifdef __WINDOWS__
void* gostack; // bookmark to keep track of go stack during stdcall void* gostack; // bookmark to keep track of go stack during stdcall
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment