mirror of
https://github.com/golang/go
synced 2024-11-25 11:07:59 -07:00
runtime: fix arm softfloat again for R12
Missed a case, so now generalized. R=ken2 CC=golang-dev https://golang.org/cl/2540042
This commit is contained in:
parent
9cc8e9ef48
commit
2012604002
@ -449,7 +449,7 @@ loadstore(uint32 *pc, uint32 *regs)
|
|||||||
isload = i>>20&1;
|
isload = i>>20&1;
|
||||||
p = i>>24&1;
|
p = i>>24&1;
|
||||||
ud = i>>23&1;
|
ud = i>>23&1;
|
||||||
tlen = i>>(22 - 1)&1 | i>>15&1;
|
tlen = i>>(22 - 1)&1 | i>>15&1; // NOTE(rsc): should this say i>>(22-1)&2 (not &1)?
|
||||||
wb = i>>21&1;
|
wb = i>>21&1;
|
||||||
reg = i>>16 &0xf;
|
reg = i>>16 &0xf;
|
||||||
freg = i>>12 &0x7;
|
freg = i>>12 &0x7;
|
||||||
@ -497,33 +497,6 @@ ret:
|
|||||||
fabort();
|
fabort();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
loadconst(uint32 *pc, uint32 *regs)
|
|
||||||
{
|
|
||||||
uint32 offset;
|
|
||||||
uint32 *addr;
|
|
||||||
|
|
||||||
if ((*pc & 0xfffff000) != 0xe59fb000 || (*(pc+1) & 0xffff8fff) != 0xed9b0100)
|
|
||||||
goto undef;
|
|
||||||
|
|
||||||
offset = *pc & 0xfff;
|
|
||||||
addr = (uint32*)((uint8*)pc + offset + 8);
|
|
||||||
//printf("DEBUG: addr %p *addr %x final %p\n", addr, *addr, *addr + regs[12]);
|
|
||||||
regs[11] = *addr;
|
|
||||||
loadstore(pc + 1, regs);
|
|
||||||
goto ret;
|
|
||||||
|
|
||||||
undef:
|
|
||||||
doabort = 1;
|
|
||||||
|
|
||||||
ret:
|
|
||||||
if (trace || doabort) {
|
|
||||||
printf(" %p coproc const %x %x %x\n", pc, *pc, *(pc+1), *(pc+2));
|
|
||||||
}
|
|
||||||
if (doabort)
|
|
||||||
fabort();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fltfix(uint32 *pc, uint32 *regs)
|
fltfix(uint32 *pc, uint32 *regs)
|
||||||
{
|
{
|
||||||
@ -622,12 +595,13 @@ stepflt(uint32 *pc, uint32 *regs)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// lookahead for virtual instructions that span multiple arm instructions
|
if((i&0xfffff000) == 0xe59fb000) {
|
||||||
c = ((*pc & 0x0f000000) >> 20) |
|
// load r11 from pc-relative address.
|
||||||
((*(pc + 1) & 0x0f000000) >> 24);
|
// might be part of a floating point move
|
||||||
if(c == 0x5d) { // 0101 1101
|
// (or might not, but no harm in simulating
|
||||||
loadconst(pc, regs);
|
// one instruction too many).
|
||||||
return 2;
|
regs[11] = *(uint32*)((uint8*)pc + (i&0xfff) + 8);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user