int
chipzero(Ieee *e)
{
- if(e->l != 0 || e->h != 0)
+ // We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions.
+ if(goarm < 7 || e->l != 0 || e->h != 0)
return -1;
return 0;
}
int n;
ulong h;
+ // We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions.
+ if(goarm < 7)
+ goto no;
+
if(e->l != 0 || (e->h&0xffff) != 0)
goto no;
h = e->h & 0x7fc00000;
#define AT_PLATFORM 15 // introduced in at least 2.6.11
#define AT_HWCAP 16 // introduced in at least 2.6.11
#define AT_RANDOM 25 // introduced in 2.6.29
-#define HWCAP_VFP (1 << 6)
+#define HWCAP_VFP (1 << 6) // introduced in at least 2.6.11
+#define HWCAP_VFPv3 (1 << 13) // introduced in 2.6.30
static uint32 runtime·randomNumber;
uint8 runtime·armArch = 6; // we default to ARMv6
uint32 runtime·hwcap; // set by setup_auxv
runtime·printf("this GOARM=%d binary. Recompile using GOARM=5.\n", runtime·goarm);
runtime·exit(1);
}
+ if(runtime·goarm > 6 && !(runtime·hwcap & HWCAP_VFPv3)) {
+ runtime·printf("runtime: this CPU has no VFPv3 floating point hardware, so it cannot run\n");
+ runtime·printf("this GOARM=%d binary. Recompile using GOARM=6.\n", runtime·goarm);
+ runtime·exit(1);
+ }
}
#pragma textflag 7